akajanus-esristaff

Publishing services through REST API

Discussion created by akajanus-esristaff Employee on Jun 3, 2013
Latest reply on Jun 4, 2013 by akajanus-esristaff
I try to publish a service through REST API. I have uploaded csv file into ArcGIS Online and I try to publish it with publishParameters.

The file is shared and it is uploaded with my account. I have managed to do this couple months ago but it seems that this works differently now. Any pointers what have happened or have I just broken my code?

Call:
"https://www.arcgis.com/sharing/rest/content/users/-myname-/publish?itemId=f0d499594c7c4600a439481b07da3f97,filetype=csv,token=aWKhLO9oIIvdHYwGpObDLED2brCqgtlL8IZAINDIYCNvJkNW7Y2v4-Yo2B5IjjE-JDLXMtDM_ASxc0CMcPDNehM-2S609AnzanXYL01IOWnfl-92CERTeglZcvl_KKRy,publishParameters={\"name\":\"TestService123456\",\"locationType\":\"coordinates\",\"latitudeFieldName\":\"Latitude\",\"longitudeFieldName\":\"Longitude\",\"description\":\"test description\",\"maxRecordCount\":500,\"copyrightText\":\"test copyright\",\"layerInfo\":{\"fields\":[{\"name\":\"ObjectId\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"FID\",\"sqlType\":\"sqlTypeInteger\",\"nullable\":false,\"editable\":false,\"domain\":null},{\"name\":\"Level\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"Level\",\"sqlType\":\"sqlTypeOther\",\"nullable\":false,\"editable\":true,\"domain\":{\"type\":\"codedValue\",\"name\":\"RouteDifficulty\",\"codedValues\":[{\"name\":\"Easy\",\"code\":1},{\"name\":\"Normal\",\"code\":2},{\"name\":\"Hard\",\"code\":3},{\"name\":\"Extreme\",\"code\":4}]},\"defaultValue\":null},{\"name\":\"Longitude\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Longitude\",\"nullable\":false,\"editable\":true,\"domain\":null},{\"name\":\"Latitude\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Latitude\",\"nullable\":false,\"editable\":true,\"domain\":null}]}}&f=json"

Response:
"{\"error\":{\"code\":403,\"messageCode\":\"GWM_0003\",\"message\":\"You do not have permissions to access this resource or perform this operation.\",\"details\":[]}}"

Outcomes