User:Blackice/templates/api link
From Guild Wars 2 Wiki
< User:Blackice | templates
Jump to navigationJump to search
Usage[edit]
This template creates a link to the Guild Wars 2 API. The link gets wrapped in a div
with the class plainlinks
, which suppresses the external link icon.
{{api link|<API Endpoint>|<API Param>=<value>}} {{api link|...|link title=API Link}}
Parameters[edit]
- 1 (unnamed parameter)
- Required. The API endpoint. For a complete list of available endpoints, see: API:Main.
- The API version can be omitted unless there's ambiguity, e.g.
{{api link|items}}
links to /v2/items, whereas /v1/items has to be accessed with{{api link|v1/items}}
- link title
- Optional.
- id, ids, lang, access_token, etc. (various API parameters)
- Optional.
Examples[edit]
Code | Result |
---|---|
{{api link}} |
https://api.guildwars2.com/ |
{{api link|link title=API}} |
API |
{{api link|achievements|ids=910|lang=en}} |
https://api.guildwars2.com/v2/achievements?ids=910&lang=en |
{{api link|achievements|910|lang=de}} |
https://api.guildwars2.com/v2/achievements/910?lang=de |
{{api link|events}} |
https://api.guildwars2.com/v1/events.json |
{{api link|items}} |
https://api.guildwars2.com/v2/items |
{{api link|v1/items}} |
https://api.guildwars2.com/v1/items |
{{api link|v1|items}} |
https://api.guildwars2.com/v1/items |