arenanet / api-cdi

Collaborative Development Initiative for Public APIs
253 stars 41 forks source link

Getting HTTP 400 for /v2/account request with valid bearer authentication code #19

Closed kjintar closed 9 years ago

kjintar commented 9 years ago

Hey there,

I'm getting HTTP 400 status code when pulling data from /v2/account. Returning json says:

{"text":"ErrBadData"}

Tested with own application and the example node application.

Greetings, Teranas

kjintar commented 9 years ago

Interesting. Seems to be a bug related to my main account (Teranas.6150) ... Testing with World vs. World account (Amar.4162) works well.

lye commented 9 years ago

Blergh, that's probably a bug in the parsing code for account/character blobs. Thanks for the heads up; will try to fix it next week.

vennekilde commented 9 years ago

Same issue here, my account name is (I Am Dansker.7105) in case it helps locate the issue

Eastborn commented 9 years ago

I also Encountered something similar.

My account is Eastborn.6089. The headers are:

Request URL
https://api.guildwars2.com/v2/account?access_token=5EC19845-F2B0-4CE3-BBC6-CEEB45D36471&callback=_hellojs_5e9umrjo

General
Remote Address:64.25.47.16:443
Request URL:https://api.guildwars2.com/v2/account?access_token=AD0C7E66-5544-4756-B6DF-9A8E05C7C11B&callback=_hellojs_bcrvai9
Request Method:GET
Status Code:400 Bad Request

Response Headers
view source
Access-Control-Allow-Origin:*
Content-Length:21
Content-Type:application/json; charset=utf-8
Date:Mon, 23 Mar 2015 13:06:11 GMT
Server:Microsoft-IIS/7.5
X-Content-Type-Options:nosniff

Request Headers
view source
Accept:/
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,nl;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Cookie:ga=GA1.2.15426245.1425416427; s=7F2F3BB0-27F2-407E-8644-6219444E1E42; _utmt_UA-18978290-1=1; utma=159804514.15426245.1425416427.1427113213.1427115017.7; _utmb=159804514.16.10.1427115017; utmc=159804514; _utmz=159804514.1427115017.7.6.utmcsr=159.253.7.156|utmccn=(referral)|utmcmd=referral|utmcct=/GW2/
DNT:1
Host:api.guildwars2.com
Pragma:no-cache
Referer:http://159.253.7.156/GW2/
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36

Query String Parameters
view source
view URL encoded
access_token:AD0C7E66-5544-4756-B6DF-9A8E05C7C11B
callback:_hellojs_bcrvai9
darthmaim commented 9 years ago

@Eastborn You have to send the access_token as Bearer Token in the Authorization header (Authorization: Bearer AD0C7E66-5544-4756-B6DF-9A8E05C7C11B) and not as query string parameter.

vennekilde commented 9 years ago

Did you by any chance just fix this? as it seems to work on my end now :P

lye commented 9 years ago

Yeah, sorry for not updating, wasn't sure when the fix was gonna land.

Should be working now!