Skip to main content
Version: v5.3

Async Request

Overview​

If a request takes longer than 100 seconds, a 524 timeout error may occur. To avoid this, include the parameter async=true in the request.

When this parameter is used, the API returns a URL for retrieving the result, along with an access token.

Notes on usage​

Obtaining final response​

To obtain the final response, call the returned URL and include the provided token in the request header.

See sanple request and response below.

Sample request​

/omapi/auto4244_QyfXtykr/assets/6716062088f9860c256d2af5?nsfilter=auto4244_QyfXtykr&asyncReq=true

Sample response​

{
"_requestid": "c1e2371b-143b-4c46-813f-ae469a6e67fc",
"_result": {
"url": "https://qa2-api.in.invicara.com/objectmodelsvc/api/v1/async/request/c1e2371b-143b-4c46-813f-ae469a6e67fc",
"authToken": "<AUTH_TOKEN>"
}
}

Retrieving the async request result​

To retrieve the result of an async OMAPI request, use the API call below, along with a valid authentication token.

/objectmodelsvc/api/v1/async/request/<REQUEST-ID>

This endpoint returns the final response generated for the async request.

Example API call​

This call returns the completed response for the specified request ID.

curl -X GET "https://qa2-api.in.invicara.com/objectmodelsvc/api/v1/async/request/c1e2371b-143b-4c46-813f-ae469a6e67fc" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
-H "Content-Type: application/json"

Error responses​

ErrorDescription
Request still in progressIf the async OMAPI request has not finished processing, the response will be: "OMAPI request has not completed yet!!"
Invalid access tokenIf an invalid token is provided, the response will be: "Invalid access!!"
Response not foundIf no response is available for the given request ID and token, the API returns: "OMAPI response not found for the specified request ID and auth token."