Part III. Client/Server Protocol

There are a few types of interfaces available to the LiveJournal protocol: the older “flat” interface, the custom XML-RPC interface, Atom API support, and a modified version of the Blogger API. The XML-RPC interface is probably easiest to use, because there are lots of XML-RPC resources available to developers in just about any programming language. If you are in a situation that requires you to write your own interface wrapper, the flat interface is probably best to use.

Tip

Internally, all interfaces are just wrappers around the same functions. Don't worry too much about which one you use, as they accomplish the same thing.

Table of Contents

23. Client / Server Protocol - Quick Reference
1. Introduction to the Protocol
2. Working with Proxies
24. Authentication in the Client Server Protocol
1. Clear
2. HTTP Cookies
3. Challenge-Response
I. Flat Client/Server Protocol Reference
checkfriends — 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 servers.
consolecommand — Run an administrative command. The LiveJournal server has a text-based shell-like administration console where less-often used commands can be entered. There is a web interface to this shell online; this is another gateway to that. The mode is limited to one server-parsed command only. The command should be sent with double quotes around any arguments with spaces, with double quotes escaped by backslashes, and backslashes escaped with backslashes. Optionally, you can send a listref instead of a string for this argument, in which case, we will use your argument separation and not parse it ourselves.
editevent — Edit or delete a user's past journal entry
editfriendgroups — Edit the user's defined groups of friends.
editfriends — Add, edit, or delete friends from the user's Friends list.
friendof — Returns a list of which other LiveJournal users list this user as their friend.
getchallenge — Generate a one-time, quick expiration challenge to be used in challenge/response authentication methods.
getdaycounts — This mode retrieves the number of journal entries per day. Useful for populating calendar widgets in GUI clients.
getevents — Download parts of the user's journal. See also syncitems protocol mode.
getfriendgroups — Retrieves a list of the user's defined groups of friends.
getfriends — Returns a list of which other LiveJournal users this user lists as their friend.
getusertags — Retrieves a list of the user's defined tags.
login — 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)
postevent — The most important mode, this is how a user actually submits a new log entry to the server.
sessionexpire — 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.
sessiongenerate — Generates a session that can be used to setup a cookie for accessing the site with a user's privileges.
syncitems — 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".
II. XML-RPC Client/Server Protocol Reference
checkfriends — Checks to see if your Friends list has been updated since a specified time.
consolecommand — Run an administrative command.
editevent — Edit or delete a user's past journal entry
editfriendgroups — Edit the user's defined groups of friends.
editfriends — Add, edit, or delete friends from the user's Friends list.
friendof — Returns a list of which other LiveJournal users list this user as their friend.
getchallenge — Generate a server challenge string for authentication.
getdaycounts — This mode retrieves the number of journal entries per day.
getevents — Download parts of the user's journal. See also syncitems mode.
getfriends — Returns a list of which other LiveJournal users this user lists as their friend.
getfriendgroups — Retrieves a list of the user's defined groups of friends.
getusertags — Retrieves a list of the user's defined tags.
login — validate user's password and get base information needed for client to function
postevent — The most important mode, this is how a user actually submits a new log entry to the server.
sessionexpire — Expires session cookies.
sessiongenerate — Generate a session cookie.
syncitems — Returns a list of all the items that have been created or updated for a user.
25. Supporting the Blogger API
26. Supporting the Atom API
27. Protocol Versions
28. Downloading Entries
29. Exporting Comments
30. Journal Entries Meta-data
A. Frequently Asked Questions