Getting "Not found" response after calling POST from VBA using MSXML2.ServerXMLHTTP60

Getting "Not found" response after calling POST from VBA using MSXML2.ServerXMLHTTP60

PetrCech
Visitor
2 0 1

Hi,

we're building up API connectivity from VBA to SHPY using Admin REST API.

Currently we use MSXML2.ServerXMLHTTP60 to send a requests. Many GET-type requests are processed successfully (so should not be authentication problem), but when sending POST one, we're still getting 

 

404 - {"errors":"Not Found"}.

 

e.g. endpoint as follows 

https://ndh-cz-development.myshopify.com/admin/api/2023-07/fulfillments.json

with body (faked package id..)

{"fulfillment":{"line_items_by_fulfillment_order":[{"fulfillment_order_id":6428019065139}],"tracking_info":{"number":"052009686333","url":"https://online.gls-czech.com/tt_page.php?lng=cz&tt_value=052009686333"}}}

 

When calling the same content in the Postman environment this works with no problems and request is processed.

 

PetrCech_0-1695714533927.png

 

We're also trying to use certain GraphQL calls having had the same issue - 404 "not found".

Anybody could provide any hint ?

Any special HTTP header parameter is missing in the call ? 

Thanks

 

 

 

Replies 2 (2)

SBD_
Shopify Staff
1829 271 415

Hey @PetrCech 

 

That endpoint will return a 404 if the fulfillment_order_id isn't found - can you confirm the fulfillment order ID exists?

Scott | Developer Advocate @ Shopify 

PetrCech
Visitor
2 0 1

Hello,

thanks for reply. Yes, fulfillment order does exist, so the call worked properly sent out from Postman, but failed in VBA app. 

Finally, based on several discussions on net, I found the problem and was able to resolve it.

I found the Postman provides in Curl-explain window output important sign '--required POST' parameter. Problem was caused by temporary redirection to a testing shop_id, made on Shopify side, which caused redirection request sent back after POST. Well, calling URL was different to a one returned in POST response.

Solution was to change called URL not to contain {{store_name}} but rather domain on which the stores (development and production) resides.

 

Thank you anyway.