Skip to content

Commit

Permalink
docs: backported API docs (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-cardenas-coding authored Oct 23, 2023
1 parent e00a551 commit 26bb933
Show file tree
Hide file tree
Showing 23 changed files with 939 additions and 133 deletions.
30 changes: 20 additions & 10 deletions docs/api-content/api-docs/1-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,29 @@ 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.

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"
```

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
Refer to the [API Key](/user-management/authentication/api-key) section to learn how to create and manage API keys.

## Requests

Expand Down
Loading

0 comments on commit 26bb933

Please sign in to comment.