Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Weird API behavior

AdaAda Member Posts: 221 ✭✭✭✭ - Eminent
edited April 2013 in Tech Support
Hi! I've been trying to use IRE's open API ( http://www.ironrealms.com/IREAPIdocumentation.pdf ) to collect orglogs. But I've been having some weird issues accessing the api server.

1. The server returns an Http 403 (Forbidden) when there are no logs for an org for a given day, I can handle that but shouldn't that return an empty JSON object?
2. The 'count' items in the /orglogs.json endpoint never change when I give day=x parameter, they always reflect the state for day 0. Here are sample uris I'm using,


The count is always the same O_o
My script is hosted here:


Anyone know what might be causing the weird behavior? Thanks in advance!


  • CardanCardan The GardenMember Posts: 437 Immortal
    orglogs.json displays the count of log entries for the current day only and 'day' isn't an optional parameter for it, which is why you keep getting the same numbers back.

    Theoretically you should only be getting a 403 error for an authentication failure but from looking at the code itself, it does appear that it is correctly (code-wise) returning a 403 error when the log file in question doesn't exist.

    I'll see if I can find out how people should report bugs/submit ideas for the API server (since it's IRE-wide not Achaea specific) and I'll let you know.
  • AdaAda Member Posts: 221 ✭✭✭✭ - Eminent
  • OrzaansynOrzaansyn Member Posts: 663 @@ - Legendary Achaean

    Hello @Cardan‌.

    Would it be possible to allow Access-Control-Allow-Origin on the API urls? Or at least return a JSONP callback?

  • OrzaansynOrzaansyn Member Posts: 663 @@ - Legendary Achaean
    @Tecton ? @Sarapis‌ ? Please would you tell me where to address this request?
  • AdaAda Member Posts: 221 ✭✭✭✭ - Eminent

    Hi @Orzaansyn‌! http://api.achaea.com/gamefeed.json?jsonp=parseResponse already gives this:

    HTTP/1.1 200 OK
    Content-Length: 661
    Date: Thu, 19 Jun 2014 00:07:37 GMT
    Expires: Thu, 19 Jun 2014 00:07:37 GMT
    Server: Apache
    X-Powered-By: PHP/5.4.22
    Access-Control-Allow-Origin: *
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Content-Type: application/json
    Age: 1
    Connection: keep-alive

    That's not usable for JSONP but yay for pretty *'s!! :smiley: 
  • OrzaansynOrzaansyn Member Posts: 663 @@ - Legendary Achaean

    Oh. Damn. Thank you very much @Ada ... How comes it returned me a cross domain error when I tried?

  • OrzaansynOrzaansyn Member Posts: 663 @@ - Legendary Achaean
    Anyway, it works and it is exactly what I needed. Thank you very much.

Sign In to Comment.