AOSpeak

Projects => AOSpeak => Topic started by: Tshaar on September 16, 2011, 03:55:03 am

Title: API specification
Post by: Tshaar 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"}]
Title: Re: API specification
Post by: Arriviste 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. ;)
Title: Re: API specification
Post by: Tyrence on September 17, 2011, 05:13:18 am
Yep, utilized. :)
Title: Re: API specification
Post by: Tyrence 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.
Title: Re: API specification
Post by: Tyrence 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.
Title: Re: API specification
Post by: Tshaar 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.
Title: Re: API specification
Post by: Tshaar on October 01, 2011, 07:49:29 am
Added "ingame" (true/false) for /org and /online, and "dim" for /online
Title: Re: API specification
Post by: Tyrence on October 03, 2011, 11:17:07 pm
Awesome.  I have updated the Budabot plugin to also use the ONLINE command.
Title: Re: API specification
Post by: Tshaar 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"
Title: Re: API specification
Post by: Teknologist on April 28, 2012, 05:34:47 am
Fixed URL rewrite issue. The API should be working normaly again.
Title: Re: API specification
Post by: Novagen 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?
Title: Re: API specification
Post by: Teknologist on June 01, 2015, 09:32:09 am
Org_id should be the AO org ID.
Title: Re: API specification
Post by: Novagen 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
Title: Re: API specification
Post by: Teknologist on June 01, 2015, 02:28:40 pm
Awesome!
Let me know if you need anything.