We can get token with https://www.arcgis.com/sharing/generateToken by POST method and following format of parameters: f=json&username=USERNAME&password=PASSWORD&client=requestip
But when use that token to query a hosted Survey123 result feature service on https://services3.arcgis.com, got following error: {"error":{"code":498,"message":"Invalid token.","details":["Invalid token."]}}
Any idea?
Arthur,
I don't know if this will help you, but I thought I'd take a shot anyways.
The query string parameters for your token request, specifically the 'client=requestip' part I believe binds that token to the IP address that made the request. If you're using that token from a different machine, that may contribute to your error. Have you tried making a token request using a referer? I do this all the time and its effective for my workflows. Instead of 'client=requestip' you would use 'client=referer&referer=<some url>'. Be sure that when you're querying your Survey123 feature service that the web request uses that same referer URL or you will be back where you started.
Full disclosure, I don't use Survey123, but I did write a Windows service that syncs my company's proprietary geospatial data with ArcGIS Online's feature services.
I hope this helps.
Cheers.
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.