Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all curl documentation examples and references with new x-medusa-access-token header #6326

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* label: cURL
* source: |
* curl -X DELETE '{backend_url}/store/auth' \
* -H 'Authorization: Bearer {access_token}'
* -H 'x-medusa-access-token: {access_token}'
* security:
* - cookie_auth: []
* - jwt_token: []
Expand Down
2 changes: 1 addition & 1 deletion packages/medusa/src/api/routes/store/auth/get-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { defaultRelations } from "."
* label: cURL
* source: |
* curl '{backend_url}/store/auth' \
* -H 'Authorization: Bearer {access_token}'
* -H 'x-medusa-access-token: {access_token}'
* security:
* - cookie_auth: []
* - jwt_token: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { validator } from "../../../../utils/validator"
* label: cURL
* source: |
* curl -X POST '{backend_url}/store/customers/me/addresses' \
* -H 'Authorization: Bearer {access_token}' \
* -H 'x-medusa-access-token: {access_token}' \
* -H 'Content-Type: application/json' \
* --data-raw '{
* "address": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import CustomerService from "../../../../services/customer"
* label: cURL
* source: |
* curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
* -H 'Authorization: Bearer {access_token}'
* -H 'x-medusa-access-token: {access_token}'
* security:
* - cookie_auth: []
* - jwt_token: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import CustomerService from "../../../../services/customer"
* label: cURL
* source: |
* curl '{backend_url}/store/customers/me' \
* -H 'Authorization: Bearer {access_token}'
* -H 'x-medusa-access-token: {access_token}'
* security:
* - cookie_auth: []
* - jwt_token: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { promiseAll } from "@medusajs/utils"
* label: cURL
* source: |
* curl '{backend_url}/store/customers/me/payment-methods' \
* -H 'Authorization: Bearer {access_token}'
* -H 'x-medusa-access-token: {access_token}'
* security:
* - cookie_auth: []
* - jwt_token: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ import { DateComparisonOperator } from "../../../../types/common"
* label: cURL
* source: |
* curl '{backend_url}/store/customers/me/orders' \
* -H 'Authorization: Bearer {access_token}'
* -H 'x-medusa-access-token: {access_token}'
* security:
* - cookie_auth: []
* - jwt_token: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { validator } from "../../../../utils/validator"
* label: cURL
* source: |
* curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
* -H 'Authorization: Bearer {access_token}' \
* -H 'x-medusa-access-token: {access_token}' \
* -H 'Content-Type: application/json' \
* --data-raw '{
* "first_name": "Gina"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import { IsType } from "../../../../utils/validators/is-type"
* label: cURL
* source: |
* curl -X POST '{backend_url}/store/customers/me' \
* -H 'Authorization: Bearer {access_token}' \
* -H 'x-medusa-access-token: {access_token}' \
* -H 'Content-Type: application/json' \
* --data-raw '{
* "first_name": "Laury"
Expand Down
38 changes: 19 additions & 19 deletions www/apps/api-reference/app/_mdx/admin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ by passing to the `expand` query parameter the value `collection`:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?expand=collection" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -416,7 +416,7 @@ pass to the `expand` query parameter the value `variants,collection`:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?expand=variants,collection" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -478,7 +478,7 @@ For example:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?expand" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -572,7 +572,7 @@ parameter:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?fields=title" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -632,7 +632,7 @@ value to the `expand` query parameter. For example:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?fields=title&expand" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -696,7 +696,7 @@ For example, to select the `title` and `handle` of products:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?fields=title,handle" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -755,7 +755,7 @@ entity. For example:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?fields" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -811,7 +811,7 @@ relations aren't retrieved as well. For example:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?fields&expand" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -891,7 +891,7 @@ For example:

```bash
curl "http://localhost:9000/admin/products?title=Shirt" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```


Expand All @@ -905,7 +905,7 @@ For example, if the string has spaces, you can encode the space with `+` or

```bash
curl "http://localhost:9000/admin/products?title=Blue%20Shirt" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```


Expand All @@ -924,7 +924,7 @@ For example:

```bash
curl "http://localhost:9000/admin/products?offset=1" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```


Expand All @@ -939,7 +939,7 @@ For example:

```bash
curl "http://localhost:9000/admin/products?is_giftcard=true" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```


Expand All @@ -955,7 +955,7 @@ For example:

```bash
curl -g "http://localhost:9000/admin/products?created_at[lt]=2023-02-17" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```


