I want to share a map into a group. I use a post call
https://<portal_url>/sharing/rest/content/users/<user_owner>/shareItems/?f=json
body:
items=35767ae53e0f497e9e5789ca90ad6f77
groups=d67c7123e9454d678de355cbdb57e6be
confirmItemControl=true
everyone=false
org=false
and I get this has result:
I should receive something like that:
{ "results": [ { "itemId": "35767ae53e0f497e9e5789ca90ad6f77", "success": true, "notSharedWith": [ ] } ]}
Why do I get this empty result? Evidently the sharing is not working but I do not even receive a success : false result.
I login into the portal UI and I can share the map easily to the group.
Please help.
Found the soluition. The API reference is not clear on this. groups parameter must be pass has a querystring parameter, not in the body. In the reference exemple, there is no ? after /share...
URL for Share Item
http://www.arcgis.com/sharing/rest/content/items/af01df44bf36437fa8daed01407138ab/share groups=bf51aa6e879e4676b683dcbefb0ab0a9,cc5f73ab367544d6b954d82cc9c6dab7
Should have been (I would have save 3 hours):
URL for Share Item
http://www.arcgis.com/sharing/rest/content/items/af01df44bf36437fa8daed01407138ab/share?groups=bf51aa6e879e4676b683dcbefb0ab0a9,cc5f73ab367544d6b954d82cc9c6dab7