ApiStatus

Family: Studio · One form

What it does

Returns the HTTP status code the service sent back for an API task.

Syntax

ApiStatus(tache integer) → integer

Parameters

NameTypeMeaning
tacheintegerThe task id returned by ApiRequest().

Every form returns

integer

The service's status code (200, 404, 500...), 0 while the task runs, or -1 if the request failed (proxy, network, token) or the id is unknown.

Good to know

  • A 404 or 500 from the service is an answer, not a failure: read its body with ApiResponse(). A failure of Aukimi's proxy gives -1 and ApiError() says why.
  • Editor and HTML5 exports only: native (Bevy) builds stop with an unsupported-command error.

Example · generated

DO  Print(ApiStatus(1))  Sync()LOOP

ApiStatus is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

133 commands in Studio