|
|
User
user.getInfo
Gets information about the logged-in user in an existing API session. Do not poll this method more than once per minute.
HTTP Method:
- GET
- http://www.lingr.com/api/user/get_info
Parameters:
| session * | The authenticated session id |
(*) Required
Example Response:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>ok</status>
<user_id>duWDM2k3Eho</user_id>
<email>foo@bar.com</email>
<default_nickname>The Foo Guy</default_nickname>
<description>Check out my blog at http://blog.fooguy.com</description>
<counter>7</counter>
<owned_rooms>
<owned_room>
<id>1dKi3NA0vgf</id>
<name>Frog Lovers</name>
<description>All about frogs</description>
<url>http://www.lingr.com/room/1dKi3NA0vgf</url>
<icon_url>http://images.lingr.com/room/1dKi3NA0vgf/16x16.gif</icon_url>
<counter>123</counter>
<max_user_message_id>120</max_user_message_id>
<tags/>
</owned_room>
<owned_room>
<id>gcnZ3vAcZDA</id>
<name>Cow Lovers</name>
<description>All about cows</description>
<url>http://www.lingr.com/room/gcnZ3vAcZDA</url>
<icon_url>http://images.lingr.com/room/gcnZ3vAcZDA/16x16.gif</icon_url>
<tags/>
</owned_room>
</owned_rooms>
<favorite_rooms>
</favorite_rooms>
<monitored_rooms>
</monitored_rooms>
<visited_rooms>
</visited_rooms>
<occupied_rooms>
</occupied_rooms>
<icon_url>http://images.lingr.com/user/duWDM2k3Eho/80x80.gif</icon_url>
</response>A successful response contains the following data items:
user_id
The user’s unique id
The email address with which the user registered with Lingr
default_nickname
The user’s default nickname
description
The user’s profile description
counter
The current version number of the user’s profile
owned_rooms
An array describing each room that the user has created. Each room in this array has the elements described here
favorite_rooms
An array describing each room that the user has marked as a favorite. Each room in this array has the elements described here
monitored_rooms
An array describing each room that the user has requested to monitor with Lingr Radar. Each room in this array has the elements described here
visited_rooms
An array describing each room that the user has visited. Each room in this array has the elements described here
occupied_rooms
An array describing each room that the user is currently occupying. Each room in this array has the elements described here
icon_url
The url of the user’s avatar icon. This url has the structure described here
user.startObserving
Gets a observation ticket so that you can get notified when the information for a logged-in user of a session changes.
HTTP Method:
- POST
- http://www.lingr.com/api/user/start_observing
Parameters:
| session * | The authenticated session id |
(*) Required
A successful response contains the following data items:
ticket
A user observation ticket to be used in subsequent calls to user.observe or user.stopObserving
counter
The current version number of the user’s profile, for use in subsequent calls to user.observe
max_observe_time
The maximum number of seconds which a call to user.observe will wait for changes before returning. You must ensure that the timeout value for any socket you use for user.observe on this ticket is set to this value or higher.
user.observe
Get notified when a user’s information changes. Once you begin observing a user with user.startObserving, you must call this method at least once every two minutes, until you stop observing the user with user.stopObserving.
NOTE: whenever you call user.observe, you must not do so in an HTTP session that is kept-alive from a prior call to some other API method. You may call user.observe in an HTTP session that is kept-alive from a prior call to user.observe.
HTTP Method:
- GET
- http://www.lingr.com/api/user/observe
Parameters:
| session * | The authenticated session id |
| ticket * | The observation ticket returned from user.startObserving |
| counter * | The event counter returned from user.startObserving or the most recent call to user.observe, if any. |
(*) Required
Example Response:
A successful response has the same format and details as the response from user.getInfo, if any event occurs.
However, the response from user.observe differs from the response from user.getInfo in that a given room list is only present in the user.observe response if that list has changed.
For example, whereas the response from user.getInfo always contains the monitored_rooms list, the response from user.observe only contains the monitored_rooms list if the list of monitored rooms has changed. Therefore, you should not assume that a given room list is always present in the user.observe response.
If no event occurs, a successful response has no details, only the <status>ok</status> element.
user.stopObserving
Stop observing a user.
HTTP Method:
- POST
- http://www.lingr.com/api/user/start_observing
Parameters:
| session * | The authenticated session id |
| ticket * | The observation ticket returned from user.startObserving |
(*) Required
Example Response:
<?xml version="1.0" encoding="UTF-8"?> <response> <status>ok</status> </response>
