Author Topic: API specification  (Read 8325 times)

0 Members and 1 Guest are viewing this topic.

Offline Tshaar

  • Newcomer
  • *
  • Posts: 59
  • Karma: +1/-0
API specification
« on: September 16, 2011, 03:55:03 am »
API is under development, but should significant changes occur a versioning system will be implemented, meaning the commands below will always work as described.

AOSpeak API specification

Syntax:
GET api.aospeak.com/ command / params / data
Output is sanitized JSON

Commands:


online - get a list of online members on the server
params: 1, 2 (dim, optional)
data: (none)

Output:
array
 [name] (str)
 [country] (str)
 [channelName] (str)
 [dim] (int) (0 for guests)
 [ingame] (bool)
 [idleTime] (int)

Errors:
(empty array if no members online)

Samples:
GET http://api.aospeak.com/online/
GET http://api.aospeak.com/online/2/
Code: [Select]
[{"name":"lazy","country":"UK","channelName":"AFK","dim":1,"ingame":false,"idleTime":"50156064"},{"name":"Tshaar","country":"HR","channelName":"AFK","dim":2,"ingame":false,"idleTime":"12059861"}

org - get a list of online members in an organization channel
params: 1, 2 (dim)
data: [org id]

Output:
array
 [name] (str)
 [country] (str)
 [ingame] (bool)
 [idleTime] (int)

Errors:
ORG_NOT_FOUND - Organization not registered with the system.
(empty array if no members online)

Sample:
GET http://api.aospeak.com/org/1/6541315
Code: [Select]
[{"name":"Tshaar","country":"HR","ingame":false,"idleTime":"153696"},{"name":"Soulmp","country":"CA","ingame":true,"idleTime":"145427"}]
« Last Edit: October 08, 2011, 06:06:38 am by Tshaar »

Offline Arriviste

  • :: b a d v y ::
  • Global Moderator
  • Fledgling
  • *****
  • Posts: 6
  • Karma: +0/-0
  • chop wood :: carry water
Re: API specification
« Reply #1 on: September 16, 2011, 04:47:45 am »
MOONTALK.
But, YAY! I'm pretty sure this is a good thing that others know how to utilize. ;)
.: chop wood :: carry water :.

Offline Tyrence

  • Global Moderator
  • Fledgling
  • *****
  • Posts: 27
  • Karma: +0/-0
Re: API specification
« Reply #2 on: September 17, 2011, 05:13:18 am »
Yep, utilized. :)

Offline Tyrence

  • Global Moderator
  • Fledgling
  • *****
  • Posts: 27
  • Karma: +0/-0
Re: API specification
« Reply #3 on: September 30, 2011, 06:39:02 pm »
Maybe for the ONLINE command, you could add which dimension they are registered on, and whether or not they are in game to the output.

Offline Tyrence

  • Global Moderator
  • Fledgling
  • *****
  • Posts: 27
  • Karma: +0/-0
Re: API specification
« Reply #4 on: September 30, 2011, 07:05:34 pm »
Was testing this ONLINE command, got this output:

Code: [Select]
Array
(
    [0] => stdClass Object
        (
            [name] => player
            [country] => UK
            [idleTime] => This Space For Rent (Clan)
        )
    .....
)

So it's putting the channel name in the idleTime field, and there isn't a channelName field, but it looks like that only happens if you don't specify a server.  If you do, it works no problem.
« Last Edit: September 30, 2011, 07:07:25 pm by Tyrence »

Offline Tshaar

  • Newcomer
  • *
  • Posts: 59
  • Karma: +1/-0
Re: API specification
« Reply #5 on: October 01, 2011, 04:16:11 am »
So it's putting the channel name in the idleTime field, and there isn't a channelName field, but it looks like that only happens if you don't specify a server.  If you do, it works no problem.

Fixed, thanks for the heads up!

I'll add the dim and online alt later.

Offline Tshaar

  • Newcomer
  • *
  • Posts: 59
  • Karma: +1/-0
Re: API specification
« Reply #6 on: October 01, 2011, 07:49:29 am »
Added "ingame" (true/false) for /org and /online, and "dim" for /online

Offline Tyrence

  • Global Moderator
  • Fledgling
  • *****
  • Posts: 27
  • Karma: +0/-0
Re: API specification
« Reply #7 on: October 03, 2011, 11:17:07 pm »
Awesome.  I have updated the Budabot plugin to also use the ONLINE command.

Offline Tshaar

  • Newcomer
  • *
  • Posts: 59
  • Karma: +1/-0
Re: API specification
« Reply #8 on: October 08, 2011, 06:05:35 am »
Guests should no longer be incorrectly reported as being on RK1, instead their "dim" flag will be "0"

Offline Teknologist

  • Administrator
  • Accomplished
  • *****
  • Posts: 102
  • Karma: +2/-0
    • MC Labs Org site
Re: API specification
« Reply #9 on: April 28, 2012, 05:34:47 am »
Fixed URL rewrite issue. The API should be working normaly again.

Offline Novagen

  • Fledgling
  • Posts: 5
  • Karma: +0/-0
Re: API specification
« Reply #10 on: June 01, 2015, 01:54:38 am »
org - get a list of online members in an organization channel
params: 1, 2 (dim)
data: [org id]

Is the org_id the ingame id of the organization or something AOSpeak generates?

Offline Teknologist

  • Administrator
  • Accomplished
  • *****
  • Posts: 102
  • Karma: +2/-0
    • MC Labs Org site
Re: API specification
« Reply #11 on: June 01, 2015, 09:32:09 am »
Org_id should be the AO org ID.

Offline Novagen

  • Fledgling
  • Posts: 5
  • Karma: +0/-0
Re: API specification
« Reply #12 on: June 01, 2015, 02:20:39 pm »
Thanks!
Will see if I can use it for something useful on https://people.rubi-ka.net  :D

Offline Teknologist

  • Administrator
  • Accomplished
  • *****
  • Posts: 102
  • Karma: +2/-0
    • MC Labs Org site
Re: API specification
« Reply #13 on: June 01, 2015, 02:28:40 pm »
Awesome!
Let me know if you need anything.