Using a an Azure Classic Cloud Service, we are making REST API calls to a 2020R2 instance (default endpoint), using a token granted through a Connected Application. So for each API request, we are including the “Bearer” header with the access token. This access token was acquired by a different system and sent to the cloud service to process an import/export of data. (The cloud service makes no “login” request, requests with username/password, no “logout” request, no token renewals)
When exporting data TO the Acumatica instance, depending on the amount of data to be executed, we make 25-1000+ API calls to that instance (checking if a record exists, if not creating the record. Also checking dependencies).
Issue: In the middle of an export process, we experience a failed call with a HTTP Status Code 401 returned with the following data:
{"message":"You are not logged in."}
This occurred after checking the status of a long-running ReleaseBill Action. This is the order of requests:
GET /entity/Default/18.200.001/Bill?$filter=... → OK
PUT /entity/Default/18.200.001/Bill → OK
POST /entity/Default/18.200.001/Bill/ReleaseBill → Accepted
GET /entity/Default/18.200.001/Bill/ReleaseBill/status/{id} → Accepted (few times)
GET /entity/Default/18.200.001/Bill/ReleaseBill/status/{id} → No Content
GET /entity/Default/18.200.001/Bill?$filter=... → Failed 401 (same request parameters as the first GET /Bill)
The Access token was good for another 30 minutes and was able to be used for additional exports and manual Postman requests before renewing it.
Any ideas on why we received the 401? Is it possible to trace the REST API calls from the Acumatica instance?