I noticed the new Metadata feature on AGOL, thanks ESRI!! While it is great that we can manually upload ArcGIS formatted .xml metadata...
Has anyone had success uploading an XML through REST/python script to an AGOL hosted service?
Based on my reading of the REST API documentation, it should be possible with an update item operation. I've been attempting this for a while without any luck. Any suggestions?
My most recent variation (using requests):
def uploadMeta():
baseURL= agol.http+'/content/users/{}/items/{}/update'.format(agol.username, agol.itemID)
metaUp = {"file": open(updatedXML, 'rb')}
updatemetaurl = baseURL + "?f=json"+\
"&file=metadata.xml"+"&overwrite=true&token="+agol.token
responseMeta = requests.post(updatemetaurl, files=metaUp, proxies=proxyDict)
this returns a <Response[200]> and response text:{u'id': u'4b99244d8df34ffba9c7ddf1dc20ea88', u'success': True} BUT the metadata isn't updated. I can use the AGOL UI to manually update the metadata, but I need a way to automate. Any help would be great appreciated.
the updatemetaurl I'm using here ends up looking like this:
http://www.arcgis.com/sharing/rest/content/users/sm970mn/items/4b99244d8df34ffba9c7ddf1dc20ea88/upda...