I am trying to use the survey123 feature report API to generate reports programmatically with Javascript. The idea is to create an application with an interface where the user fetches the report to download.
In order to create the reports, one of the required parameters is the token generated during the login session.
To generate the token, I’m using the “@esri/arcgis-rest-auth” module.
Another way that I tried for generating the token is through the ArcGIS REST API POST request with the “generateToken” method with the following specifications:
With both token generating methods I get the same error when requesting a report. “Error: Could not generate report! An error occurred when rendering by the report engine. Failed to print map. Error: Failed to load feature layer: Invalid token.”
Is there another way for generating a valid token? Is the error related to the current token generated or is the error related to something else?