Overview
Fetch the status and output of an asynchronous request
(that was created in request creation API).
The response will be considered as success or failure depending on its status code.
All status codes between 200 and 299 will be considered as a successful request and display
status "completed"; other status codes, especially 400-499 (cilent errors) and 500-599
(server errors) will be handled as status "failed".
Interaction code example
$ curl \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/async/${REQUEST_ID}/output" | jq
{
"status": "completed",
"status_code": 200,
"raw_output": "{\"text\": \"Hello!\"}",
"output": {
"text": "Hello!"
}
}
Request
Authorization
You must provide a token in Authorization header with Bearer scheme, as:Authorization: Bearer <token>
The token can be found in the web UI (in service overview’s Request dialog).
Path parameters
Base URL for your service. This value can be found in the web UI (in service overview’s
Request dialog).Typical value: https://serve-api.dev2.vssl.ai/api/v1/services/<slug>
Response
Status of the request. Its possible values and meanings are as follows.
"pending": The request is waiting in the queue.
"in_progress": The request is being processed.
"completed": The request has ended with status code 200-299.
"failed": The request has ended with status code other than 200-299,
or an internal error has occurred. In either case, fail_reason
field will also be present.
Status code response.This field is only present when status is either "completed" or "failed".
Raw bytes of the response body.This field is only present when status is either "completed" or "failed".
Response body, decoded as JSON. If the response body is not a valid JSON, this field
is omitted.This field is only present when status is either "completed" or "failed".
Human-readable explanation for failure.This field is only present when status is "failed".
{
"status": "completed",
"status_code": 200,
"raw_output": "{\"text\": \"Hello!\"}",
"output": {
"text": "Hello!"
}
}