Just turned on the first half of another authenticated endpoint — /v2/characters. This endpoint provides the non-inventory-related bits detailed in this pull request, and requires an API key with “characters” permission from the person whose data you want to access.
Some examples — it basically works in the same manner as most of the other endpoints. The base URL returns a list of all the account’s character names:
GET /v2/characters HTTP/1.1
Authorization: Bearer <api-key>
HTTP/1.1 200 OK
Content-Type: application/json
[ "Logan Thackeray", "Eir Stegalkin"]
You can retrieve individual character blobs by putting them in the next URL component (or in a comma-delimited ids
query parameter). Also note that you can pass the API key via the access_token
query parameter if you’re making CORS requests (rather than setting the Authorization
header):
GET /v2/characters/Logan%20Thackeray?access_token=<api-key>
HTTP/1.1 200 OK
Content-Type: application/json
{
"name": "Logan Thackeray",
"race": "Charr",
"gender": "Male",
"profession": "Guardian",
"level": 80,
"guild": "4BBB52AA-D768-4FC6-8EDE-C299F2822F0F"
}
Alternatively, you can make paginated requests. Metadata about the pagination details (e.g., the number of pages/results that can be requested) is returned in the response headers for ease-of-use.
GET /v2/characters?page=0&page_size=50 HTTP/1.1
Authorization: Bearer <api-key>
HTTP/1.1 200 OK
Content-Type: application/json
Link: </v2/characters?page=0&page_size=50>; rel=self, </v2/characters?page=0&page_size=50>; rel=first, </v2/characters?page=0&page_size=50>; rel=last
X-Page-Size: 50
X-Page-Total: 1
X-Result-Count: 2
X-Result-Total: 2
[
{
"name": "Logan Thackeray",
"race": "Charr",
"gender": "Male",
"profession": "Guardian",
"level": 80,
"guild": "4BBB52AA-D768-4FC6-8EDE-C299F2822F0F"
},
{
"name": "Eir Stegalkin",
"race": "Sylvari",
"gender": "Female",
"profession": "Thief",
"level": 80
}
]
Right now the information returned is fairly basic, but we’ll be adding in the ability to pull character inventories, equipment, traits and skills later on.
Due to technical constraints (wibbly wobbly distributed systems) the character blobs may be a bit stale (up to 5 minutes, I think), so factor that in if you’re making a guild rep tracking system or something (because I know someone’s going to do that).
Let me know if you’ve got any questions/concerns and I’ll do my best to answer ’em.