Casing of header values from API has changed - now in lowercase

Highlighted
Shopify Partner
4 0 0

Hi.

I am using the Product Admin API (2020-04) and utilizing the Link header to get the next page of results (https://xxx.myshopify.com/admin/api/2020-04/products.json?limit=250 )

I had a customer ask why their products stock wasn't updating and after looking into it, I found that the header returned from my GET call to the products endpoint was returning a header with the value "link" instead of the documented (and previously working) "Link". It appears the header is now in lowercase. I am using PHP which is a case sensitive language so my process didn't realize there were more pages. I've updated it and added support for both cases.

Has something changed that I wasn't aware of in terms of the casing of the header names? I have used Postman/Insomnia and also getting the same value, so I don't think it's something on my end that is returning it in lowercase. I haven't changed the version for quite some time.

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
181 22 29

Hey @Lachlan2 

I have a 'Link' attribute when I test the same API call as you mentioned below. Can you confirm you are still seeing this happen?

Kevin_A | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
4 0 0

Hi Kevin.

 

I'm not sure if you've read or understood my question completely.

 

The attribute does appear, but the header name is now "link" instead of "Link" - the case of it has changed.

The documentation shows it with a capital L but I am now receiving the header name with a lowercase l, which caused my process to break.

Has this changed? I can't see anything in the documentation about this and I am using the same API version as I always have.

See below the headers I am getting back showing they are now in lowercase:

header link.png

0 Likes
Highlighted
Shopify Staff
Shopify Staff
181 22 29

Hey @Lachlan2 

I asked my question because I tried to run some requests using 2020-04 my API responses all included a Link param with a capital "L" which is why I wanted to ensure you are still seeing the issue. Would you be able to provide a request ID for one of the calls where you see this? 

Kevin_A | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
4 0 0

That's weird.

See here: baa4a693-28a7-4d1f-8991-31bfb90727f1

0 Likes
Highlighted
Shopify Staff
Shopify Staff
181 22 29

Hey @Lachlan2 

Thanks for the request ID. I took a look at our logs, and then reproduced the exact same call and can confirm I am seeing a "Link" header being passed. Can you try making the call from your end using a different client? 

Kevin_A | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
667 47 134

Suspecting it must be a client-side issue. When I just performed the same test against on our Shopify shop, all header values are capital case as expected...

 

HTTP/1.1 200 OK
Date: Mon, 02 Nov 2020 15:37:26 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
X-Sorting-Hat-PodId: {pod_id}
X-Sorting-Hat-ShopId: {shop_id}
Vary: Accept-Encoding
Referrer-Policy: origin-when-cross-origin
X-Frame-Options: DENY
X-ShopId: {shop_id}
X-ShardId: 161
X-Stats-UserId: 
X-Stats-ApiClientId: {client_id}
X-Stats-ApiPermissionId: {permission_id}
X-Shopify-API-Terms: By accessing or using the Shopify API you agree to the Shopify API License and Terms of Use at https://www.shopify.com/legal/api-terms
HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40
X-Shopify-Shop-Api-Call-Limit: 1/40
X-Shopify-API-Version: 2020-04
Link: <https://{my_shop}.myshopify.com/admin/api/2020-04/products.json?limit=250&page_info=eyJsYXN0X2lkIjo0NDUyMDA4MTk4MTk2LCJsYXN0X3ZhbHVlIjoiMTRLUkcgRElBTU9ORCBCQU5EIiwiZGlyZWN0aW9uIjoibmV4dCJ9>; rel="next"

 

0 Likes