{ getfriendgroups
.des
Retrieves a list of the user's defined groups of friends.
.response
{ frgrp_num_name
.des
The name of the friend group with number num.
}
{ frgrp_num_sortorder
.des
The sort-order of the friend group with number num. An integer value between 0 and 255.
}
{ frgrp_num_public
.des
If this key is returned and its value is "1", then group num is a public group. (that is, other users can see the name of the group and who is in it)
}
{ frgrp_maxnum
.des
The largest friend group number that was returned. This is not the number of friend groups returned, it is simply the upper bound. In other words, there may be holes as you iterate from 1 to frgrp_maxnum, so don't assume the presence of any key/value pairs returned. If this value is 0, however, you can safely assume there are no friend groups, as the minimum allowed friend group number is 1.
}
}
{ editfriendgroups
.des
Edit the user's defined groups of friends.
.request
{ editfriend_groupmask_friend
.des
Send a key in the form editfriend_groupmask_friend where friend is the friend's username. The value should be a string representing an unsigned 32-bit integer with bit 0 set (or the server will force it on anyway), bits 1-30 set for each group the friend belongs to, and bit 31 unset (reserved for future use).
}
{ efg_delete_groupnum
.des
Send a key of this type to delete the friend group with number groupnum (which can be from 1-30, inclusive). The server will modify all old entries that allow access to that friend group, so a new friend group using that number won't have access to old non-related entries, and unset the bit for that friend group on the groupmask of each friend, unless your client sends the friend's new groupmask explicitly.
}
{ efg_set_groupnum_name
.des
Create or rename the friend group by sending this key, where groupnum is from 1-30. The value is the name of the group.
}
{ efg_set_groupnum_sort
.des
If efg_set_groupnum_sort is sent, this field should be sent to indicate the sorting order of this group. The value must be in the range of 0-255. The default is 50.
}
{ efg_set_groupnum_public
.des
If efg_set_groupnum_public is "1", then this group is marked as public. If public, other users can see the name of the group and the people that are in it.
.optional
1
}
}
{ login
.des
Log in to the server, while announcing your client version. The server returns with whether the password is good or not, the user's name, an optional message to be displayed to the user, and the list of the user's friend groups. (friend groups can also be retrieved using the getfriendgroups mode)
.request
{ clientversion
.des
Although optional, this should be a string of the form Platform-ProductName/ClientVersionMajor.Minor.Rev, like Win32-MFC/1.2.7 or Gtk-LoserJabber/1.0.4. Note in this case that "Gtk" is not a platform, but rather a toolkit, since the toolkit is multi-platform (Linux, FreeBSD, Solaris, Windows...). You make the judge what is best to send, but if it's of this form, we'll give you cool statistics about your users.
.optional
1
}
{ getmoods
.des
If your client supports moods, send this key with a value of the highest mood ID you have cached/stored on the user's computer. For example, if you logged in last time with and got mood IDs 1, 2, 4, and 5, then send "5" as the value of "getmoods". The server will return every new mood that has an internal MoodID greater than 5. If you've never downloaded moods before, send "0". If you don't care about getting any moods at all (if your client doesn't support them), then don't send this key at all.
}
{ getmenus
.des
Send something for this key if you want to get a list/tree of web jump menus to show in your client.
}
{ getpickws
.des
If your client supports picture keywords and you want to receive that list, send something for this key, like "1", and you'll receieve the list of picture keywords the user has defined.
}
{ getpickwurls
.des
If your client supports picture keywords and can also display the pictures somehow, send something for this key, like "1", and you'll receieve the list of picture keyword URLs that correspond to the picture keywords as well as the URL for the default picture. You must send getpickws for this option to even matter.
}
.response
{ name
.des
The user's full name. Often, clients use this to change the top-level window's title bar text to say something like "LiveJournal - User name". You can just ignore this if you'd like.
}
{ message
.des
A message that should be displayed in a dialog box (or to the screen in a console application). The message is rarely present but when used notifies the user of software updates they've requested to hear about, problems with their account (if mail is bouncing to them, we'd like them to give us a current email address), etc. To test this, use the user account test with the password test... a message will always be returned.
}
{ frgrp_num_name
.des
The name of the friend group with number num.
}
{ frgrp_num_sortorder
.des
The sort-order of the friend group with number num. An integer value between 0 and 255.
}
{ frgrp_num_public
.des
If this key is returned and its value is "1", then group num is a public group. (that is, other users can see the name of the group and who is in it)
}
{ frgrp_maxnum
.des
The largest friend group number that was returned. This is not the number of friend groups returned, it is simply the upper bound. In other words, there may be holes as you iterate from 1 to frgrp_maxnum, so don't assume the presence of any key/value pairs returned. If this value is 0, however, you can safely assume there are no friend groups, as the minimum allowed friend group number is 1.
}
{ access_count
.des
If this user has access to post in shared journals (i.e., news account), then this key is returned saying how many journals (besides the user's own) he/she has access to. Then, a key is returned for each journal.
}
{ access_n
.des
The nth shared journal this user has access to post to. These are returned in alphabetical order.
}
{ mood_count
.des
The number of new moods that are being returned.
}
{ mood_n_id
.des
The server mood ID for mood n, where n is between 1 and mood_count.
}
{ mood_n_name
.des
The mood text for mood n, where n is between 1 and mood_count.
}
{ menu_menunum_count
.des
Each menu or submenu returns the number of items in it. Menunum "0" is the root menu and that's where you should start your recursive construction of the menus.
}
{ menu_menunum_itemnum_text
.des
The text of the itemnumth menu item (1-based index) in the menunumth menu (0-based index.. kinda. it's not really an array.) If the text is a single hypen "-", then show a menu separator bar instead of any text.
}
{ menu_menunum_itemnum_url
.des
The URL to jump to for the itemnumth menu item (1-based index) in the menunumth menu. This may be absent, in which case this is a menu item which opens a sub-menu.
}
{ menu_menunum_itemnum_sub
.des
For menus that don't have associated URLs, this key contains the menunum of the associated sub menu. Call your menu creation function recursively and start making that menu.
}
{ pickw_count
.des
The number of picture keywords about to be returned. Picture keywords are used to identify which userpic (100x100 icon) to use for that particular post. For instance, the user may have "Angry", "Happy", and "Sleepy" picture keywords which map to certain pictures. The client should also do a case-insensitive compare on this list when a mood is selected or entered, and auto-select the current picture keyword. That way it seems that selecting a mood also sets their corresponding picture.
}
{ pickw_n
.des
The nth picture keyword, where n is between 1 and pickw_count. If a user selects one of these, send it as postevent/editevent meta-data with the key "picture_keyword" (which of course you have to prefix with "prop_" when sending)
}
{ pickwurl_count
.des
The number of picture URLs being returned, if you sent the 'getpickwurls' key. This number will always be the same as pickw_count.
}
{ pickwurl_n
.des
The URL of the nth picture. It corresponds with the nth picture keyword returned in the other list. Note that the content behind these URLs can never change, so if your client downloads these to display, just cache them locally and never hit the servers again to re-download them or to even check if they've been modified.
}
{ defaultpicurl
.des
The URL of the default picture (if you sent the 'getpickwurls' key). Note that the content behind this URL can never change, so you can cache it locally; also note that the default picture might have no keyword associated with it.
}
{ fastserver
.des
LiveJournal sites may have priority servers for paying customers. If this key is both present and set to value "1", then the client has permission to set the "ljfastserver" cookie in subsequent requests. The HTTP request header to send is "Cookie: ljfastserver=1". If you send this header without getting permission from the login mode, your requests will fail. That is, you'll trick the load balancer into directing your request towards the priority servers, but the server you end up hitting won't be happy that you're trying to scam faster access and will deny your request.
}
}
{ getdaycounts
.des
This mode retrieves the number of journal entries per day. Useful for populating
calendar widgets in GUI clients.
.request
{ usejournal
.des
If getting the day counts of a shared journal, include this key and the username you wish to get the counts of. By default, you load the counts of "user" as specified above.
.optional
1
}
.response
{ yyyy-mm-dd
.des
For each day that the user has posted a journal entry, a key in the form yyyy-mm-dd is returned, with the value being the number of entries posted that day. The absence of a key implies zero entries for that day, as well as the presence of a key with the value "0". Note that mm and dd are always two digits, zero padded, so the total key length will always be 10 characters.
}
}
{ postevent
.des
The most important mode, this is how a user actually submits a new log entry to the server.
.response
{ itemid
.des
The unique number the server assigned to this post. Currently nothing else in the protocol requires the use of this number so it's pretty much useless, but somebody requested it be returned, so it is.
}
{ anum
.des
The authentication number generated for this entry. It can be used by the client to generate URLs, but that is not recommended. (See the returned 'url' element if you want to link to a post.)
}
{ url
.des
The permanent link address to this post. This is an opaque string--you should store it as is. While it will generally follow a predictable pattern, there is no guarantee of any particular format for these, and it may change in the future.
}
.request
{ event
.des
The event/log text the user is submitting. Carriage returns are okay (0x0A, 0x0A0D, or 0x0D0A), although 0x0D are removed internally to make everything into Unix-style line-endings (just \ns). Posts may also contain HTML, but be aware that the LiveJournal server converts newlines to HTML <BR>s when displaying them, so your client should not try to insert these itself.
}
{ lineendings
.des
Specifies the type of line-endings you're using. Possible values are unix (0x0A (\n)), pc (0x0D0A (\r\n)), or mac (0x0D (\r)). The default is not-Mac. Internally, LiveJournal stores all text as Unix-formatted text, and it does the conversion by removing all \r characters. If you're sending a multi-line event on Mac, you have to be sure and send a lineendings value of mac or your line endings will be removed. PC and Unix clients can ignore this setting, or you can send it. It may be used for something more in the future.
}
{ subject
.des
The subject for this post. Limited to 255 characters. No newlines.
}
{ security
.des
Specifies who can read this post. Valid values are public (default), private and usemask. When value is usemask, viewability is controlled by the allowmask.
.optional
1
}
{ allowmask
.des
Relevant when security is usemask. A 32-bit unsigned integer representing which of the user's groups of friends are allowed to view this post. Turn bit 0 on to allow any defined friend to read it. Otherwise, turn bit 1-30 on for every friend group that should be allowed to read it. Bit 31 is reserved.
}
{ year
.des
The current 4-digit year (from the user's local timezone).
}
{ mon
.des
The current 1- or 2-digit month (from the user's local timezone).
}
{ day
.des
The current 1- or 2-digit day of the month (from the user's local timezone).
}
{ hour
.des
The current 1- or 2-digit hour from 0 to 23 (from the user's local timezone).
}
{ min
.des
The current 1- or 2-digit minute (from the user's local timezone).
}
{ prop_name
.des
Set an arbitrary (but restricted) meta-data property to this log item. See [special[logprops]] for the documentation of them and the list of valid names. You may send zero or more keys like this, one for each property you're setting.
}
{ usejournal
.des
If posting to a shared journal, include this key and the username you wish to post to. By default, you post to the journal of "user" as specified above.
.optional
1
}
}
{ friendof
.des
Returns a list of which other LiveJournal users list this user as their friend.
.request
{ friendoflimit
.des
If set to a numeric value greater than zero, this mode will only return the number of results indicated. Useful only for building pretty lists for display which might have a button to view the full list nearby.
.optional
1
}
.response
{ friendof_count
.des
The number of records that will be returned. The records returned are named numerically,
using a 1-based index. (1 .. friendof_count)
}
{ friendof_n_user
.des
The nth user that lists this user as their friend.
}
{ friendof_n_name
.des
The nth user's full name.
}
{ friendof_n_bg
.des
The background color the nth user chose to represent the current user.
}
{ friendof_n_fg
.des
The text color the nth user chose to represent the current user.
}
{ friendof_n_type
.des
The account type of this user, if it's not a personal account. Currently the only possible value is "community", which means you're a member of that community.
}
{ friendof_n_status
.des
The status of this user. If this field is absent, the user has a normal active account. Otherwise the currently possible values for this field are "deleted", "suspended" and "purged".
}
}
{ getfriends
.des
Returns a list of which other LiveJournal users this user lists as their friend.
.request
{ includefriendof
.des
If set to 1, you will also get back the info from the "friendof" mode. Some clients show friends and friendof data in separate tabs/panes. If you're always going to load both, then use this flag (as opposed to a tabbed dialog approach, where the user may not go to the second tab and thus would not need to load the friendof data.) friendof request variables can be used.
.optional
1
}
{ includegroups
.des
If set to 1, you will also get back the info from the "getfriendgroups" mode. See above for the reason why this would be useful.
.optional
1
}
{ includebdays
.des
If set to 1, birthdays will be included with the friends results below.
.optional
1
}
{ friendlimit
.des
If set to a numeric value greater than zero, this mode will only return the number of results indicated. Useful only for building pretty lists for display which might have a button to view the full list nearby.
.optional
1
}
.response
{ friend_count
.des
The number of records that will be returned. The records returned are named numerically,
using a 1-based index. (1 .. friend_count)
}
{ friend_n_user
.des
The nth friend's user name.
}
{ friend_n_name
.des
The nth friend's full name.
}
{ friend_n_birthday
.des
The nth friend's birthday. Note that this is only returned if the user has set
their info to visible and if they have set a birthday, otherwise this key is skipped.
You will also need to set includebdays to 1 when you make the request in order to
receive this field.
}
{ friend_n_bg
.des
The background color representing the nth friend.
}
{ friend_n_fg
.des
The text color representing the nth friend.
}
{ friend_n_groupmask
.des
If the group mask is not "1" (just bit 0 set), then this variable is returned with an 32-bit unsigned integer with a bit 0 always set, and bits 1-30 set for each group this friend is a part of. Bit 31 is reserved.
}
{ friend_n_type
.des
The account type of this friend, if it's not a personal account. Currently the only possible values are "community" and "syndicated", which means you're monitoring this community/syndicated feed on your friends list. (Note that it does not imply that you're a member of the community if the type is community, just that you monitor it.)
}
{ friend_n_status
.des
The status of this user. If this field is absent, the user has a normal active account. Otherwise the currently possible values for this field are "deleted", "suspended" and "purged".
}
}
{ editfriends
.des
Add, edit, or delete friends from the user's friends list.
.request
{ editfriend_delete_user
.des
Sending a variable of this form removes the friend user from the user's friend list. It is not an error to delete an already non-existant friend. The value should just be 1.
}
{ editfriend_add_i_user
.des
To add a friend, send a variable of this form, where i is any unique integer. The value is the username of the friend to add.
}
{ editfriend_add_i_fg
.des
Sets the text color of the friend i being added. This value is a HTML-style hex-triplet, and must either be of the form #rrggbb or not sent at all. By default, the value assumed is #000000, black.
.optional
1
}
{ editfriend_add_i_bg
.des
Sets the background color of the friend i being added. This value is a HTML-style hex-triplet, and must either be of the form #rrggbb or not sent at all. By default, the value assumed is #FFFFFF, white.
.optional
1
}
{ editfriend_add_i_groupmask
.des
Sets this user's groupmask. Only use this in clients if you've very recently loaded the friend groups. If your client has been loaded on the end user's desktop for days and you haven't loaded friend groups since it started, they may be inaccurate if they've modified their friend groups through the website or another client. In general, don't use this key unless you know what you're doing.
.optional
1
}
.response
{ friends_added
.des
The number of friends that were added with this transaction. The records returned indicate which friends were added, along with their names, named using a 1-based index. (from 1 .. friends_added)
}
{ friend_n_user
.des
The username of the nth friend that was added.
}
{ friend_n_name
.des
The name of the nth friend that was added.
}
}
{ getevents
.des
Download parts of the user's journal.
.request
{ truncate
.des
An optional value that if greater than or equal to 4, truncates the length of the returned events (after being decoded) to the value specified. Entries less than or equal to this length are left untouched. Values greater than this length are truncated to the specified length minus 3, and then have "..." appended to them, bringing the total length back up to what you specified. This is good for populating list boxes where only the beginning of the entry is important, and you'll double-click it to bring up the full entry.
.optional
1
}
{ prefersubject
.des
If this setting is set to true (1), then no subjects are returned, and the events are actually subjects if they exist, or if not, then they're the real events. This is useful when clients display history and need to give the user something to double-click. The subject is shorter and often more informative, so it'd be best to download only this.
}
{ noprops
.des
If this setting is set to true (1), then no meta-data properties are returned.
}
{ selecttype
.des
Determines how you want to specify what part of the journal to download. Valid values are day to download one entire day, lastn to get the most recent n entries (where n is specified in the howmany field), one to download just one specific entry, or syncitems to get some number of items (which the server decides) that have changed since a given time (specified in the lastsync parameter>). Not that because the server decides what items to send, you may or may not be getting everything that's changed. You should use the syncitems selecttype in conjuntions with the syncitems protocol mode.
}
{ lastsync
.des
For a selecttype of syncitems, the date (in "yyyy-mm-dd hh:mm:ss" format) that you want to get updates since.
}
{ year
.des
For a selecttype of day, the 4-digit year of events you want to retrieve.
}
{ month
.des
For a selecttype of day, the 1- or 2-digit month of events you want to retrieve.
}
{ day
.des
For a selecttype of day, the 1- or 2-digit day of the month of events you want to retrieve.
}
{ howmany
.des
For a selecttype of lastn, how many entries to get. Defaults to 20. Maximum is 50.
}
{ beforedate
.des
For a selecttype of lastn, you can optionally include this variable and restrict all entries returned to be before the date you specify, which must be of the form yyyy-mm-dd hh:mm:ss.
.optional
1
}
{ itemid
.des
For a selecttype of one, the journal entry's unique ItemID for which you want to retrieve. Or, to retrieve the most recent entry, use the value -1. Using -1 has the added effect that the data is retrieved from the master database instead of a replicated slave. Clients with an "Edit last entry" feature might want to send -1, to make sure the data that comes back up is accurate, in case a slave database is a few seconds behind in replication.
}
{ lineendings
.des
The desired type of line-endings you'd like LiveJournal to return. Possible values are
unix (0x0A (\n)),
pc (0x0D0A (\r\n), the default),
mac (0x0D (\r)),
space (newlines become spaces),
or dots (newlines become " ... "). The PC format was chosen
as a default because it contains both Unix and Mac line endings in it, so if a client doesn't pick a line ending format, the worst case scenario is there are some ugly characters in the client's textbox beside the real newlines.
}
{ usejournal
.des
If getting the history of a shared journal, include this key and the username you wish to get the history of. By default, you load the history of "user" as specified above.
.optional
1
}
.response
{ events_count
.des
The number of events being returned. The records returned are number from 1 to events_count.
}
{ events_n_itemid
.des
The unique integer ItemID of the nth item being returned.
}
{ events_n_eventtime
.des
The time the user posted (or said they posted, rather, since users can back-date posts) the nth item being returned.
}
{ events_n_event
.des
The nth event text itself. This value is first truncated if the truncate variable is set, and then it is URL-encoded (alphanumerics stay the same, weird symbols to %hh, and spaces to + signs, just like URLs or post request). This allows posts with line breaks to come back on one line.
}
{ events_n_security
.des
If this variable is not returned, then the security of the post is public, otherwise this value will be private or usemask.
}
{ events_n_allowmask
.des
If security is usemask then this is defined with the 32-bit unsigned int bit-mask of who is allowed to access this post.
}
{ events_n_subject
.des
The subject of the journal entry. This won't be returned if "prefersubjects" is set, instead the subjects will show up as the events.
}
{ events_n_poster
.des
If the poster of this event is different from the user value sent above, then this key will be included and will specify the username of the poster of this event. If this key is not present, then it is safe to assume that the poster of this event is none other than user.
}
{ events_n_anum
.des
The authentication number generated for this entry. It can be used by the client to generate URLs, but that is not recommended. (See the returned 'url' element if you want to link to a post.)
}
{ events_n_url
.des
The permanent link address to this post. This is an opaque string--you should store it as is. While it will generally follow a predictable pattern, there is no guarantee of any particular format for these, and it may change in the future.
}
{ prop_count
.des
The number of event properties being returned (meta-data about journal entries). Note that this will not even be returned if you set noprops to true.
}
{ prop_n_itemid
.des
The ItemID of the journal entry that this meta-data is attached to.
}
{ prop_n_name
.des
The character string (alphanumerics and underscore only) of the meta-data property name.
}
{ prop_n_value
.des
The value of the nth meta-data property.
}
}
{ editevent
.des
Edit or delete a user's past journal entry
.request
{ itemid
.des
The unique ItemID of the item being modified or deleted.
}
{ event
.des
The revised event/log text the user is submitting. Or, to delete an entry, just send no text at all. Carriage returns are okay (0x0A, 0x0A0D, or 0x0D0A), although 0x0D are removed internally to make everything into Unix-style line-endings (just \ns). Posts may also contain HTML, but be aware that the LiveJournal server converts newlines to HTML <BR>s when displaying them, so your client should not try to insert these itself.
}
{ lineendings
.des
Specifies the type of line-endings you're using. Possible values are unix (0x0A (\n)), pc (0x0D0A (\r\n)), or mac (0x0D (\r)). The default is not-Mac. Internally, LiveJournal stores all text as Unix-formatted text, and it does the conversion by removing all \r characters. If you're sending a multi-line event on Mac, you have to be sure and send a lineendings value of mac or your line endings will be removed. PC and Unix clients can ignore this setting, or you can send it. It may be used for something more in the future.
}
{ subject
.des
The subject for this post. Limited to 255 characters. No newlines.
}
{ security
.des
Specifies who can read this post. Valid values are public (default), private and usemask. When value is usemask, viewability is controlled by the allowmask.
.optional
1
}
{ allowmask
.des
Relevant when security is usemask. A 32-bit unsigned integer representing which of the user's groups of friends are allowed to view this post. Turn bit 0 on to allow any defined friend to read it. Otherwise, turn bit 1-30 on for every friend group that should be allowed to read it. Bit 31 is reserved.
}
{ year
.des
If modifying only, the 4-digit year of the event (from the user's local timezone).
}
{ mon
.des
If modifying only, the 1- or 2-digit month of the event (from the user's local timezone).
}
{ day
.des
If modifying only, the 1- or 2-digit day of the month of the event (from the user's local timezone).
}
{ hour
.des
If modifying only, the 1- or 2-digit hour from 0 to 23 of the event (from the user's local timezone).
}
{ min
.des
If modifying only, the 1- or 2-digit minute of the event (from the user's local timezone).
}
{ prop_name
.des
Set an arbitrary (but restricted) meta-data property to this log item. If a key is sent, but the value is blank or zero (0), then the value of the given name is deleted from this item's property list. See [special[logprops]] for more information.
}
{ usejournal
.des
If editing a shared journal entry, include this key and the username you wish to edit the entry in. By default, you edit the entry as if it were in user "user"'s journal, as specified above.
.optional
1
}
.response
{ itemid
.des
The unique number the server assigned to this post.
}
{ anum
.des
The authentication number for this entry. It can be used by the client to generate URLs, but that is not recommended. (See the returned 'url' element if you want to link to a post.)
}
{ url
.des
The permanent link address to this post. This is an opaque string--you should store it as is. While it will generally follow a predictable pattern, there is no guarantee of any particular format for these, and it may change in the future.
}
}
{ syncitems
.des
Returns a list (or part of a list) of all the items (journal entries, to-do items, comments) that have been created or updated on LiveJournal since you last downloaded them. Note that the items themselves are not returned --- only the item type and the item number. After you get this you have to go fetch the items using another protocol mode. For journal entries (type "L"), use the getevents mode with a selecttype of "syncitems".
.request
{ lastsync
.des
The date you last downloaded synced, in "yyyy-mm-dd hh:mm:ss" format. Note: do not make this date up from the client's local computer... send the date from this mode's response of the newest item you have saved on disk.
.optional
1
}
.response
{ sync_total
.des
The total number of items that have been updated since the time specified.
}
{ sync_count
.des
The number of items that are contained in this response (numbered started at 1). If sync_count is equal to sync_total, then you can stop your sync after you complete fetching every item in this response.
}
{ sync_n_item
.des
The nth item, in the form "Type-Number". Type can be one of "L" for log entries (journal entries), "C" for comments (not implemented), "T" for to-do items (not implemented), or many other things presumably. If your client doesn't know how to fetch an item of a certain type, just ignore them. A new version of your client could later see that it has never downloaded anything of type "T" and go back and fetch everything of that type from the beginning.
}
{ sync_n_action
.des
Either "create" or "update". This field isn't too useful, but you may want to make your client verbose and tell the user what it's doing. For example, "Downloading entry 5 of 17: Updated".
}
{ sync_n_time
.des
The server time (in the form "yyyy-mm-dd hh:mm:ss") that this creation or update took place. Remember in your local store the most recent for each item type ("L", "T", "C", etc...). This is what you send in subsequent requests in lastsync.
}
}
{ checkfriends
.des
Mode that clients can use to poll the server to see if their friends list has been updated. This request
is extremely quick, and is the preferred way for users to see when their friends list is updated, rather
than pounding on reload in their browser, which is stressful on the serves.
.request
{ lastupdate
.des
The time that this mode request returned last time you called it. If this is the first time you've ever called it (since your client has been running), leave this blank. It's strongly recommended that you do not remember this value across invocations of your client, as it's very likely your friends will update since the client was running so the notification is pointless... the user probably read his/her friends page already before starting the client.
}
{ mask
.des
The friend group(s) in which the client is checking for new entries, represented as a 32-bit unsigned int. Turn on any combination of bits 1-30 to check for entries by friends in the respective friend groups. Turn on bit 0, or leave the mask off entirely, to check for entries by any friends.
.optional
1
}
.response
{ lastupdate
.des
The time of the most recent post that one of the user's friends has made. Don't try to infer anything from this time. It's currently of the form "yyyy-mm-dd hh:mm:ss", in PST. However, in the future, it may not even be a date... just blindly store and return this value back later, ignoring its format.
}
{ new
.des
This is what you should use to determine if there are new entries. Its value is "1" if there is new stuff, or "0" if there isn't. A few people requested that this return the number of new entries, but that's a lot more resource intensive, and this protocol mode is supposed to be very quick and painless. In the future we may add a "new_count" response value that says how many new items there are. Note that once this values becomes "1" and you alert the user, stop polling! It'd be pointless to have the client hitting the server all night while the user slept. Once the user acknowleges the notifcation (double-clicks the system tray or panel applet or whatnot), then resume your polling.
}
{ interval
.des
How many seconds you must wait before polling the server again. If your client disobeys, this protocol will just return error messages saying "slow down, bad client!" instead of giving you the data you were trying to cheat to obtain. Note that this also means your client should have an option to disable polling for updates, since some users run multiple operating systems with multiple LiveJournal clients, and both would be fighting each other.
}
}
{ getchallenge
.des
Generate a one-time, quick expiration challenge to be used in challenge/response authentication methods.
.response
{ auth_scheme
.des
You can ignore this for now. By default this is the highest version of our
authentication schemes, if in the future if we implement other auth schemes or change the default.
In that case we'd add a new capabilities exchange: your client could say, "I know c0 and c1", and
our server would then say, "Use c1, it's the best."
}
{ challenge
.des
An opaque cookie to generate a hashed response from.
}
{ expire_time
.des
The expiration time of the challenge, as measured in seconds since the Unix epoch.
}
{ server_time
.des
The server time when the challenge was generated, as measured in seconds since the Unix epoch.
}
}
{ sessionexpire
.des
Expires one or more sessions that a user has active within the system. This can be used to log a user out of any browsers they are logged in from as well as to cancel any sessions created with the sessionexpire mode.
.request
{ expireall
.des
If present and true, will expire all of a user's sessions.
.optional
1
}
{ expire_id_num
.des
If present and true, will expire the session with id num. You can get the id of a session from the third element of the session: ws:username:session_id:auth_code.
.optional
1
}
}
{ sessiongenerate
.des
Generates a session that can be used to setup a cookie for accessing the site with a user's privileges.
.request
{ expiration
.des
Sessions can either expire in a short amount of time or last for a long period of time. You can specify either "short" or "long" as the value of this parameter.
.optional
1
}
{ ipfixed
.des
If specified and true, this will cause the server to generate a session that is only valid from the IP address the sessiongenerate request was sent from. If you leave out this value, it will default to allowing any IP address to use this session information.
.optional
1
}
.response
{ ljsession
.des
This part of the response contains the actual session data. If you use the complete contents of this element as a cookie named "ljsession" then you will be able to access the site using the privileges of the user you authenticated as.
}
}