|
2 | 2 | title: How to use the Admin API
|
3 | 3 | ---
|
4 | 4 |
|
5 |
| -This guide explains the steps required to getting access to and using the Admin API. |
| 5 | +This guide explains the steps required to using the Admin API. |
6 | 6 |
|
7 |
| -## Step 1: Create API token {#step-1-create-api-token} |
| 7 | +## Create API token |
8 | 8 |
|
9 |
| -You'll need either an [admin token](../reference/api-tokens-and-client-keys.mdx#admin-tokens) or a [personal access token](../reference/api-tokens-and-client-keys.mdx#personal-access-tokens) for this to work. To create one, follow the steps in the [_how to create API tokens_](../how-to/how-to-create-api-tokens.mdx) guide or the [_how to create personal access tokens_](./how-to-create-personal-access-tokens.mdx) guide, respectively. |
| 9 | +First, you'll need to create a [personal access token](/reference/api-tokens-and-client-keys.mdx#personal-access-tokens). |
10 | 10 |
|
11 | 11 | Please note that it may take up to 60 seconds for the new key to propagate to all Unleash instances due to eager caching.
|
12 | 12 |
|
13 | 13 | :::note
|
14 | 14 |
|
15 |
| -If you need an API token to use in a client SDK you should create a "client token" as these have fewer access rights. |
| 15 | +If you need an API token to use in a client SDK you should create a client token instead, as these have fewer access rights. |
16 | 16 |
|
17 | 17 | :::
|
18 | 18 |
|
19 |
| -## Step 2: Use Admin API {#step-2-use-admin-api} |
| 19 | +## Use Admin API |
20 | 20 |
|
21 |
| -Now that you have an access token with admin privileges we can use that to perform changes in our Unleash instance. |
| 21 | +Now that you have an access token with admin privileges, you can use it to make changes in your Unleash instance. |
22 | 22 |
|
23 |
| -In the example below we will use the [Unleash Admin API](/reference/api/legacy/unleash/admin/features.md) to enable the “Demo” feature flag using curl. |
| 23 | +In the example below we will use the [Unleash Admin API](/reference/api/legacy/unleash/admin/features.md) to enable the `checkout-flow` feature flag in `development` using curl. |
24 | 24 |
|
25 | 25 | ```sh
|
26 | 26 | curl -X POST -H "Content-Type: application/json" \
|
27 |
| - -H "Authorization: some-token" \ |
28 |
| - https://app.unleash-hosted.com/demo/api/admin/features/Demo/toggle/on |
| 27 | + -H "Authorization: <your-token>" \ |
| 28 | + https://app.unleash-hosted.com/docs-demo/api/admin/projects/docs-project/features/checkout-flow/environments/development/on |
29 | 29 | ```
|
30 | 30 |
|
31 |
| -**Great success!** We have now enabled the feature flag. We can also verify that it was actually changed by the API user by navigating to [Event Log](/reference/events#event-log) and filtering events for this feature flag. |
| 31 | +We have now enabled the feature flag. We can also verify that it was actually changed by the API user by navigating to [Event Log](/reference/events#event-log) and filtering events for this feature flag. |
32 | 32 |
|
33 | 33 | 
|
34 | 34 |
|
35 |
| -## API overview {#api-overview} |
36 |
| - |
37 | 35 | You can find the full documentation on everything the Unleash API supports in the [Unleash API documentation](/reference/api/legacy/unleash/admin/features.md).
|
0 commit comments