run_ambrose_run: (Default)
Ambrose ([personal profile] run_ambrose_run) wrote in [site community profile] dw_dev2011-01-13 04:44 pm
Entry tags:

Adding a comment to a community through the API

I opened this as a support request, but it looks like they don't know the answer. Hopefully, someone here does!

I'm trying to create a client that can add a comment to a community post using the XMLRPC addcomment method.

There is discussion about the method here: http://community.livejournal.com/lj_dev/824175.html

When I use it on LiveJournal, it works perfectly with free accounts, both in personal journals and communities. On Dreamwidth, it only works with a paid account and only when posting to one's own journal. If I try to send a comment to a community, I get this error:

No such entry. at /home/dw/current/cgi-bin/ljprotocol.pl line 223

Does anyone know how to resolve this or if Dreamwidth even allows the method to be used on communities?

**edited to add a PHP example**


$request = array();

$username = 'run_ambrose_run';
$pwd = '*******';
$subject = 'Subject of comment';

$this->xmlrpc->server('http://www.dreamwidth.org/interface/xmlrpc', 80);
$this->xmlrpc->method('LJ.XMLRPC.addcomment');

$request = array(array(array(

'username'=> array($username,'string'),
'password'=> array($pwd,'string'),
'ditemid' => array('80257','string'),
'parenttalkid' => array('0','string'),
'journal' => array('dw_dev','string'),
'body' => array('Hello World','string'),
'subject' => array($subject,'string'),

),'struct'));

$this->xmlrpc->request($request);


denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2011-01-14 12:15 am (UTC)(link)
We have done horrible, horrible things to the XML-RPC protocol. Horrible things. We tried to keep it backwards-compatable, and in most cases we could (not all, but most).

The addcomment method, though, isn't one that was supported in any existing client, so I don't think anyone's tested it since the last time we did protocol work. So we probably broke it and didn't notice. :)

Can you post your code? Someone who knows things better than I do should be able to tell if the problem's on our end (and fix it) or your end.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2011-01-14 01:39 am (UTC)(link)
Awesome. I hope someone will be able to help -- if necessary, will you be willing to help troubleshoot/investigate? The reason we haven't done a lot of work on making sure the protocol does stuff right is because we haven't had anybody really interested in client development -- we've done some work, but not a whole lot.
exor674: Text: "I survived Dreamwidth closed beta" (dreamwidth closed beta)

[personal profile] exor674 2011-01-18 11:50 am (UTC)(link)
From looking at the code on our end, we don't support ( or look at ) the journal parameter at all -- the feature was added after we forked from the LJ code a few years back.

I've filed a bug to add this feature at http://bugs.dwscoalition.org/show_bug.cgi?id=3412

You may watch that bug for any fixes, and [site community profile] dw_news or [site community profile] dw_maintenance once a fix is committed for our next code push when the code will be live on the site.

Sorry for the inconvenience,
Dre