Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API key update #1666

Merged
merged 9 commits into from
Oct 17, 2023
31 changes: 20 additions & 11 deletions docs/api-content/api-docs/1-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,30 @@ Palette offers a range of capabilities you can access through the REST APIs. The
Every API's URI has the prefix of the version and the Palette resource, such as: `v1/spectroclusters/...`

## Authentication
Palette supports two types of user authentication methods:
Palette supports two types of API authentication methods that can be used to authenticate API requests:

### Using Authorization Token
* All requests must be authenticated with an API token that is passed using the HTTP request header `Authorization`.
* Activated users can use the `/auth/authenticate` API to authenticate and obtain the Authorization token.
* Every authorization token is valid for 15 min.
* To refresh the token use [this GET call](https://docs.spectrocloud.com/api/v1/auth/): `GET /v1/auth/refresh/{token}`
- [Authorization Token](#using-authorization-token)

- [API Key](#using-the-api-key)

### Authorization Token

You can acquire authorization tokens from Palette that have a 15-minute lifetime. The authorization token is passed as part of the HTTP request header. You can use the authorization token to authenticate and authorize the request. The header name is `Authorization`, and the token is the header value. Refer to the [Authorization Token](/user-management/authentication/authorization-token) section to learn more about the authorization token.

### Using the API Key
### API Key

You can use API keys to authenticate with the Palette API. API keys allow you to interact with Palette APIs without requiring user credentials such as username and password. The API key must be present in each API request to authenticate and authorize the request. The API Key is passed as part of the HTTP request header. The header name is `apiKey`, and the API key is the header value.

Palette uses API keys to provide secure API authentication and authorization. This enables the usage of Palette APIs without requiring user credentials such as username and password. The API key must be present in individual API requests in order to authenticate and authorize the request. The API Key is passed as part of the HTTP request header and in the following format:
* Key: ApiKey
* Value: API key copied from the Palette Console. E.g. QMOI1ZVKVIoW6LM6uXqSWFPsjmt0juvl
The following example shows how to pass the API key in the HTTP request header:

```shell hideClipboard
curl --location "https://api.spectrocloud.com/v1/spectroclusters/123456789?ProjectUid=12345678" \
--header 'Accept: application/json' \
--header "apiKey: 123456789"
```

[Read More...](/user-management/user-authentication/#usingapikey)
Refer to the [API Key](/user-management/authentication/api-key/) section to learn how to create and manage API keys.

## Requests

All requests are in the `JSON` format. In general, the request payload has three sections: *metadata, spec and status*.
Expand Down
Loading