StevenL.3761:

I’m not sure when this happened, but the first /v2 API has gone public: https://api.guildwars2.com/v2/quaggans

The quaggans API returns a list of quaggan identifiers that correspond to a quaggan image. You can get the image URLs using the /v2 request syntax (see https://api.guildwars2.com/v2).

Examples

Response Headers
Take note that /v2 replies with HTTP response headers that provide additional information:

Requests that return identifiers:

  • X-Result-Total (numeric, total count of elements)

Requests that return details for a single identifier:

  • Content-Language (text, ISO 639-1 code)

Requests that return details for multiple identifiers:

  • Content-Language (text, ISO 639-1 code)
  • X-Result-Count (numeric, count of returned array elements)
  • X-Result-Total (numeric, total count of elements)

Requests that return details for multiple identifiers (paged):

  • Content-Language (text, ISO 639-1 code)
  • Link (text, service metadata, rfc5988)
  • X-Page-Size (numeric, maximum size of the array)
  • X-Page-Total (numeric, total count of pages using X-Page-Size)
  • X-Result-Count (numeric, count of returned array elements)
  • X-Result-Total (numeric, total count of elements)

Link format
Paged responses are accompanied by a Link header. This header contains 4 comma-separated links:

  • The next resource: rel=next
  • The current resource: rel=self
  • The first resource: rel=first
  • The last resource: rel=last
<link>;rel=next,<link>;rel=self,<link>;rel=first,<link>;rel=last

Example
</v2/quaggans?page=1>;rel=next,
</v2/quaggans?page=0>;rel=self,
</v2/quaggans?page=0>;rel=first,
</v2/quaggans?page=11>;rel=last

Steelskin.5826:

Thanks for this

Ryan.9387:

Did you just brute force gw2 words to find this?

smiley.1438:

No need to brute force anything – just have a look at the HTTP response headers

https://api.guildwars2.com/v2/

Pay attention to response headers which provide additional metadata about the underlying collection, pagination info, and links.


HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Content-Language: en
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-Content-Type-Options: nosniff
Link: </v2/quaggans?page=0>;rel=previous,</v2/quaggans?page=2>;rel=next,</v2/quaggans?page=1>;rel=self,</v2/quaggans?page=0>;rel=first,</v2/quaggans?page=5>;rel=last
X-Page-Total: 6
X-Page-Size: 5
X-Result-Total: 26
X-Result-Count: 5
Access-Control-Allow-Origin: *
Date: Tue, 15 Jul 2014 05:49:29 GMT
Content-Length: 133

StevenL.3761:

Did you just brute force gw2 words to find this?

Hahaha! No, I regularly check the /v2 page to see whether any APIs have been enabled yet. Yesterday I noticed that they added /v2/quaggans to the list.

StevenL.3761:

Easter egg (sort of): try adding extensions at the end of the URL.

https://api.guildwars2.com/v2/quaggans.xml

smiley.1438:

I wouldn’t consider this as easter egg:

Offering alternative data representations (such as XML) is planned, but not anytime soon.

StevenL.3761:

Well… if soon™ means not now, I’m pretty confident that not anytime soon™ means never.

smiley.1438:

Either way, it’s already prepared then.

StevenL.3761:

I added an example of the Link header to the original post.

StevenL.3761:

I found an interesting way to break the /v2 API. You can specify the same identifier more than once. But you can only specify a limited number of characters (~2000) before the API crashes with an error.

/v2/quaggans?ids=404,404,404,404,…

What’s interesting is that this also messes with the response headers: X-Result-Count can be greater than X-Result-Total.

smiley.1438:

You are bored, aren’t you?

StevenL.3761:

Nope, just part of my testing habits. I’m preparing my code for future /v2 services.

Princes Tyrian.3687:

There is more information at:

https://api.guildwars2.com/v2

A lot more api’s are coming!