Trollhammer.7439:

This is for the events.json service. I would like to be able to call it once like this

https://api.guildwars2.com/v1/events.json?event_id=1&event_id=2&event_id=3

instead of

https://api.guildwars2.com/v1/events.json?event_id=1
https://api.guildwars2.com/v1/events.json?event_id=2
https://api.guildwars2.com/v1/events.json?event_id=3

Alternatively (and perhaps even better) I would like to just filter on events that grant daily chests.

https://api.guildwars2.com/v1/events.json?daily_chest=true

albus.4273:

That would be a nice feature to be added to the API. I have compiled a list of all/most daily reward events:

daily_events = [
	"6BD7C8B0-2605-4819-9AE6-EF2849098090", // "Defeat Rhendak the Crazed."
	"C876757A-EF3E-4FBE-A484-07FF790D9B05", // "Kill the megadestroyer before it blows everyone up."
	"99254BA6-F5AE-4B07-91F1-61A9E7C51A51", // "Cover Keeper Jonez Deadrun as he performs the cleansing ritual."
	"0464CB9E-1848-4AAA-BA31-4779A959DD71", // "Defeat the Claw of Jormag."
	"95CA969B-0CC6-4604-B166-DBCCE125864F", // "Defeat the dredge commissar."
	"295E8D3B-8823-4960-A627-23E07575ED96", // "Defeat the fire shaman and his minions."
	"C5972F64-B894-45B4-BC31-2DEEA6B7C033", // "Defeat the great jungle wurm."
	"9AA133DC-F630-4A0E-BB5D-EE34A2B306C2", // "Defeat the Inquest's golem Mark II."
	"E1CC6E63-EFFE-4986-A321-95C89EA58C07", // "Defeat the Karka Queen threatening the settlements."
	"F479B4CF-2E11-457A-B279-90822511B53B",
	"5282B66A-126F-4DA4-8E9D-0D9802227B6D",
	"4CF7AA6E-4D84-48A6-A3D1-A91B94CCAD56",
	"6A6FD312-E75C-4ABF-8EA1-7AE31E469ABA", // "Defeat the possessed statue of Dwayna."
	"2555EFCB-2927-4589-AB61-1957D9CC70C8", // "Defeat the Risen Priest of Balthazar before it can summon a horde of Risen."
	"31CEBA08-E44D-472F-81B0-7143D73797F5", // "Defeat the shadow behemoth."
	"E6872A86-E434-4FC1-B803-89921FF0F6D6", // "Defeat Ulgoth the Modniir and his minions."
	"A0796EC5-191D-4389-9C09-E48829D1FDB2", // "Destroy the Eye of Zhaitan."
	"33F76E9E-0BB6-46D0-A3A9-BE4CDFC4A3A4", // "Destroy the fire elemental created from chaotic energy fusing with the C.L.E.A.N. 5000's energy core."
	"7E24F244-52AF-49D8-A1D7-8A1EE18265E0", // "Destroy the Risen Priest of Melandru."
	"242BD241-E360-48F1-A8D9-57180E146789", // "Kill Admiral Taidha Covington."
	"0372874E-59B7-4A8F-B535-2CF57B8E67E4", // "Kill the Corrupted High Priestess"
	"B4E6588F-232C-4F68-9D58-8803D67E564D", // "Kill the Foulbear Chieftain and her elite guards before the ogres can rally."
	"F7D9D427-5E54-4F12-977A-9809B23FBA99", // "Kill the Svanir shaman chief to break his control over the ice elemental."
	"03BF176A-D59F-49CA-A311-39FC6F533F2F", // "Slay the Shatterer"
	"568A30CF-8512-462F-9D67-647D69BEFAED"  // "Defeat Tequatl the Sunless."
];
The results could then be filtered against that list.
var tmp = [], row;
// XMLHttpRequest(...);

for(var i = 0, l = http.events.length; i < l; ++i){
    row = http.events[i];

    if(daily_events.indexOf(row.event_id) > -1)
        tmp.push(row);
}
http.events = tmp;
delete tmp;

Lil Puppy.5216:

Due to the way URLs are handled by browsers and servers, the acceptable length of a URL is 2083 characters max (thanks to IE). With that amount of character space, you can get a maximum of 54 events at a time using a comma separated list in the URL at a time.
Most browsers aside from IE will handle up to 64k characters per url, but servers also have limits so it’s usually a good idea to keep them from exceeding 2000 characters total, granting you 52 events at a time.

