October 10, 2009

Memiary API

After having spent a year ignoring “When will the Memiary API be published?” requests, I decided to do something about it today. Anyone can now build an app that talks to Memiary. To request a unique developer key which is needed with every request, drop me a line!

Also, you may find this page useful to test/debug.

1) GetUser
http://www.memiary.com/api/getuser/

Needs variables: key, username, password

If user doesn’t exist, creates account and shows “signedup”:
<memiary>
<status>true</status>
<action>signedup</action>
</memiary>

If user exists and credentials (username/password) are correct, shows “loggedin” indicator:
<memiary>
<status>true</status>
<action>loggedin</action>
</memiary>

(Standard to other requests too) If user exists and credentials are incorrect, shows “false” and “invalid info”:
<memiary>
<status>false</status>
<action>invalidinfo</action>
</memiary>

(Standard to other requests too) If not all fields are passed (i.e. username/password/key), shows “fieldsmissing”:
<memiary>
<status>false</status>
<action>fieldmissing</action>
</memiary>

(Standard to other requests too) If key is found to be invalid, shows “invalidkey”:
<memiary>
<status>false</status>
<action>invalidkey</action>
</memiary>

2) GetEntries
http://www.memiary.com/api/getentries/

Needs variables: key, username, password, lastUpdate (in format: 2008-11-10 10:08:38)

For default, i.e. first attempt, use “0000-00-00 00:00:00”. This will return ALL the entries for that user.

If no entries are found:
<memiary>
<status>false</status>
<action>fieldmissing</action>
</memiary>

If entries are found with a timestamp that is later than lastUpdate (<lastupdated> is the timestamp container in each entry just incase you find it useful, shows when it was lastupdated):
<memiary>
<servertime>2008-11-10 11:19:17</servertime>

<entry>
<date>2008-11-10</date>
<lastupdated>0000-00-00 00:00:00</lastupdated>
<one>BLAH1</one>
<two>BLAH2</two><two>
</two><three>BLAH3</three><three>
</three><four>BLAH4</four><four>
</four><five>BLAH5</five><five>
</five></entry>

<entry>
<date>2008-11-09</date>
<lastupdated>0000-00-00 00:00:00</lastupdated>
<one>BLAH1</one>
<two>BLAH2</two><two>
</two><three>BLAH3</three><three>
</three><four>BLAH4</four><four>
</four><five>BLAH5</five><five>
</five></entry>

</memiary>

3) SetEntries
http://www.memiary.com/api/setentries/

Needs variables: key, username, password, date (in format: 2008-11-10)
Optional variables: one, two, three, four, five (indicates each list item)

If entries are successfully updated (as long as the “needed” variables are supplied, this should be the case), shows:
<memiary>
<status>true</status>
<date>2008-11-11</date>
<action>entryupdated</action>
</memiary></lastupdated>