addonscript-spec/docs/api/README.md

37 lines
1.2 KiB
Markdown
Raw Normal View History

2022-02-25 22:54:10 +01:00
# The AddonScript API
## The Index Endpoint
2022-08-31 21:11:12 +02:00
`GET {base URL}`
2022-02-25 22:54:10 +01:00
The index endpoint can be used to get basic information about an API
instance, including the API versions and features supported by that
2022-08-31 14:40:32 +02:00
instance and the [default namespace](../concepts/namespaces.md#default-namespaces) of the instance.
The response object of this endpoint contains a `versions` property, which is an object with API
version numbers as keys and the configuration objects for the specific API version as values.
2022-09-23 18:33:14 +02:00
For API version `v2` (AddonScript major release 2) the configuration object contains a `features`
property, which is an array containing all [API features](#features) available on this API instance.
2022-02-25 22:54:10 +01:00
2022-08-31 21:11:12 +02:00
### Example response body:
2022-02-25 22:54:10 +01:00
``` json
{
2022-08-31 14:40:32 +02:00
"versions": {
"v2": {
2022-09-23 18:33:14 +02:00
"features": ["addons", "env", "com.example.customfeature"]
2022-08-31 14:40:32 +02:00
}
}
2022-02-25 22:54:10 +01:00
}
```
## Features
API features can be either part of the specification itself or
are specified by third parties. Third-party API features SHOULD
2022-02-25 22:54:10 +01:00
be in a namespace-like format (reversed domain name).
These API features are part of the AddonScript specification itself:
2022-08-31 14:40:32 +02:00
- `addons`: [Addon repository](./features/addons.md)
2022-09-10 16:56:51 +02:00
- `files`: [File repository](./features/files.md)
- `env`: [Environment builder](./features/env.md)