What it does
Reads one field of an API task's JSON answer, by a dotted path such as user.name or items.0.id.
Syntax
ApiJson(tache integer, cle string) → stringParameters
| Name | Type | Meaning |
|---|---|---|
| tache | integer | The task id returned by ApiRequest(). |
| cle | string | The dotted path to the field. Array items are reached by their index, from 0. An empty path returns the whole answer. |
Every form returns
string
The field as text: numbers and true/false become text, and an object or array comes back as JSON. An empty string when the body is not JSON or the path leads nowhere.
Good to know
- Because objects come back as JSON, the result can be read again with a second, shorter path.
- Editor and HTML5 exports only: native (Bevy) builds stop with an unsupported-command error.
Example · generated
DO Print(ApiJson(1, "value")) Sync()LOOPApiJson 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.