Developer's API Documentation : Account Info
Account Information
The first thing you should do each time you sync with Toodledo is to request the user's account information. This is done via a GET or POST request to the "get.php" API endpoint. This will give you useful information about the user, including various timestamps that you can use to determine if any further action is necessary. If the timestamps havne changed, then the user's account hasn't changed and you do not need to sync antything.
http://api.toodledo.com/2/account/get.php?key=a1b2c3d4e5f6a1b2c3d4e5f6
If the lookup was successful a userid will be returned.
JSON: {"userid":"a1b2c3d4e5f6","alias":"John","pro":"0","dateformat":"0","timezone":"-6", "hidemonths":"2","hotlistpriority":"3","hotlistduedate":"2","showtabnums":"1", "lastedit_folder":"1281457337","lastedit_context":"1281457997","lastedit_goal":"1280441959", "lastedit_location":"1280441959","lastedit_task":"1281458832","lastdelete_task":"1280898329", "lastedit_notebook":"1280894728","lastdelete_notebook":"1280898329"}
You can also specify xml as the output format for any API calls.
http://api.toodledo.com/2/account/get.php?key=a1b2c3d4e5f6a1b2c3d4e5f6;f=xml
XML: <account> <userid>a1b2c3d4e5f6</userid> <alias>John</alias> <pro>0</pro> <dateformat>0</dateformat> <timezone>-6</timezone> <hidemonths>2</hidemonths> <hotlistpriority>3</hotlistpriority> <hotlistduedate>2</hotlistduedate> <showtabnums>1</showtabnums> <lastedit_folder>1281457337</lastedit_folder> <lastedit_context>1281457997</lastedit_context> <lastedit_goal>1280441959</lastedit_goal> <lastedit_location>1280441959</lastedit_location> <lastedit_task>1281458832</lastedit_task> <lastdelete_task>1280898329</lastdelete_task> <lastedit_notebook>1280894728</lastedit_notebook> <lastdelete_notebook>1280894728</lastdelete_notebook> </account>
The values returned have the following definitions:
- pro : Whether or not the user is a Silver or Gold Subscriber. You need to know this if you want to use subtasks. A value of 0 means a free account. 1 means Silver and 2 means Gold.
- dateformat : The user's prefered format for representing dates. (0=M D, Y, 1=M/D/Y, 2=D/M/Y, 3=Y-M-D)
- timezone : The number of half hours that the user's timezone is offset from the server's timezone. A value of -4 means that the user's timezone is 2 hours earlier than the server's timezone.
- hidemonths : If the task is due this many months into the future, the user wants them to be hidden.
- hotlistpriority : The priority value above which tasks should appear on the hotlist.
- hotlistduedate : The due date lead-time by which tasks should will appear on the hotlist.
- hotliststar : 0 or 1 if the star contributes to the hotlist.
- hotliststatus : 0 or 1 if the status contributes to the hotlist.
- showtabnums : The user's preference for viewing counters showing the number of tasks in each section.
- lastedit_task : A timestamp that indicates the last time that any task was added or edited on this account. You can quickly check this field to determine if you need to download updates.
- lastdelete_task : A timestamp that indicates the last time that any task was deleted from this account. You can quickly check this field to determine if you need to identify and remove tasks from your application.
- lastedit_folder : A timestamp that indicates the last time that a folder was added, edited or deleted. You can quickly check this field to determine if you need to refresh your cached folder list.
- lastedit_context : A timestamp that indicates the last time that a context was added, edited or deleted. You can quickly check this field to determine if you need to refresh your cached context list.
- lastedit_goal : A timestamp that indicates the last time that a goal was added, edited or deleted. You can quickly check this field to determine if you need to refresh your cached goal list.
- lastedit_location : A timestamp that indicates the last time that a location was added, edited or deleted. You can quickly check this field to determine if you need to refresh your cached location list.
- lastedit_notebook : A timestamp that indicates the last time that any notebook was added or edited on this account. You can quickly check this field to determine if you need to download updates.
- lastdelete_notebook : A timestamp that indicates the last time that any notebook was deleted from this account. You can quickly check this field to determine if you need to identify and remove notebooks from your application.
Error Codes
Any of the API calls can return error messages. Here is a list of the error messages that you may receive from the account API.
- 1 : You did not specify a key for authentication.
- 2 : The authentication key that you provided has expired or is invalid.
- 100 : Unknown Error.
- 500 : The Toodledo server is offline for maintenance.
Examples:
JSON: {"errorCode":1,"errorDesc":"Empty key"}
XML: <error id="1">Empty key</error>