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&re...
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.
I'm hoping to rekindle this thread. Was there a solution for this? I'm having exactly the same issue whereby I want to extract the token itself, and none of the text either side of it in the response.
While the json returned should be consistent in format, you may wish to search for "token":" and start your substring after its location.