You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using latest Admin package release version: "@medusajs/admin": "7.1.10"
The current cURL doco for importing products specifies the API Token is provided with -H 'Authorization: Bearer <API_TOKEN>' but calls made with this header fail with an Unauthorized response.
Calling the API with the following cURL header option works: -H 'x-medusa-access-token: <API_TOKEN>'
I can possibly raise a PR to fix the documentation if I get confirmation that this is the correct approach?
How can this issue be resolved?
The API doco for cURL commands are updated to -H 'x-medusa-access-token: <API_TOKEN>' wherever -H 'Authorization: Bearer <API_TOKEN>' occurs.
Are you interested in working on this issue?
I would like to fix this issue
The text was updated successfully, but these errors were encountered:
Thank you for opening this issue! That's true, it should be -H 'x-medusa-access-token: <API_TOKEN>'. I think this is a change we missed to make in the main docs but have made in the API reference.
Would you be up to make the change in all files under www/apps/docs/content as this is probably used in different places? It should be a quick find-and-replace
…sa-access-token header (#6326)
## What
This is to update incorrect documentation in regards to authentication to the Admin API - raised in #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?
Preliminary Checks
Issue Summary
Using latest Admin package release version:
"@medusajs/admin": "7.1.10"
The current cURL doco for importing products specifies the API Token is provided with
-H 'Authorization: Bearer <API_TOKEN>'
but calls made with this header fail with anUnauthorized
response.Calling the API with the following cURL header option works:
-H 'x-medusa-access-token: <API_TOKEN>'
I can possibly raise a PR to fix the documentation if I get confirmation that this is the correct approach?
How can this issue be resolved?
The API doco for cURL commands are updated to
-H 'x-medusa-access-token: <API_TOKEN>'
wherever-H 'Authorization: Bearer <API_TOKEN>'
occurs.Are you interested in working on this issue?
The text was updated successfully, but these errors were encountered: