API

    Mock Server

    Use this URL to access a mockup of the API server. Your traffic will be recorded and compared to the documentation. You'll find your traffic analysis in the inspector or directly here in the documentation, right next to each resource.

GTD TODO API

This is an example API, written as a companion to a blog post at SendGrid.com

Folder

A single Folder object, it represents a single folder.

Required attributes:

  • id Automatically assigned
  • name
  • description

Optional attributes: - parent ID of folder that is the parent. Set to 0 if no parent - meta A catch-all attribute to add custom features

Retrieve a single Folder

GET

/folder{id}

Parameters
Name Description Details
id

Unique folder ID in the form of an integer

int, required

Response

200 (OK)
Content-Type: application/json
{
    "id": 1,
    "name": "Health",
    "description": "This represents projects that are related to health"
    "parent": 0,
    "meta": "NULL"
}

Response

404 (Not Found)
Content-Type: application/json
{ 
    "error": "Resource not found" 
}

Edit a Folder

PATCH

/folder{id}

Parameters
Name Description Details
id

Unique folder ID in the form of an integer

int, required

Response

200 (OK)
Content-Type: application/hal+json
{
    "id": 1,
    "name": "Health",
    "description": "This represents projects that are related to health"
    "parent": 0,
    "meta": "NULL"
}

Response

404 (Not Found)
{ 
    "error": "Resource not found"
}

Response

400 (Bad Request)
{ 
    "error": "Resource modification failed"
}

Delete a Folder

DELETE

/folder{id}

Parameters
Name Description Details
id

Unique folder ID in the form of an integer

int, required

Response

200 (OK)
{ 
    "result": True
}

Create a Folder

POST

/folder{id}

Parameters
Name Description Details
id

Unique folder ID in the form of an integer

int, required

Response

201 (Created)
Content-Type: application/hal+json
{
    "id": 1,
    "name": "Health",
    "description": "This represents projects that are related to health"
    "parent": 0,
    "meta": "NULL"
}

Response

400 (Bad Request)
{ 
    "error": "Resource modification failed"
}

Folder Collection

Get all of the Folders.

List all Folders

GET

/folder

Response

200 (OK)
Content-Type: application/hal+json
{
    "folders": [
        {
            "id": 1,
            "name": "Health",
            "description": "This represents projects that are related to health"
            "parent": 0,
            "meta": "NULL"
        },
        {
            "id": 2,
            "name": "Diet",
            "description": "A collection of projects related to Diet",
            "parent": 1,
            "meta": "NULL"
        }
    ]
}