0
votes

I have a problem with httpClient get method for my private shopify API. The problem is that my API has Authentication keys and I need help consuming it on my Angular app. I am sharing the api link, I have tested it in postman and it's working well, but when I want to consume this API with my Angular App, I get a problem with the authorization COR. I have all the secret code, but I don't know how to use them in my Angular app. Here is the link of the API that has all the orders: https://24b31e2389f78e7aab8830c7f18b031e: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@rachid-store11.myshopify.com/admin/api/2021-07/orders.json

API KEY: 24b31e2389f78e7aab8830c7f18b031e - password: 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 - shared secret: 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

1
you need to enable CORS on server to accept request from you client browser. you can check related issue here. community.shopify.com/c/Shopify-APIs-SDKs/…Shabbir Dhangot

1 Answers

0
votes

Hy, call api from code like this

using axios

axios.get('https://<shop-name>.myshopify.com/admin/api/2021-07/orders.json?status=any', {headers: {'Content-Type': 'application/Json', 'X-Shopify-Access-Token': <app-token>}})

must include app token by same header name like X-Shopify-Access-Token and your token string start from Sh.........