Example Python code and XML-file for editing metadata in ArcGIS Online
✓ Published0🌍 Public
FFrieseWoudloper
Last edited Jul 20, 2018
Created on Jul 20, 2018
This example shows how to programmatically update an item’s metadata in ArcGIS Online by uploading a local XML file. It uses the ArcGIS REST API’s `generateToken` endpoint for authentication and the `update` endpoint to overwrite metadata. The Python script relies on the `requests` library to send a POST request with the XML file as multipart form data. The token request sends credentials and a referer URL, returning a JSON response with the token. The script then uses that token to call the update operation, with the metadata file attached under the `metadata` parameter. The approach directly demonstrates API‑driven metadata editing without a web interface.
AI-generated description