LJ.XMLRPC.login
This method logs into LiveJournal and retrieves information about the user logging in.
Request Parameters
- LiveJournal’s Common Request Parameters
- clientversion - 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)
- getmoods - 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. (optional)
- getmenus - Send something for this key if you want to get a list/tree of web jump menus to show in your client. (optional)
- getpickws - 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. (optional)
- getpickwurls - 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. (optional)
Return Values
- fullname - 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 - 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 if you’re developing a client, use the user account test with the password test and a message will always be returned.
- friendgrounds - An array of structs of type FriendGroup
- usejournals - An array of usernames representing shared/news/community journals that the user has permission to post in.
- moods - If you sent the ‘getmoods’ key in your request, an array of type mood is returned. The contents are the new moods that have been added on the server since you last requested the list. Your client should cache the mood list on the client’s computer to avoid requesting the whole list everytime. (optional)
- pickws - This is requrned if you set “getpickws” in your request. 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. An array of struct of type UserPic.
- pickwurls - The URLs of the user pictures. They correspond with the list of picture keywords returned. 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 - 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 - 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.
- userid - The userid of this user on the system. Not required for any other requests to the server, but some developers have wanted it.
- menus - Returned if you set “getmenus” in your request. An array of structs of type MenuItem. corresponding to the list of menu items in order that should be in the LiveJournal web menu in the client application.
FriendGroup Type
A struct containing the following keys
- id - The bit number for this friend group, from 1-30.
- name - The name of this friend group.
- sortorder - The sort integer for this friend group, from 0-255.
- public - Either ‘0’ or ‘1’ for if this friend group is public.
Mood Type
A struct containing the following keys
- id - The integer moodid.
- name - The mood name.
- parent - The mood’s parent (base) moodid.
MenuItem Type
A struct containing the following keys
- text - The text of the menu item, or “-” for a separator.
- url - The URL the menu item should launch, present for all menu items except separators and submenus.
- sub - If this is present, this menu item is a submenu. Same format as top-level menu structure.
