Showing Posts For AlterForm.7045:

Launching /v2/account (w/ Authentication)

in API Development

Posted by: AlterForm.7045

AlterForm.7045

Getting the same unhelpful “internal error” response, which is doubly unhelpful in that the response code is actually 400 so I’m not sure if it’s an actual internal error or some problem on my side.

As a guess, are you sending cookies to /oauth2/token? That might cause some confusion on our end. I’ll have to look up the error code on Monday and see what it turns up.

I don’t believe I am. I’ve sent requests via Postman and via a new incognito Chrome session. Thanks in advance for looking into what that code means.

Messing with the request parameters some more I can produce


{
    "error": "internal_error",
    "error_description": "10:1014:8039:171 - NetAdjOAuth: missing or invalid user id"
}
.
when I send a “code” parameter of “a”. Munging any of the other parameters results in the same unhelpful error_description as above.

This is expected — the code we send is an OAuth2 grant identifier — which is basically the account GUID concatenated with a randomly-generated unique ID. You’re sending something that doesn’t match the format, so it aborts before even looking up to see whether or not the request is valid. The error_description there could probably be made a bit more clear though.

Oh, sure, I didn’t mean to imply it wasn’t unexpected. My point with that error was that there does appear to be code paths for handling malformed parameters in the request and informing the caller with an actual error description to suggest what might have been wrong with the request. I’d love to see a similar one for our friend “49:1014:8008:353” if possible.

Launching /v2/account (w/ Authentication)

in API Development

Posted by: AlterForm.7045

AlterForm.7045

Need some help for this error. Is there anything I am missing?

https://account.guildwars2.com/oauth2/token?grant_type=authorization_code&redirect_uri=http://localhost:8080/oauth2/callback&client_id=gw2_api_demo&client_secret=0357A930-2126-4C87-A006-5AB470298ADA&code=[INSERT-CODE-HERE]


{
error: "internal_error",
error_description: "49:1014:8008:353"
}

I’m getting this same error.

After authorizing my application for my account through /oauth2/application, I’m making the request


https://account.guildwars2.com/oauth2/token?
    grant_type=authorization_code&
    code=CODE_FROM_OUATH2_AUTHORIZATION&
    redirect_uri=http://localhost:8080/oauth2/callback&
    client_id=MY_CLIENT_ID&
    client_secret=MY_CLIENT_SECRET

.

and getting the same unhelpful “internal error” response, which is doubly unhelpful in that the response code is actually 400 so I’m not sure if it’s an actual internal error or some problem on my side. I’ve tried it with both GET and POST requests, same result.

Messing with the request parameters some more I can produce


{
    "error": "internal_error",
    "error_description": "10:1014:8039:171 - NetAdjOAuth: missing or invalid user id"
}
.
when I send a “code” parameter of “a”. Munging any of the other parameters results in the same unhelpful error_description as above.