Select to view content in your preferred language

Accessing User Content From ArcGIS Rest API Using Custom Widget Getting Invalid Token Error

77
0
Saturday
Labels (1)
sakildev1
New Contributor

Hello,

I was trying to explore user contents by following the documents https://developers.arcgis.com/rest/users-groups-and-items/user-content/, and I used the API https://machine.domain.com/webadaptor/sharing/rest/content/users/jsmith?sf=json&token=mytoken.

Option 1: When the token is generated from https://machine.domain.com/webadaptor/sharing/rest/generateToken, the content API is working perfectly from Postman, but from the widget, it is getting the error "Invalid token.".

sakildev1_0-1746903108352.png

Option 2: If the token is generated from Python, then the API is working perfectly, both from the widget and Postman

gis = GIS(portal_url, username, password)
print(gis._con.token)

I am seeking help to get a prompt solution to work with Option A because the token is generated from a .NET application.

Thank you
Sakil

0 Kudos
0 Replies