I used the APIs to write a twitter bot that tweets updated event information for some of the meta-events. When I fetch the current state of events using the events.json request, I get back a result like this:
{ "events": [
{"world_id": 1008, "map_id": 873, "event_id": "659149D4-43EC-4DCB-A6BB-0B2D402B537B",
"state": "Preparation" },
// etc. etc. etc.
]
}
And the very first thing I do is transform this array into an easier-to-use object formatted like this:
{
"659149D4-43EC-4DCB-A6BB-0B2D402B537B": {
"world_id": 1008, "map_id": 873, "state": "Preparation"
},
// etc. etc. etc.
}
That way I can simply use the event_id to immediately find the details I need, rather than parse through the list to find an integer index, and use that for the rest of my process.
This may be more complicated specifically for the Events request, because without a world_id on the request, there will be many events with the same event_id and differing world_id. So this would either have to stay as it is, or world_id would have to be a required parameter. But for other calls, such as world_names, event_names, etc. there should be no problems returning in the format of “object_id”: { /* object details */ } for ease of use (and possibly quicker execution on our app’s side).
Ethelon (Charr Ranger), Ethyldron (Human Thief), Ethyndor (22 Norn Warrior)
Ethelix (16 Charr Necromancer), Ethelsia (11 Sylvari Mesmer)
Jade Quarry