‎17-07-2020 10:43 PM
Hello,
I have a problem with the Async method of the REST APIs.
Every time I try to execute it, I have a RESTAPI - "Message": "HopexSessionToken is empty".
Get Repos will work (so RestAPI config is fine) :
{{server_url}}/hopexapi/restapi/v1/environments/{{environmentId}}/repositories
All others won't work
{{server_url}}/hopexapi/restapi/v2/environments/{{environmentId}}/repositories/{{RepositoryId}}/profiles/{{ProfileId}}/datasets/{{datasetId}}/syncexport
{{server_url}}/hopexapi/restapi/v1/environments/{{environmentId}}/repositories/{{RepositoryId}}/profiles/{{ProfileId}}/syncexport
Same problem arrises if using async method with GraphQl
Will work :
Won't work:
Would you have any idea what would cause that ?
Tested in V3C4
Thanks !
Solved! Go to Solution.
‎20-07-2020 06:57 PM - edited ‎20-07-2020 06:58 PM
Thank you for the detailed explanation and link.
In our case, when testing, we had x-hopex-task and x-hopex-sessiontoken ticked in Postman for our first request, which resulted in the above mentionned errors.
Ticking them off for the first request and re-ticking them solved our issue in our testing.
‎20-07-2020 09:19 AM
To have the ASYNC work you need to make at least 2 calls :
See some explanation here :
https://community.mega.com/t5/REST-API/Asynchronous-versus-Synchronous-Web-service-call/m-p/21913#M6
On the first request there should not be the header with HopexSessionToken.The result of the first request return the value of the session Token.
For the second request you must provide the session token.
Have you performed your queries in this order ?