ex:
https://api.guildwars2.com/v1/events.json?event_ids=6BD7C8B0-2605-4819-9AE6-EF2849098090,
C876757A-EF3E-4FBE-A484-07FF790D9B05,
99254BA6-F5AE-4B07-91F1-61A9E7C51A51,
0464CB9E-1848-4AAA-BA31-4779A959DD71

base URL length = 52 characters from the h to the =
-1 because the last item doesn’t need a comma
each event id and a comma = 37 characters.

Max:
2083-53=2030
2030/37=54.864~

Average:
2000-53=1947
1947/37=52.621~

Stefan Larimore.6872:

We are looking into some options for bulk access and filtering. Another option is to optionally allow specifying ids in a POST body. Though, we probably will have some sort of max id count limit so the URL constraints may not matter.

AdelphiA.9287:

Due to the way URLs are handled by browsers and servers, the acceptable length of a URL is 2083 characters max (thanks to IE). With that amount of character space, you can get a maximum of 54 events at a time using a comma separated list in the URL at a time.
Most browsers aside from IE will handle up to 64k characters per url, but servers also have limits so it’s usually a good idea to keep them from exceeding 2000 characters total, granting you 52 events at a time.

ex:
https://api.guildwars2.com/v1/events.json?event_ids=6BD7C8B0-2605-4819-9AE6-EF2849098090,
C876757A-EF3E-4FBE-A484-07FF790D9B05,
99254BA6-F5AE-4B07-91F1-61A9E7C51A51,
0464CB9E-1848-4AAA-BA31-4779A959DD71

base URL length = 52 characters from the h to the =
-1 because the last item doesn’t need a comma
each event id and a comma = 37 characters.

Max:
2083-53=2030
2030/37=54.864~

Average:
2000-53=1947
1947/37=52.621~

You are wasting valuable character space by using the “-”. “C876757AEF3E4FBEA48407FF790D9B05” is the same as “C876757A-EF3E-4FBE-A484-07FF790D9B05”, saving you 4 characters per ID. Not much I know, but over 52 ID’s that’s 208 wasted characters.

smiley.1438:

You are wasting valuable character space by using the “-”. “C876757AEF3E4FBEA48407FF790D9B05” is the same as “C876757A-EF3E-4FBE-A484-07FF790D9B05”, saving you 4 characters per ID. Not much I know, but over 52 ID’s that’s 208 wasted characters.

You’re messing up UUIDs and their respective MD5 hashes. It may be possible to strip the hyphens but don’t know yet if this would be supported by the API.

http://en.wikipedia.org/wiki/Universally_unique_identifier

Ruhrpottpatriot.7293:

Thumbs up for specifying event (and item/recipe) ids in the request body, not just the url.

DarkSpirit.7046:

Due to the way URLs are handled by browsers and servers, the acceptable length of a URL is 2083 characters max (thanks to IE). With that amount of character space, you can get a maximum of 54 events at a time using a comma separated list in the URL at a time.
Most browsers aside from IE will handle up to 64k characters per url, but servers also have limits so it’s usually a good idea to keep them from exceeding 2000 characters total, granting you 52 events at a time.

ex:
https://api.guildwars2.com/v1/events.json?event_ids=6BD7C8B0-2605-4819-9AE6-EF2849098090,
C876757A-EF3E-4FBE-A484-07FF790D9B05,
99254BA6-F5AE-4B07-91F1-61A9E7C51A51,
0464CB9E-1848-4AAA-BA31-4779A959DD71

base URL length = 52 characters from the h to the =
-1 because the last item doesn’t need a comma
each event id and a comma = 37 characters.

Max:
2083-53=2030
2030/37=54.864~

Average:
2000-53=1947
1947/37=52.621~

How about spawning a number of threads (or web workers) and breakup the query with each event being queried per thread?

sorenrye.7238:

I have only checked the source of one of the api wrappers. It creates a new connection every time it wants to request information from https://api.guildwars2.com.

Until it becomes possible to query for multiple event_id’s (and the like, hopefully) in a single request, does anet support the reuse of the https connection (the tcp socket) for sending multiple requests (keep_alive)? If this is supported, does any of the api wrappers take advantage of this? If so, which api wrapper takes advantage of this?