opt-cc/server/apib/base/access.apib

55 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-03-20 10:48:00 +01:00
## Location
The API can only be accessed via HTTPS in the cloud instance.
You can reach the API for the cloud instance at
```
https://cc.noarch.de/api/
```
Local installations can access the API using the respective domain with the path `/api/` appended.
So if your server is reachable at `https://cc.myserver.lan` the API endpoint is located at
```
# Note: `/api/` is appended to the locale installation server url
https://cc.myserver.lan/api/
```
## Authentication
2018-03-20 13:15:23 +01:00
Requests to most of the API endpoints have to be authenticated using an API token which is received after successfully providing your application credentials to the API.
2018-03-20 10:48:00 +01:00
Once acquired the token has to be provided in the ``X-Access-Token`` header of every request that requires authentication.
The following example illustrates how to provide the token when using `curl`
```
# via Authorization header
> curl -H "X-Access-Token: $CC_API_TOKEN" <API_RESOURCE_PATH_GOES_HERE>
```
## Permission Levels
The permission level is resolved by the API token you send, which resolves the specific app user information.
Endpoints that require a certain permission level to be accessed, mention the **minimum** required permission level in the description.
2018-04-02 10:38:16 +02:00
::: note
Permission Levels:
2018-04-02 10:38:16 +02:00
0 - User
1 - Squadlead
2 - High Command
3 - Maintainer
4 - Administrator
:::