XML-RPC Protocol Method: getevents

Given a set of specifications, will return a segment of entries up to a limit set by the server. Has a set of options for less, extra, or special data to be returned.

Inputs
truncate Scalar. Required. A 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.

prefersubject Scalar. Required. 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 Scalar. Optional. If this setting is set to true (1), then no meta-data properties are returned.

selecttype Scalar. Required. 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). Note 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 conjunction with the syncitems protocol mode.

lastsync Scalar. Optional. For a selecttype of syncitems, the date (in "yyyy-mm-dd hh:mm:ss" format) that you want to get updates since.

year Scalar. Optional. For a selecttype of day, the 4-digit year of events you want to retrieve.

month Scalar. Optional. For a selecttype of day, the 1- or 2-digit month of events you want to retrieve.

day Scalar. Optional. For a selecttype of day, the 1- or 2-digit day of the month of events you want to retrieve.

howmany Scalar. Optional. For a selecttype of lastn, how many entries to get. Defaults to 20. Maximum is 50.

beforedate Scalar. Optional. 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.

itemid Scalar. Optional. 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 Scalar. Optional. 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, Dreamwidth 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.

usejournal Scalar. Optional. 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.

Outputs
events Array of structs. Required. A list of structs for all of the returned events. Containing keys:


 * itemid Scalar. Required. The unique integer ItemID of the item being returned.
 * eventtime Scalar. Required. The time the user posted (or said they posted, rather, since users can back-date posts) the item being returned.
 * logtime Scalar. Required. The UTC time that the server logged when the post was first created.
 * security Scalar. Required. If this variable is not returned, then the security of the post is public, otherwise this value will be private or usemask.
 * allowmask Scalar. Optional. If security is usemask then this is defined with the 32-bit unsigned int bit-mask of who is allowed to access this post.
 * subject Scalar. Optional. The subject of the journal entry. This won't be returned if "prefersubjects" is set, instead the subjects will show up as the events.
 * event Scalar. Required. The 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.
 * anum Scalar. Required. 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 Scalar. Required. 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.
 * poster Scalar. Optional. 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.
 * props Struct. Optional. Properties and their values for the item being returned. See Journal Entries Metadata for the documentation of the keys and value data types.

Example Response
