0

I'm trying to programmatically create a hosted feature service from a .geojson file. I can do this manually without problem using the arcgis.com website. However I cannot get it to work using the rest api. Making a request such as:

https://xxxx.maps.arcgis.com/sharing/rest/content/users/xxxx/additem?f=json&&type=GEOJSON&title=TestUpload&token=xxxxx

returns an error {"error":{"code":400,"messageCode":"CONT_0113","message":"Item type not valid.","details":[]}}.

I can upload other content types such as .csv using the same code without problem such as

 https://xxxx.maps.arcgis.com/sharing/rest/content/users/xxxx/additem?f=json&&type=CSV&title=TestUpload&token=xxxxxxx

I don't see geojson listed as an item type here so is it unsupported by the api or an I using the wrong key word?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.