Hi all, I'm using the REST API and trying to upload GeoJSON files to a specific folder (called "uploads"). I'm following the addItem documentation here and it is working to upload items to my account, however the uploads just appear as miscellaneous items in my content directory rather than in the upload folder.
The documentation seems to suggest there should be a way to specify a target folder for addItem:
"The Add Item operation (POST only) is used to upload an item file, submit text content, or submit the item URL to the specified user folder depending on documented items and item types. This operation is available only to the specified user."
However there is no listed argument to set the target folder. I have tried a few guesses, like "folder", but nothing has worked so far. Is there a best practice on how to do this?
The response from addItem gives me hope that it's possible:
{
"success": true,
"id": "950de34a8a7c42ecb937cc3f8570db67",
"folder": null
}
With the right argument, I would hope the "folder" property would have the folder's ID listed instead of null.
Solved! Go to Solution.
You can accomplish this by adding the folder ID to the request url as such:
https://[root]/content/users/[userName]/[folderID]/addItem
THANK YOU! That is the answer. Much appreciated!