Sample Code using the RestClient class

If you want more control over what requests are sent to Remember The Milk, and you don't care about data binding and object models, you can use the RestClient class, which is just a thin wrapper around the REST requests:

RestClient client = new RestClient("your api key", "your shared secret");
client.AuthToken = GetAuthenticationToken(); //TODO: get authentication token

// Have fun!
foreach (RawList list in client.GetLists())
{
    Console.WriteLine(list.Name);
    foreach (RawList tmp in client.GetTasks(list.Id))
    {
        foreach (RawTaskSeries series in tmp.TaskSeries)
        {
            foreach (RawTask task in series.Tasks)
            {
                Console.WriteLine("   - {0}", task.Name);
            }
        }
    }
}


To use the RestClient, it is strongly recommended that you keep the Remember The Milk API methods reference page close by to understand what you get back.

Last edited Jul 2, 2008 at 7:55 AM by ludovic_chabant, version 2

Comments

No comments yet.