I read on the following post https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-is-there-a-way-to-validate-user-token/m-p/320611#M1565 you could use your https://developers.arcgis.com/rest/users-groups-and-items/portal-self/ to validate a token and I can verified it could be used with the browser and postman to validate a token. Still I cannot manage to make it work either using javascript's fetch or jquery's ajax functions. It returns invalid token even though it is valid using the browser. Can anyone help me with this? Thanks in advance.
example:
fetch('.../sharing/rest/portals/self?f=json&token=' + token,{ method: 'GET'}).then(...).catch( ....);
always returns
{"code": 498,"message": "Invalid token.","details": []}
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.