easiness: (Default)
Easy ([personal profile] easiness) wrote in [site community profile] dw_dev2019-01-16 09:10 am
Entry tags:

XML-RPC API Questions

Hi everybody!

I have a few questions regarding the XML-RPC API and I was wondering if someone would be so nice to answer them :)

  • Checking the code I discovered that there's a restriction for the method addcomment in the API (here) that prevents non-paid accounts to use this method. I was wondering why this restriction exists because posting entries (through postevent method) is completely fine for non-paid accounts.

  • In the documentation the method getevents has the property usejournal to request entries from other journals but so far I'm only able to see entries from my own journal. Friends' journals or community journals return the error Don't have access to requested journal (here). Am I missing something? shouldn't I be able to retrieve those entries if I have the permissions to see them?

  • When retrieving entries from my journal using the method getevents, there's barely no information about the comments, only in the props property there's a subproperty called commentalter with a number which I don't know what is for. How do I get information about the comments of an entry?

  • Related to the comments, if I manage to get the ids, how do I retrieve the body? can I do it with getevents method?

  • About the getinbox method, I get some ids but no content at all. How do I get the body of those messages using those ids?

  • The documentation says that sessiongenerate is used to access web based parts of the site but it only mention comment exporter. Which other web based parts exist?

pauamma: Cartooney crab holding drink (Default)

[personal profile] pauamma 2019-02-09 11:27 pm (UTC)(link)
Re addcomment, it looks like every place that calls it through LJ::Protocol::do_request sets nocheckcap => 1 in the request flags, thus cancelling the restriction. I'm not sure why this is done in that non-intuitive way, though.
pauamma: Cartooney crab holding drink (Default)

[personal profile] pauamma 2019-02-10 11:17 pm (UTC)(link)
OK, I had another look and it looks like there's no way to specify flags through the actual XMLRPC interface, hence no way around that restriction. This is weird and may be a bug. So I see 3 possible ways around your problem:
1- Find out how other XMLRPC DW or LJ clients do it.
2- File a github issue about it.
3- Since (I understand) the XMLRPC interface is not really maintained due to the new DW API in development, look into using that for your client.
pauamma: Cartooney crab holding drink (Default)

[personal profile] pauamma 2019-02-17 12:49 am (UTC)(link)
Re getevents with usejournal, it looks like that journal needs to be a community you're a member or admin of, or a community with posting open to non-members. Is that the case for the community/ies you're trying to getevents for?