tags:

views:

134

answers:

1

I am having an issue adding posts to LiveJournal via the xmlrpc api they provide. I want to add entries older than what I have listed on LiveJournal already. But I get a response saying:

"You have an entry which was posted at 2009-09-06 18:32, but you're trying to post an entry before this. Please check the date and time of both entries. If the other entry is set in the future on purpose, edit that entry to use the "Date Out of Order" option. Otherwise, use the "Date Out of Order" option for this entry instead."

I haven't found an argument for the "Date Out of Order" option using the LJ.XMLRPC.postevent method. Any help would be highly appreciated.

+2  A: 

In the props argument to postevent, you need to set opt_backdated to true. (See this for the documentation as to what can go in props.)

edit: Here's the XML from the lj_dev entry to which I linked in my comment:

<methodCall>
    <methodName>server.method</methodName>
    <params>
        <param>
            <value><struct>
                <member>
                    <name>event</name>
                    <value><string>the message body</string></value>
                </member>
                <member>
                    <name>props</name>
                    <value><struct>
                        <member>
                            <name>current_music</name>
                            <value><string>football game</string></value>
                        </member>
                    </struct></value>
                </member>
            </struct></value>
        </param>
    </params>
</methodCall>
Isaac
How would I structure the XML string for props? It requests:[array](required)The following 'struct' should have property names as the keys, and the values should be a scalar data type. Containing items:[struct](optional; multiple allowed)Containing keys:opt_backdated - DataType: bool
xenosyde
Actually, per the discussion at http://community.livejournal.com/lj_dev/819036.html?thread=8905564#t8905564, the documentation is wrong and the value of props should be a struct with property names as keys and values as scalars, no array wrapping it. At that URL, there are some samples of successful XML--particularly in the last few comments.
Isaac
I have stumbled upon that link before, but all I get is "ErrorYou are not authorized to view this protected entry."
xenosyde
Oops, I failed to notice that was a members-only post. If you're developing a program that interacts with LJ, it's definitely worth joining the lj_dev community so you can see those members-only posts. I've added the XML to my answer above.
Isaac
Thank you so much!
xenosyde