Expand All @@ -968,7 +968,7 @@ For example:

```bash
curl -g "http://localhost:9000/admin/products?created_at[lt]=2023-02-17T07:22:30Z" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```


Expand All @@ -985,7 +985,7 @@ For example:

```bash
curl -g "http://localhost:9000/admin/products?sales_channel_id[]=sc_01GPGVB42PZ7N3YQEP2WDM7PC7&sales_channel_id[]=sc_234PGVB42PZ7N3YQEP2WDM7PC7" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```


Expand All @@ -1006,7 +1006,7 @@ For example:

```bash
curl -g "http://localhost:9000/admin/products?created_at[lt]=2023-02-17&created_at[gt]=2022-09-17" \
-H 'Authorization: Bearer {api_token}'
-H 'x-medusa-access-token: {api_token}'
```

<Feedback
Expand Down Expand Up @@ -1046,7 +1046,7 @@ For example, to limit the number of products returned in the List Products API R
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?limit=5" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -1123,7 +1123,7 @@ sort products by their `created_at` attribute by setting `order` to
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?order=created_at" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down Expand Up @@ -1179,7 +1179,7 @@ descending, pass a dash (`-`) before the attribute name. For example:
value: 'curl',
code: {
source: `curl "http://localhost:9000/admin/products?order=-created_at" \
-H 'Authorization: Bearer {api_token}'`,
-H 'x-medusa-access-token: {api_token}'`,
lang: `bash`,
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/store/auth' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
curl '{backend_url}/store/auth' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
curl '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
curl -X POST '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}' \
-H 'x-medusa-access-token: {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"first_name": "Laury"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
curl -X POST '{backend_url}/store/customers/me/addresses' \
-H 'Authorization: Bearer {access_token}' \
-H 'x-medusa-access-token: {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"address": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}' \
-H 'x-medusa-access-token: {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"first_name": "Gina"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
curl '{backend_url}/store/customers/me/orders' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
curl '{backend_url}/store/customers/me/payment-methods' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
18 changes: 9 additions & 9 deletions www/apps/api-reference/specs/store/openapi.full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ paths:
label: cURL
source: |
curl '{backend_url}/store/auth' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
security:
- cookie_auth: []
- jwt_token: []
Expand Down Expand Up @@ -235,7 +235,7 @@ paths:
label: cURL
source: |
curl -X DELETE '{backend_url}/store/auth' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
security:
- cookie_auth: []
- jwt_token: []
Expand Down Expand Up @@ -1897,7 +1897,7 @@ paths:
label: cURL
source: |
curl '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
security:
- cookie_auth: []
- jwt_token: []
Expand Down Expand Up @@ -1983,7 +1983,7 @@ paths:
label: cURL
source: |
curl -X POST '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}' \
-H 'x-medusa-access-token: {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"first_name": "Laury"
Expand Down Expand Up @@ -2052,7 +2052,7 @@ paths:
label: cURL
source: |
curl -X POST '{backend_url}/store/customers/me/addresses' \
-H 'Authorization: Bearer {access_token}' \
-H 'x-medusa-access-token: {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"address": {
Expand Down Expand Up @@ -2125,7 +2125,7 @@ paths:
label: cURL
source: |
curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}' \
-H 'x-medusa-access-token: {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"first_name": "Gina"
Expand Down Expand Up @@ -2183,7 +2183,7 @@ paths:
label: cURL
source: |
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
security:
- cookie_auth: []
- jwt_token: []
Expand Down Expand Up @@ -2443,7 +2443,7 @@ paths:
label: cURL
source: |
curl '{backend_url}/store/customers/me/orders' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
security:
- cookie_auth: []
- jwt_token: []
Expand Down Expand Up @@ -2492,7 +2492,7 @@ paths:
label: cURL
source: |
curl '{backend_url}/store/customers/me/payment-methods' \
-H 'Authorization: Bearer {access_token}'
-H 'x-medusa-access-token: {access_token}'
security:
- cookie_auth: []
- jwt_token: []
Expand Down
2 changes: 1 addition & 1 deletion www/apps/docs/content/contribution/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ import TabItem from '@theme/TabItem';

```bash
curl -L -X POST '<BACKEND_URL>/admin/uploads' \
-H 'Authorization: Bearer <API_TOKEN>' \
-H 'x-medusa-access-token: <API_TOKEN>' \
-H 'Content-Type: text/csv' \
-F 'files=@"<FILE_PATH_1>"'
```
Expand Down
Loading