Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

406 Not Acceptable Header when using gift card api

Solved

406 Not Acceptable Header when using gift card api

CRStatement
Shopify Partner
4 1 1

Working until yesterday afternoon, I now get (from my app) a "406 Not acceptable" header when attempting to create a gift card on a plus store I have collaborator and development access to.

 

I am using the admin rest api and can use "GET" to get a list of gift cards, but using "POST" has suddenly stopped creating cards.

 

My app receives no response body, yet replicating the request in postman receives an html-based error attempting to redirect to an oauth URL.

 

Support / live chat suggested lokking/posting in the forums

Accepted Solution (1)

CRStatement
Shopify Partner
4 1 1

This is an accepted solution.

As many other 406 issues have identified a typo in the request, I have identified something similar in my requests.

The curl handle I was using in my PHP script was being over used and recycled. As such, additional headers were present and these were not understood or accepted by Shopify.

Using a new curl handle solved the issue

View solution in original post

Replies 3 (3)

jazz-jay
Shopify Partner
96 14 17

Hi,

 

As mentioned here.

Is your app a custom/private app and does it have the write_gift_cards access scope

banned
CRStatement
Shopify Partner
4 1 1

Hi,

 

Thanks for the response.. it is a private app and does have the correct access scope

CRStatement
Shopify Partner
4 1 1

This is an accepted solution.

As many other 406 issues have identified a typo in the request, I have identified something similar in my requests.

The curl handle I was using in my PHP script was being over used and recycled. As such, additional headers were present and these were not understood or accepted by Shopify.

Using a new curl handle solved the issue