REST API with C# WIndows Service

Solved
Highlighted
Shopify Partner
10 1 2

I'm trying to use a Windows Service I'm developing in C# to poll a storefront and pull data.  I've had a little success but can't get the full thing all glued together and wonder if I can get a nudge from someone.  Here's what I've done...

 

- created a Private App and therefore have my API key and password

- I used Postman to test various calls and the only one I see working is the call to admin/api/2020-01/storefront_access_tokens.json - I used the format https://user:pass@domain/admin/api/2020-01/storefront_access_tokens.json in Postman and this returned the access token i created for this private app

- I have tried numerous attempts at formatting the call to retrieve an individual order with no luck.  i keep getting a response that looks like it wants me to login.  

 

So as I read the documentation I'm looking for my implementation to be using the unauthenticated APIs by which I supply the token or secret key from my windows service to the API with each request I make.  Again, have tried this with the url passing the api user and password in the correct format, and have also tried using just the store domain as the url (with the full path to the json call of course) and from the Shopify documentation, I've also tried this:

Shopify access token

Private apps can authenticate with Shopify by including the request header X-Shopify-Access-Token: {access_token}, where {access_token} is replaced by your private app's Admin API password.

 

Do I still need to use a full OAuth workflow to generate a new token or authenticate my windows service running on my PC one time or something like that???

 

Please help, greatly appreciated.

 

0 Likes

Success.

Shopify Partner
10 1 2

UPDATE: Sorry folks ;)  Turns out my issue is ONLY with the retrieval of a specific order number so it's the pound sign syntax I must have malformed in the request.  I just successfully authenticated and retrieved all orders using the orders.json call and so all of the setup and my base knowledge was fine, and the shopify docs got me there just fine, FYI.  I will now debug my pound sign in the request!

0 Likes
Highlighted
New Member
1 0 0

Hey,

Can you please send me a sample of what you did. 

 

0 Likes