Newbie(?) help req. — Guild Wars 2 Forums

Newbie(?) help req.

Neural.1824Neural.1824 Member ✭✭✭✭
edited February 12, 2018 in API Development

I'm not exactly new to working with the API, but when it comes to using API Keys, I'm running into some basic issues.

To access the data on a given account, you need an API key, that I get. I use GW2Efficiency, etc., but the wiki has the following listed (using dyes as an example):

https://api.guildwars2.com/v2/account/dyes
Authorization: Bearer |API key|

Could someone please tell me the following, just to help me clarify:
1) is the line break just formatting? Or is the initial URL expecting a second input?
2) is the word "Bearer" part of the URL, or is it actually supposed to be |Bearer| where you enter something like the account name?

Or, if it's easier, just a sample un-broken URL (exact syntax) would work too. I just need a starting point. As mentioned, I understand the API key itself, so putting |API Key| at the end of the URL is fine.

Thanks.

(edit: had to use pipes instead of greater-than/less-than cause the forum tries to read it as an html tag)

Soul-binding needs to be allowed to die gracefully. It has expired. It is long past it's time to become a footnote in the history of gaming.

Comments

  • Archomeda.6472Archomeda.6472 Member ✭✭
    edited February 12, 2018

    Authorization is an HTTP header. It's part of the HTTP request and not of the URL.

    Or, alternatively, you can also append the key as a URL parameter, like https://api.guildwars2.com/v2/account/dyes?access_token=<key>

  • Neural.1824Neural.1824 Member ✭✭✭✭

    Thank you ! :)

    Soul-binding needs to be allowed to die gracefully. It has expired. It is long past it's time to become a footnote in the history of gaming.

  • Neural.1824Neural.1824 Member ✭✭✭✭

    Ok. one more question. How do I know which dye is associated with which dye name?
    I'm more used to an item having the ##### format (like 19702).
    I realize the numeric system is a way of saving data transfer etc., so it makes sense over using 5 digit ID's.

    I'll look on the wiki to see if there's a resource for it, but if there isn't, a link would be appreciated :)

    Soul-binding needs to be allowed to die gracefully. It has expired. It is long past it's time to become a footnote in the history of gaming.

  • https://api.guildwars2.com/v2/colors is the endpoint you're looking for. Wiki

  • Neural.1824Neural.1824 Member ✭✭✭✭
    edited February 13, 2018

    Ok, that makes sense. Account unlock vs. global info.

    Thanks again. :)

    Soul-binding needs to be allowed to die gracefully. It has expired. It is long past it's time to become a footnote in the history of gaming.

©2010–2018 ArenaNet, LLC. All rights reserved. Guild Wars, Guild Wars 2, Heart of Thorns, Guild Wars 2: Path of Fire, ArenaNet, NCSOFT, the Interlocking NC Logo, and all associated logos and designs are trademarks or registered trademarks of NCSOFT Corporation. All other trademarks are the property of their respective owners.