awlhy
awlhy

Reputation: 23

Bigcommerce api no response

I have some trouble getting a response from the new Bigcommerce api, not sure what I'm doing wrong.

Followed the instructions to get an Oauth token upon app install here:

developer.bigcommerce.com/apps/callback

The token is stored and used to make this request:

https://api.bigcommerce.com/stores/{store hash}/v2/time

According to developer.bigcommerce.com/api/authentication:

I've added X-Auth-Client and X-Auth-Token respectively as the app client ID and Oauth token.

The server is just returning "0 NO RESPONSE" and I'm not sure what's wrong. It does return unauthorized if I remove one of the headers though.

Does anyone have an idea on this? Thank you.

-- I'm using the Advanced Rest Client app from chrome to test for responses. Basically calling my store's URL api.bigcommerce.com/stores/3t984h/v2/time as a GET request and passing X-Auth-Client and X-Auth-Token headers.

Request headers 
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)   Chrome/35.0.1916.153 Safari/537.36
X-Auth-Client: p1r37bt131z86675nofv9xmhietoe4t
X-Auth-Token: kzm1q2w8h11dfkgbxhg3j0i8amac86g
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en,zh;q=0.8,zh-TW;q=0.6,ko;q=0.4,en-GB;q=0.2,en-US;q=0.2

Upvotes: 1

Views: 954

Answers (1)

awlhy
awlhy

Reputation: 23

Finally got it. It was a spec issue which wasn't that obvious (to me at least). According to this (https://developer.bigcommerce.com/api/headers)

I needed to add

Content-Type: application/json
Accept: application/json

to the request header for it go thru.

Upvotes: 1

Related Questions