User Tools

Site Tools


dev:api:im

Developer Reference / AOS API Document / IM

AOS IM API commands - RFC


Date: 10 Oct. 2000
Available: 11 Oct. 2000
Status: Draft
Compliant to AOS API Version: AOS 2.0b1
Revision: 1 (1 Jan. 2001)
Web: http://www.afteroffice.com/dev/api/IM.html
By fui@afteroffice.com


Description
This API covered online IM retrieving and sending interface, and related online users information.

Index
[SID].eventnext.user.mms - Obtain status of new message and IM
[SID].eventlist.user.mms - Obtain list of new incoming IM
[SID].user.chat.mms - Obtain list of online users
sqNotify.user.mms - Send IM (message) to user


eventnext.user.mms

Command: [SID].eventnext.user.mms
Use: Obtain status of new email and IM.
Access: HTTP
Method: POST and GET
Parameters case sensitive: NO
Where: [SID] = the user login session ID

Result:
Line 1: <1 for new email available, 0 for none>
Line 2: <1 for new IM available, 0 for none>

Parameters:
API = only 1 argument accepted: “LC”

URL Sample:
http://afteroffice.com/SIDxxx.eventnext.user.mms?api=lc


eventlist.user.mms

Command: [SID].eventlist.user.mms
Use: Obtain list of new IM.
Access: HTTP
Method: POST and GET
Parameters case sensitive: NO
Where: [SID] = the user login session ID

Result: Multiple lines result.
<Date and Time><tab><User email address><tab><Message><cr>

Note: <Message> has the following data encode:
1. CR has been replaced with “<br>“
2. TAB has been replaced with “\t”
You may want to reverse the <Message> to its original appearance by substitute the above escaped strings.

MetaTalk sample:
replace ”<br>” with cr in theMessage
replace “\t” with tab in theMessage

Parameters:
API = only 1 argument accepted: “LC”

URL Sample:
http://afteroffice.com/SIDxxx.eventlist.user.mms?api=lc


user.chat.mms

Command: [SID].user.chat.mms
Use: Obtain online users list.
Access: HTTP
Method: POST and GET
Parameters case sensitive: NO
Date: 28 August 2000
Available: 1 Sept. 2000
Where: [SID] = the user login session ID

Result:
Line 1: <Number of user online>
Line 2 .. x: <User host><tab><User name><tab><User Full Name><cr>

Parameters:
API = only 1 argument accepted: “LC”

URL Sample:
http://afteroffice.com/SIDxxx.user.chat.mms?api=lc


sqNotify.user.mms

Command: sqNotify.user.mms
Use: Send IM (message) to user.
Method: POST and GET
Parameters case sensitive: NO
Date: 28 August 2000
Available: 1 Sept. 2000

Parameters: from=[sender email]
Must be a valid AOS user. MIME email compatible eg:
“fui” fui@afteroffice.com
only 1st sender identity allow.

to=[recipient email]
Can be any recipient with valid email.
MIME email compatible eg:
“fui” fui@afteroffice.com
multiple email allow. Multiple email address may use “;” or “,” and cr as separator:
fui@afteroffice.com; pojen@afteroffice.com
If the recipient is not a AOS user, method will be defaulted to “mail”.

subject=[notify subject]
single line

body=[notify body]
Allow multiple lines. Line separator can be unix cr, or crlf, or “\r”

method=[optional, method of delivery]
Value: “im”,“mail”,“all”
Default: “all”
Set the method for delivering of the notification. When this is set to “all”, AOS tries to delivery the notification with “im”, if the user is not online, “mail” is used. If the recipient is not local, “mail” will be the defaulted method.

header=[optional, other email MIME headers]
Extra MIME header to insert in mail. Valid only if method=mail. Eg:
Reply-to: support@afteroffice.com

Return result:
sqNotify returns none empty, multi-line result (unix cr line separator) with the first line as boolean.

If sqNotify failed, the first line is “false”, second line will be the error description. Possible for failure: the sander is not local.

If the command successful, first line is “true”, and the following lines will be the summery for each recipient delivery method. eg:
If you send notify to the following users:
fui@afteroffice.com
“pojen ng” pojen@afteroffice.com
fui2@afteroffice.com
other@otherdomain.com

Presumed fui@afteroffice.com is online, and pojen@afteroffice.com is not.
Possible result:
true
fui@afteroffice.com IM
pojen@afteroffice.com MAIL
fui2@afteroffice.com MAIL
other@otherdomain.com MAIL

Note that fui2@afteroffice.com is not a valid user, sqNotify failed to verify as a valid AOS user, and thus sent the notify as mail. The sender will then receive a return email because fui2@afteroffice.com doesn't exist.


Different from last draft:
1. method=schedule is dropped and so to sData and sTime related fields.
2. keepcopy is dropped.

dev/api/im.txt · Last modified: 2015/01/16 15:24 by 127.0.0.1