API Key example [request]

API Key example [request]

in API Development

Posted by: Neural.1824

Neural.1824

I’m still as new as it gets when it comes to using the API, so what the pros don’t even think about may be stumbling blocks for me.

On the following page: Guild Wars Wiki API page it shows the following example:
https://api.guildwars2.com/v2/commerce/transactions/history/sells Authorization: Bearer api-key-here

When pulling examples from other parts of the API info, the examples they gave could be plugged into the web-browser and the returned info would just be dumped onto the page as text. Not so with the above example.

Yes, I did replace “api-key-here” with an appropriate API key

When I did put it in the browser, it spat back: {"error":“not found”}

It’s pretty obvious what goes in the api-goes-here section, but.. does it need quotes?
Is there some other syntax that is not correct?

I’d love to see a plain text example of a valid API call that includes a user key. So I can see how it works.

I know I go about everything backwards, but coming from a non-programming background, taking an example and deconstructing it works pretty well.

Thanks!

Where are my gem sales? I want gem sales! Nerf EVERYTHING!

API Key example [request]

in API Development

Posted by: darthmaim.6017

darthmaim.6017

The “Authorization: Bearer api-key-here” is a so called http header, nothing that goes directly in the URL, but something you can set when making the api request programmatically.
If you want to test this in your browser, you can instead append “?access_token=api-key-here” to your url, for example: https://api.guildwars2.com/v2/account?access_token=51969C37-FA95-744C-BB29-075C684EBD33C086D050-124E-4575-994B-304F23DA6F70

This is also mentioned on the api wiki page: https://wiki.guildwars2.com/wiki/API:2#Authentication

API Key example [request]

in API Development

Posted by: Neural.1824

Neural.1824

Thank you, darthmaim for that info!

There are quite a few pages on the wiki about the API that I’ve looked at, yet I haven’t seen that one before. Part of it may go back to not knowing the terminology for what I am trying to do.

Thanks again

Where are my gem sales? I want gem sales! Nerf EVERYTHING!