addonscript-spec/docs/api/features/addons.md

51 lines
1.7 KiB
Markdown
Raw Normal View History

2022-08-31 14:40:32 +02:00
# Addon repository
## Endpoints
### Get addon
`GET {base URL}/v2/addons/:namespace/:addon`
This endpoint can be used to retrieve information about a specific addon,
including metadata, all available versions and the [canonical namespace](../../concepts/namespaces.md#canonical-namespaces)
of the addon.
#### Path variales:
2022-09-23 18:33:14 +02:00
- `namespace`: The [namespace](../../concepts/namespaces.md#repository-namespaces) of a repository which contains the addon
2022-08-31 14:40:32 +02:00
- `addon`: The ID of the addon
#### Responses:
- `200 OK`: The addon is available in this addon repository.
The response body MUST be an [API Addon Object](../../schema/api_addon.md).
2022-08-31 14:40:32 +02:00
- `404 Not Found`: The addon is not available in this addon repository.
### Get addon manifest
`GET {base URL}/v2/addons/:namespace/:addon/:version`
This endpoint can be used to retrieve the manifest of a specific version of an addon.
#### Path variables:
2022-09-23 18:33:14 +02:00
- `namespace`: The [namespace](../../concepts/namespaces.md#repository-namespaces) of a repository which contains the addon
2022-08-31 14:40:32 +02:00
- `addon`: The ID of the addon
- `version`: The [version number](../../concepts/versioning.md) of the requested version
#### Responses:
- `200 OK`: This version of the addon is available in this addon repository.
The response body MUST be an [Addon Manifest](../../schema/manifest.md).
2022-09-23 18:33:14 +02:00
- `404 Not Found`: This version of the addon is not available in this addon repository.
### Get namespaces
`GET {base URL}/v2/namespaces`
This endpoint can be used to get a list of [repository namespaces](../../concepts/namespaces.md#repository-namespaces),
which can be found on this API instance. It MAY be incomplete or empty at all.
#### Responses:
- `200 OK`: The response body MUST be a JSON array of namespace strings.