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);