Fetch output of an asynchronous request
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
Request
Authorization
You must provide a token in Authorization
header with Bearer
scheme, as:
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>
Request ID from request creation API.
Example: 98nlux8b0eu6
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 code200
-299
."failed"
: The request has ended with status code other than200
-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"
.