Is there a fixed string length to an AGOL token or does it vary every time generateToken is called via REST?
Right now I'm using https://www.arcgis.com/sharing/rest/generateToken?f=pjson&username=MYUSERNAME&password=MYPASSWORD&referer=http://www.arcgis.com&expiration=120
If not can the token, ssl, and expiry field and quotes be removed from the response?
The AGOL token is a text string of consistent length. I would use the python json module for extracting the token and other items in the response. If you are using another method to extract the token, it will be quoted string following the word token. If you use f=json, you will get json without formatting which may make it easier to parse.
Even with f=json I still get this:
Can you use an expression like mid(string, start, end)? Or find the third " and select to the fourth ".
I'm using Integromat which has numerous string functions including substring. If the token string length doesn't change, I should be able to use that function.
While the json returned should be consistent in format, you may wish to search for "token":" and start your substring after its location.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.