GET
{base_url}
/
async
/
{request_id}
/
output

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:

Authorization: Bearer <token>

The token can be found in the web UI (in service overview’s Request dialog).

Path parameters

base_url
string
required

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
string
required

Request ID from request creation API.

Example: 98nlux8b0eu6

Response

status
string

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
int

Status code response.

This field is only present when status is either "completed" or "failed".

raw_output
string

Raw bytes of the response body.

This field is only present when status is either "completed" or "failed".

output
any

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".

fail_reason
string

Human-readable explanation for failure.

This field is only present when status is "failed".