Todos

Fetch all todos for a lead


Return all the todos for a specified lead
GET /leads/:lead_id/todos
lead_id Unique identifier of the lead Required
page Page number of todos to return. Returns empty array if the page has no todos. If page parameter isn't present, returns the first page Optional
size Number of todos to return in a page. If size parameter isn't present, returns the page with 25 todos Optional
Response Body
[
    {
        "_id": "521f26edcce8b4310e000080",
        "name": "Email general contract",
        "type": "Email",
        "date": "2013-08-26",
        "time": null,
        "done": false
    },
    {
        "_id": "521f26edcce8b4310e000081",
        "name": "Call and discuss general contract",
        "type": "Call",
        "date": "2013-08-28",
        "time": "10:00 AM",
        "done": true
    }
]

Show a todo


Show details of an individual todo for a specified lead
GET /leads/:lead_id/todos/:todo_id
lead_id Unique identifier of the lead Required
todo_id Unique identifier of the todo Required
Response Body
{
    "_id": "521f26edcce8b4310e000080",
    "name": "Email general contract",
    "type": "Email",
    "date": "2013-08-26",
    "time": null,
    "done": false
}

Create a todo


Create a new todo for a specified lead
POST /leads/:lead_id/todos
lead_id Unique identifier of the lead Required
name Name of the todo Required
type Type of the todo (Email | Call | Meetup | Task | Other) Required
date Due date of the todo (format - YYYY-MM-DD) Optional
time Due time of the todo (format - h:MM [AM|PM] e.g. 5:00 PM, 10:00 AM) Optional
Response Body
{
    "_id": "521f26edcce8b4310e000080",
    "name": "Email general contract",
    "type": "Email",
    "date": "2013-08-26",
    "time": null,
    "done": false
}

Update a todo


Update the value of a todo for a specified lead
PUT /leads/:lead_id/todos/:todo_id
lead_id Unique identifier of the lead Required
todo_id Unique identifier of the todo Required
name Name of the todo Optional
type Type of the todo (Email | Call | Meetup | Task | Other) Optional
date Due date of the todo (format - YYYY-MM-DD) Optional
time Due time of the todo (format - h:MM [AM|PM] e.g. 5:00 PM, 10:00 AM) Optional
Response Body
{
    "_id": "521f26edcce8b4310e000080",
    "name": "Email general contract",
    "type": "Email",
    "date": "2013-08-26",
    "time": null,
    "done": false
}

Delete a todo


Delete a todo
DELETE /leads/:lead_id/todos/:todo_id
lead_id Unique identifier of the lead Required
todo_id Unique identifier of the todo Required
Response Body
{}