nocobase/packages/plugins/api-keys/docs/en-US/usage.md
Dunqing 817646d68d
feat(api-keys): the expiration field support custom option (#2186)
* feat(api-keys): the expiration field support custom option

* feat: support never option

* feat: support if expiresIn = never the expiresIn will replace to 1000y

* fix: toggle datepicker

* feat: update syntax

* fix: option order

* docs: update

* fix: maskCloseable should be false

* refactor: performance and remove unused code

* feat: should not allow clear

* fix: decode maybe fail

* fix: i18n
2023-07-06 16:33:28 +08:00

20 lines
562 B
Markdown

# API keys Usage
## Creating an API key
After enabling the plugin, go to the API keys plugin management page, click `Add API key`, fill in the relevant information, and click Save to create an API key.
## Using an API key
Add the `Authorization` field to the request header, with the value of `Bearer ${API_KEY}`, to access all `NocoBase` APIs using the API key.
Here's an example using cURL:
```bash
curl '{domain}/api/roles:check' -H 'Authorization: Bearer {API key}'
```
## Deleting an API key
After deleting the API key, it will no longer be usable.