I am trying to use the ArcGIS Online REST API to add a new item of type Map Service. I am successfully able to do this, but I also want to override some properties of the service when I create the item. The "Items and Item Types" section of the REST API docs (ArcGIS REST API ) indicates that when adding an item with "type=Map Service" it's possible to specify a JSON string to override map service properties. I have experimented with this, but can't seem to get it working -- ArcGIS Online seems to ignore any JSON I specify.
I have tried specifying the JSON in the "text" parameter posted to the addItem REST end point, and I have also tried specifying the JSON in the body of the HTTP post. In both cases, my JSON seems to get ignored.
Ideally I would like to specify JSON that ArcGIS Online injects into the "dynamicLayers=..." parameter of the "export" request it makes to the target ArcGIS Server.
What should the format of the JSON be?
How do I pass the JSON in the HTTP POST request? (In the "text" parameter?)
What service properties is it possible to override?
Does anyone have an example?
Thanks for your help!