Update all curl documentation examples and references with new x-medusa-access-token header (#6326)
## What This is to update incorrect documentation in regards to authentication to the Admin API - raised in https://github.com/medusajs/medusa/issues/6264. ## Why Because the current documentation has been incorrect since the September 2023 release of [v1.17.0](https://github.com/medusajs/medusa/releases/tag/v1.17.0), which had breaking changes to API token usage. ## How Simple search and replace. I was asked to replace occurrences under `www/apps/docs/content/` but there were also additional places where I thought references should also be updated: - `packages/medusa/src/api/` - `www/apps/api-reference/` Feel free to revert them as needed. There is also some inconsistency between the format shown in examples e.g. `<API_TOKEN>` vs `{api_token}` vs `{access_token}`. I have kept the format the same in all cases as the original, as surrounding documentation text would not have format updated as well. I suggest maybe reviewing the documentation and keeping to a consistent format e.g. `<API_TOKEN>`. ## Testing I have not tested these changes. I would assume the `packages/medusa/src/api/` changes may need more thorough testing?
This commit is contained in:
@@ -113,7 +113,7 @@ You can list invites by sending a request to the [List Invite API Route](https:/
|
||||
|
||||
```bash
|
||||
curl -L -X GET '<BACKEND_URL>/admin/invites' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>'
|
||||
-H 'x-medusa-access-token: <API_TOKEN>'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
@@ -191,7 +191,7 @@ You can create an invite by sending a request to the [Create Invite API Route](h
|
||||
|
||||
```bash
|
||||
curl -L -X POST '<BACKEND_URL>/admin/invites' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>' \
|
||||
-H 'x-medusa-access-token: <API_TOKEN>' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"user": "user@example.com",
|
||||
@@ -379,7 +379,7 @@ You can resend an invite if it’s not accepted yet. To resend an invite, send a
|
||||
|
||||
```bash
|
||||
curl -L -X POST '<BACKEND_URL>/admin/invites/<INVITE_ID>/resend' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>'
|
||||
-H 'x-medusa-access-token: <API_TOKEN>'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
@@ -452,7 +452,7 @@ You can delete an invite by sending a request to the [Delete Invite API Route](h
|
||||
|
||||
```bash
|
||||
curl -L -X DELETE '<BACKEND_URL>/admin/invites/<INVITE_ID>' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>'
|
||||
-H 'x-medusa-access-token: <API_TOKEN>'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
@@ -186,7 +186,7 @@ You can log out a user by sending a request to the [User Logout API Route](https
|
||||
|
||||
```bash
|
||||
curl -L -X DELETE '<BACKEND_URL>/admin/auth' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>'
|
||||
-H 'x-medusa-access-token: <API_TOKEN>'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
@@ -250,7 +250,7 @@ You can retrieve the current user’s details for their profile by sending a req
|
||||
|
||||
```bash
|
||||
curl -L -X GET '<BACKEND_URL>/admin/auth' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>'
|
||||
-H 'x-medusa-access-token: <API_TOKEN>'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
@@ -335,7 +335,7 @@ You can update a user’s details in their profile by sending a request to the [
|
||||
|
||||
```bash
|
||||
curl -L -X POST '<BACKEND_URL>/admin/users/<USER_ID>' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>' \
|
||||
-H 'x-medusa-access-token: <API_TOKEN>' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"first_name": "Marcellus"
|
||||
|
||||
@@ -110,7 +110,7 @@ You can retrieve users in a store by sending a request to the [List Users API Ro
|
||||
|
||||
```bash
|
||||
curl -L -X GET '<BACKEND_URL>/admin/users' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>'
|
||||
-H 'x-medusa-access-token: <API_TOKEN>'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
@@ -192,7 +192,7 @@ You can create a user by sending a request to the [Create User API Route](https:
|
||||
|
||||
```bash
|
||||
curl -L -X POST '<BACKEND_URL>/admin/users' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>' \
|
||||
-H 'x-medusa-access-token: <API_TOKEN>' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"email": "user@example.com",
|
||||
@@ -287,7 +287,7 @@ You can update a user’s details by sending a request to the [Update User API R
|
||||
|
||||
```bash
|
||||
curl -L -X POST '<BACKEND_URL>/admin/users/<USER_ID>' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>' \
|
||||
-H 'x-medusa-access-token: <API_TOKEN>' \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"first_name": "Marcellus"
|
||||
@@ -366,7 +366,7 @@ You can delete a user by sending a request to the [Delete User API Route](https:
|
||||
|
||||
```bash
|
||||
curl -L -X DELETE '<BACKEND_URL>/admin/users/<USER_ID>' \
|
||||
-H 'Authorization: Bearer <API_TOKEN>'
|
||||
-H 'x-medusa-access-token: <API_TOKEN>'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
Reference in New Issue
Block a user