-
Notifications
You must be signed in to change notification settings - Fork 9
JSON REST API
The JSON REST API has a single endpoint: http://jasx.org/lsl/got/app/mod_api/
To authorize a request, you must send a Got-Mod-Token header containing your mod JSON KEY from the mod editor.
Input is a POST request with a single parameter tasks containing a JSON array of task objects.
| name | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Endpoint identifier of the call |
| target | string/array | Yes | A single or multiple targets of your call, such as an array of UUIDs |
| data | object | Yes | An object of properties for your call |
| callback | string | No | Any callback data you want back |
The output is based on jsonapi http://jsonapi.org/ With a few key differences The document contains multiple jsonapi documents. The response is in the following form:
{
"jsonapi" : (array)jsonapi_documents,
"errors" : (array)fatal_errors
}
Only one of jsonapi or errors key will be present. Errors contains a list of fatal errors. Once you fetch a jsonapi object, it will be mostly compliant with the specification, meaning you should be able to use any sensible library to use it.
If you don't want to use an existing library, here is a list of libraries to use.
| name | language | url |
|---|---|---|
| GoThongs API LSL | lsl | Official XOBJ-based library allowing you to use the API through Second Life scripts |
| GoThongs API PHP | php | Official PHP library. Can be installed via composer. |
| todo | node.js | ??? |
| todo | python | Maybe chaser wants to do this? |
All targets are restricted to either a user that has enabled your mod, or an asset that was official or added by your mod.