GWM_0003 "You do not have permissions to access this resource" when using REST API for user content

492
0
12-12-2023 09:08 AM
Labels (2)
abri_dparker
New Contributor

I am new to ArcGIS Online. I have add a CSV item using ArcGIS Online front end.

Now I am trying to use the REST API to update it. First of all I wanted to get the item to confirm it exists and I can access it. I am making a request like this:

curl --request GET \
'https://XXXX.maps.arcgis.com/sharing/rest/content/users/{username}/items/{itemId}?f=json&token={agol...}' \
-H 'Content-Type: application/json'

But then I get this response:

GWM_0003 "You do not have permissions to access this resource" 

So far I have gone to the developers website and I have created an OAuth application for the same user that is the "owner" of the Item I am trying to retrieve/update, but despite this I get the GWM_0003 error.


I am generating the token like this, which returns a valid token, which I am then passing in as a parameter.

curl --request POST \
'https://XXXX.maps.arcgis.com/sharing/rest/oauth2/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=YOUR_CLIENT_ID' \
--data-urlencode 'client_secret=YOUR_CLIENT_SECRET' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'f=json'

Struggling to work out what I am missing here? Appreciate any pointers 🙂

Tags (4)
0 Kudos
0 Replies