Create multiple records via API from a single POST request?

Discussion created by 7595500 on Jun 24, 2015
Latest reply on Jun 25, 2015 by Doron Gordon

Does anyone know if it is possible to create multiple records via the API from a single POST request? For example...


I have the following Sites that need be created:


Name: US Office
Location: Minneapolis


Name: Canada Office
Location: Toronto


I can create them individually with the following:


curl —-digest -v -u 'username:password' -H "Accept: application/xml" -H "Content-Type:text/xml" -d "<site><name>US Office</name><location>Minneapolis</location></site>" -X POSThttps://api.samanage.com/sites.xml




curl —-digest -v -u 'username:password' -H "Accept: application/xml" -H "Content-Type:text/xml" -d "<site><name>Canada Office</name><location>Toronto</location></site>" -X POSThttps://api.samanage.com/sites.xml


However, I'm not able to add them from the same call as there doesn't seem to be a wrapper above <site> (for instance <sites>) that I can use.


Is processing multiple requests at once something that will need to be scripted? If so, has anyone in the community developed something they would be willing to share?


Thank you,