Is it possible to change the ItemID of a Portal Item (e.g. a webmap) to a specific value, or to set a specific ItemID when creating a new item? I don't see any API supporting that so I assume it isn't possible...is my assumption correct?
Hello Tobias!
You are correct, it is not possible to specify an itemID or modify an existing one, although I do see some potential value in doing so for certain use cases.
If it does not already exist, I would recommend posting an idea for this here on GeoNet.
-Danny
Here is an update
/addItem: Add Item—ArcGIS REST APIs | ArcGIS Developers
itemIdToCreate | New at 10.8.1. The item ID of the item. The item ID must not exist and must be 32 alphanumeric values. Note:itemIdToCreate applies only to ArcGIS Enterprise. Example itemIdToCreate=832157e321df46f721f9ededbe34ac58 |
Allows to specify the ItemID to Create:
/portal/sharing/rest/content/users/siteadmin/addItem
This doesnt seem to be working for me in Enterprise 11+. I'm trying to add a new feature service and it just blatantly ignores my itemIdToCreate, which I know for a fact is valid, because the itemId came from my dev portal.
Ok I see now that if you specify dataUrl then it doesnt work.
Hosted or referenced feature Service? For hosted Services, you can upload the SD file, if I remember correctly. If it is a referenced Feature Service, my workflow is to publish it using the SD file, create an "empty" portal Item with intended ID, then copy the properties from the auto-generated item from the publishing step into the new item. Maybe there is a better way to do it, but it works for me.
/addItem: Add Item | ArcGIS REST APIs | ArcGIS Developers
Items and item types | ArcGIS REST APIs | ArcGIS Developers
Try this:
- go to the /addItem Endpoint
- URL: set a placeholder URL
- Title: some unique Title
- Type: Map Service
- ItemId to Create: set something like 113a4502954a46ec6f06f6a7ac8f6cb9
When clicking on Add Item, now the "empty" item with the intended ID is created. More information/data can be added.
You can then use the items/113a4502954a46ec6f06f6a7ac8f6cb9 endpoints to update the item or delete it.