Protocols/WebAPI/Reference: Difference between revisions
Animadoria (talk | contribs) No edit summary |
|||
| (2 intermediate revisions by one other user not shown) | |||
| Line 2: | Line 2: | ||
The Web AIM API lets developers incorporate core AIM functionality into any web page, including the ability to sign on, send and receive IMs, and obtain a user's Buddy List. By using the Web AIM API to build their applications, developers can take advantage of AIM's power and large user base, while having the freedom to extend AIM's functionality in innovative new ways. The APIs support both the building of real-time, interactive widgets and one-time queries. Developers can use as much or as little of the platform as they like. | The Web AIM API lets developers incorporate core AIM functionality into any web page, including the ability to sign on, send and receive IMs, and obtain a user's Buddy List. By using the Web AIM API to build their applications, developers can take advantage of AIM's power and large user base, while having the freedom to extend AIM's functionality in innovative new ways. The APIs support both the building of real-time, interactive widgets and one-time queries. Developers can use as much or as little of the platform as they like. | ||
<!-- | |||
You will need a key to use the Web AIM APIs, which can be obtained from [https://dev.nina.bz/webapi/keys/create/ Web AIM Key Registration]. If you are interested in using or modifying already-built widgets, visit [[Protocols/WebAPI/Clients/Whimsicals|AIM Whimsicals]]. | You will need a key to use the Web AIM APIs, which can be obtained from [https://dev.nina.bz/webapi/keys/create/ Web AIM Key Registration]. If you are interested in using or modifying already-built widgets, visit [[Protocols/WebAPI/Clients/Whimsicals|AIM Whimsicals]]. | ||
--> | |||
You will need a key to use the Web AIM APIs, which can be obtained by contacting us on our Discord. Soon we'll have a dashboard to create a key. | |||
=== Typical Authenticated Application Flow === | === Typical Authenticated Application Flow === | ||
The application should not ask for the loginId and password directly. Instead, the application must show pages, usually in an IFRAME, generated by | The application should not ask for the loginId and password directly. Instead, the application must show pages, usually in an IFRAME, generated by NINA to collect the authentication information. Usually an application will have a button that starts the authentication process, but it can also do parts of it on page load. What follows is the typical flow of an application that needs user authentication. | ||
Modern browsers might be more restrictive towards IFRAMEs, you can also use redirects using "succURL". Read the documentation for more information. | |||
* [[Protocols/WebAPI/Auth/WebApp/getToken|getToken]] - A token is required for many of the Web AIM APIs - the first call to getToken will almost always return an error and a redirectURL | * [[Protocols/WebAPI/Auth/WebApp/getToken|getToken]] - A token is required for many of the Web AIM APIs - the first call to getToken will almost always return an error and a redirectURL | ||
| Line 94: | Line 98: | ||
* [[Protocols/WebAPI/Reference/Types#PDResults|PDResults]] | * [[Protocols/WebAPI/Reference/Types#PDResults|PDResults]] | ||
| valign="top" | | | valign="top" | | ||
* Session Methods | * [[Protocols/WebAPI/Reference/Methods/Session|Session Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/Session#startSession|startSession]] | ** [[Protocols/WebAPI/Reference/Methods/Session#startSession|startSession]] | ||
** [[Protocols/WebAPI/Reference/Methods/Session#fetchEvents|fetchEvents]] | ** [[Protocols/WebAPI/Reference/Methods/Session#fetchEvents|fetchEvents]] | ||
| Line 100: | Line 104: | ||
** [[Protocols/WebAPI/Reference/Methods/Session#endSession|endSession]] | ** [[Protocols/WebAPI/Reference/Methods/Session#endSession|endSession]] | ||
** [[Protocols/WebAPI/Reference/Methods/Session#startOSCARSession|startOSCARSession]] | ** [[Protocols/WebAPI/Reference/Methods/Session#startOSCARSession|startOSCARSession]] | ||
* Presence Methods | * [[Protocols/WebAPI/Reference/Methods/Presence|Presence Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/Presence#getPresence|getPresence]] | ** [[Protocols/WebAPI/Reference/Methods/Presence#getPresence|getPresence]] | ||
** [[Protocols/WebAPI/Reference/Methods/Presence#getBuddyListPresence|getBuddyListPresence]] | ** [[Protocols/WebAPI/Reference/Methods/Presence#getBuddyListPresence|getBuddyListPresence]] | ||
| Line 108: | Line 112: | ||
** [[Protocols/WebAPI/Reference/Methods/Presence#setProfile|setProfile]] | ** [[Protocols/WebAPI/Reference/Methods/Presence#setProfile|setProfile]] | ||
** [[Protocols/WebAPI/Reference/Methods/Presence#getProfile|getProfile]] | ** [[Protocols/WebAPI/Reference/Methods/Presence#getProfile|getProfile]] | ||
* IM Methods | * [[Protocols/WebAPI/Reference/Methods/IM|IM Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/IM#sendIM|sendIM]] | ** [[Protocols/WebAPI/Reference/Methods/IM#sendIM|sendIM]] | ||
** [[Protocols/WebAPI/Reference/Methods/IM#sendDataIM|sendDataIM]] | ** [[Protocols/WebAPI/Reference/Methods/IM#sendDataIM|sendDataIM]] | ||
** [[Protocols/WebAPI/Reference/Methods/IM#rejectDataIM|rejectDataIM]] | ** [[Protocols/WebAPI/Reference/Methods/IM#rejectDataIM|rejectDataIM]] | ||
** [[Protocols/WebAPI/Reference/Methods/IM#setTyping|setTyping]] | ** [[Protocols/WebAPI/Reference/Methods/IM#setTyping|setTyping]] | ||
* Expressions Methods | * [[Protocols/WebAPI/Reference/Methods/Expressions|Expressions Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/Expressions#getExpression|getExpression]] | ** [[Protocols/WebAPI/Reference/Methods/Expressions#getExpression|getExpression]] | ||
** [[Protocols/WebAPI/Reference/Methods/Expressions#getPersonalities|getPersonalities]] | ** [[Protocols/WebAPI/Reference/Methods/Expressions#getPersonalities|getPersonalities]] | ||
| Line 119: | Line 123: | ||
** [[Protocols/WebAPI/Reference/Methods/Expressions#setExpression|setExpression]] | ** [[Protocols/WebAPI/Reference/Methods/Expressions#setExpression|setExpression]] | ||
** [[Protocols/WebAPI/Reference/Methods/Expressions#uploadExpression|uploadExpression]] | ** [[Protocols/WebAPI/Reference/Methods/Expressions#uploadExpression|uploadExpression]] | ||
* BuddyList Editing Methods | * [[Protocols/WebAPI/Reference/Methods/BuddyList|Buddy List Editing Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/BuddyList#addBuddy|addBuddy]] | ** [[Protocols/WebAPI/Reference/Methods/BuddyList#addBuddy|addBuddy]] | ||
** [[Protocols/WebAPI/Reference/Methods/BuddyList#addGroup|addGroup]] | ** [[Protocols/WebAPI/Reference/Methods/BuddyList#addGroup|addGroup]] | ||
| Line 132: | Line 136: | ||
** [[Protocols/WebAPI/Reference/Methods/BuddyList#copyBuddyLists|copyBuddyLists]] | ** [[Protocols/WebAPI/Reference/Methods/BuddyList#copyBuddyLists|copyBuddyLists]] | ||
** [[Protocols/WebAPI/Reference/Methods/BuddyList#deleteUser|deleteUser]] | ** [[Protocols/WebAPI/Reference/Methods/BuddyList#deleteUser|deleteUser]] | ||
* Preference Methods | * [[Protocols/WebAPI/Reference/Methods/Preference|Preference Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/Preference#setPreference|setPreference]] | ** [[Protocols/WebAPI/Reference/Methods/Preference#setPreference|setPreference]] | ||
** [[Protocols/WebAPI/Reference/Methods/Preference#getPreference|getPreference]] | ** [[Protocols/WebAPI/Reference/Methods/Preference#getPreference|getPreference]] | ||
** [[Protocols/WebAPI/Reference/Methods/Preference#setPermitDeny|setPermitDeny]] | ** [[Protocols/WebAPI/Reference/Methods/Preference#setPermitDeny|setPermitDeny]] | ||
** [[Protocols/WebAPI/Reference/Methods/Preference#getPermitDeny|getPermitDeny]] | ** [[Protocols/WebAPI/Reference/Methods/Preference#getPermitDeny|getPermitDeny]] | ||
* Location Based Methods | * [[Protocols/WebAPI/Reference/Methods/Location|Location Based Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/Location#googleEarth.kml|googleEarth.kml]] | ** [[Protocols/WebAPI/Reference/Methods/Location#googleEarth.kml|googleEarth.kml]] | ||
** [[Protocols/WebAPI/Reference/Methods/Location#getRankedUsersLocations.kml|getRankedUsersLocations.kml]] | ** [[Protocols/WebAPI/Reference/Methods/Location#getRankedUsersLocations.kml|getRankedUsersLocations.kml]] | ||
| Line 143: | Line 147: | ||
** [[Protocols/WebAPI/Reference/Methods/Location#getIMConversationsLocations.kml|getIMConversationsLocations.kml]] | ** [[Protocols/WebAPI/Reference/Methods/Location#getIMConversationsLocations.kml|getIMConversationsLocations.kml]] | ||
** [[Protocols/WebAPI/Reference/Methods/Location#getIMConversationsLocations|getIMConversationsLocations]] | ** [[Protocols/WebAPI/Reference/Methods/Location#getIMConversationsLocations|getIMConversationsLocations]] | ||
* | * [[Protocols/WebAPI/Reference/Methods/BuddyFeed|Buddy Feed Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/BuddyFeed#getUserFeed|getUserFeed]] | ** [[Protocols/WebAPI/Reference/Methods/BuddyFeed#getUserFeed|getUserFeed]] | ||
** [[Protocols/WebAPI/Reference/Methods/BuddyFeed#getBuddylistFeed|getBuddylistFeed]] | ** [[Protocols/WebAPI/Reference/Methods/BuddyFeed#getBuddylistFeed|getBuddylistFeed]] | ||
** [[Protocols/WebAPI/Reference/Methods/BuddyFeed#pushFeed|pushFeed]] | ** [[Protocols/WebAPI/Reference/Methods/BuddyFeed#pushFeed|pushFeed]] | ||
* Miscellaneous Methods | * [[Protocols/WebAPI/Reference/Methods/Misc|Miscellaneous Methods]] | ||
** [[Protocols/WebAPI/Reference/Methods/Misc#getVanityInfo|getVanityInfo]] | ** [[Protocols/WebAPI/Reference/Methods/Misc#getVanityInfo|getVanityInfo]] | ||
** [[Protocols/WebAPI/Reference/Methods/Misc#getAIMFight|getAIMFight]] | ** [[Protocols/WebAPI/Reference/Methods/Misc#getAIMFight|getAIMFight]] | ||
| Line 155: | Line 159: | ||
** [[Protocols/WebAPI/Reference/Methods/Misc#aimStartPage|aimStartPage]] | ** [[Protocols/WebAPI/Reference/Methods/Misc#aimStartPage|aimStartPage]] | ||
** [[Protocols/WebAPI/Reference/Methods/Misc#aimExpressionsPage|aimExpressionsPage]] | ** [[Protocols/WebAPI/Reference/Methods/Misc#aimExpressionsPage|aimExpressionsPage]] | ||
* [[Protocols/WebAPI/Reference/Methods/Chat|Chat Methods]] ''(NINA-created)'' | |||
** [[Protocols/WebAPI/Reference/Methods/Chat#createAndJoinChat|createAndJoinChat]] | |||
** [[Protocols/WebAPI/Reference/Methods/Chat#sendMessage|sendMessage]] | |||
** [[Protocols/WebAPI/Reference/Methods/Chat#setTyping|setTyping]] | |||
** [[Protocols/WebAPI/Reference/Methods/Chat#leaveChat|leaveChat]] | |||
|} | |} | ||
Latest revision as of 01:07, 16 May 2025
| WebAPI Protocol |
| Basic |
| Introduction |
| Clients |
| Whimsicals |
| Host Interaction |
| Flow |
| Authentication |
| • Client |
| • WebApp |
| Other Services |
| • |
| Foodgroups |
The Web AIM API lets developers incorporate core AIM functionality into any web page, including the ability to sign on, send and receive IMs, and obtain a user's Buddy List. By using the Web AIM API to build their applications, developers can take advantage of AIM's power and large user base, while having the freedom to extend AIM's functionality in innovative new ways. The APIs support both the building of real-time, interactive widgets and one-time queries. Developers can use as much or as little of the platform as they like.
You will need a key to use the Web AIM APIs, which can be obtained by contacting us on our Discord. Soon we'll have a dashboard to create a key.
Typical Authenticated Application Flow
The application should not ask for the loginId and password directly. Instead, the application must show pages, usually in an IFRAME, generated by NINA to collect the authentication information. Usually an application will have a button that starts the authentication process, but it can also do parts of it on page load. What follows is the typical flow of an application that needs user authentication. Modern browsers might be more restrictive towards IFRAMEs, you can also use redirects using "succURL". Read the documentation for more information.
- getToken - A token is required for many of the Web AIM APIs - the first call to getToken will almost always return an error and a redirectURL
- Show the redirectURL to the user, usually using an IFRAME, and watch for the URL fragment to contain #AUTHDONE
- getToken - The second call to getToken will return a success with a valid token
- When using one of the APIs that supports the a= parameter, stop here, and use the token.a value
- Some APIs require a session; use startSession to create a session and retrieve an aimsId
- startSession - The first call to startSession MAY return a 450 error with redirectURL if the user is required to grant the page consent to access the user's data - Sessions are only needed when real time presence updates or interactive IMs are required
- If consent was required, show the redirectURL to the user, usually in an IFRAME, and watch for the URL fragment to contain #CONSENTDONE
- startSession - If required, call startSession again
- Now any of the APIs that support the aimsId= parameter can be used
- Sessions require periodic calls of the fetchEvents URL for outstanding items
- endSession - Mark the user offline and clean up server state
Typical Anonymous Application Flow
When building a web AIM API application like WIMZI, that needs to establish an anonymous session, the following application flow should be used. An anonymous session can only interact with the user that created the key.
- startSession - Call startSession with the annoymous= parameter and a WIMZI key
- Use the returned widgetTitle returned from startSession in the UI
- The creatorDisplayName will automatically be returned in the first BuddyList event as the only buddy
- Sessions require periodic calls of the fetchEvents URL for outstanding items
- Use the returned creatorDisplayName to address IMs
- setState - the friendly= option can be used to set a friendly name for the anonymous visitor
- endSession - Mark the anonymous user offline and clean up server state
The sections below contain a complete reference to the enumerations, types, and methods of Web AIM API.