<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2009-04-10:30813</id>
  <title>Dreamwidth Development Training</title>
  <subtitle>Dreamwidth Development Training</subtitle>
  <author>
    <name>Dreamwidth Development Training</name>
  </author>
  <link rel="alternate" type="text/html" href="https://dw-dev-training.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://dw-dev-training.dreamwidth.org/data/atom"/>
  <updated>2016-12-24T02:46:59Z</updated>
  <dw:journal username="dw_dev_training" type="community"/>
  <entry>
    <id>tag:dreamwidth.org,2009-04-10:30813:65408</id>
    <author>
      <name>Ари Линн</name>
    </author>
    <dw:poster user="ari_linn"/>
    <link rel="alternate" type="text/html" href="https://dw-dev-training.dreamwidth.org/65408.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev-training.dreamwidth.org/data/atom/?itemid=65408"/>
    <title>How to get comments through the API?</title>
    <published>2016-12-24T02:46:59Z</published>
    <updated>2016-12-24T02:46:59Z</updated>
    <category term="comments"/>
    <category term="api"/>
    <dw:mood>aggravated</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>1</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='ari_linn' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://ari-linn.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://ari-linn.dreamwidth.org/'&gt;&lt;b&gt;ari_linn&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;How do I get post comments through the API? I can get posts with LJ.XMLRPC.getevents, and in the original LJ there's a method called LJ.XMLRPC.getcomments, but when I tried it on DW API, I got "Client error: Unknown method". Not nice.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev_training&amp;ditemid=65408" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-04-10:30813:58924</id>
    <author>
      <name>vlion</name>
    </author>
    <dw:poster user="vlion"/>
    <link rel="alternate" type="text/html" href="https://dw-dev-training.dreamwidth.org/58924.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev-training.dreamwidth.org/data/atom/?itemid=58924"/>
    <title>HOWTO: Dreamwidth API</title>
    <published>2014-11-18T06:02:46Z</published>
    <updated>2014-11-18T06:02:46Z</updated>
    <category term="api"/>
    <dw:security>public</dw:security>
    <dw:reply-count>4</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='vlion' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://vlion.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://vlion.dreamwidth.org/'&gt;&lt;b&gt;vlion&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;HOWTO Use the Dreamwidth API&lt;/h2&gt;

&lt;p&gt;DW endpoint: &lt;code&gt;"https://www.dreamwidth.org/interface/xmlrpc"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Invoke  &lt;code&gt;LJ.XMLRPC.getchallenge&lt;/code&gt; on the endpoint, receiving something like...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;"auth_scheme" :STRING "c0"
"server_time" :INTEGER &amp;lt;epoch time&amp;gt;
"challenge" :STRING "c0:1416283200:2410:60:4QoGWOXV0uB9gBaZ0LB0:5a1901a0feccabcb30fbe6e85878f758")
"expire_time" :INTEGER &amp;lt;epoch time&amp;gt;))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Pick &lt;code&gt;challenge&lt;/code&gt; out, &lt;code&gt;md5_hex&lt;/code&gt;[0] the &lt;code&gt;challenge&lt;/code&gt; concatenated with
the &lt;code&gt;md5_hex&lt;/code&gt; of the account password; call the result &lt;code&gt;response&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
response = md5(concat(challenge, md5(password)))
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, for &lt;code&gt;function&lt;/code&gt; in the API, invoke &lt;code&gt;LJ.RPC.function&lt;/code&gt; using &lt;code&gt;auth_method = challenge&lt;/code&gt; and
&lt;code&gt;auth_response = response&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Proceed as appropriate for said &lt;code&gt;function&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;[0] .. digest in hexadecimal form. The length of the returned string
will be 32 and it will only contain characters from this set:
&lt;code&gt;'0'..'9'&lt;/code&gt; and &lt;code&gt;'a'..'f'&lt;/code&gt;.&lt;/p&gt;
&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev_training&amp;ditemid=58924" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
