GET /api/v1/tasks
List of tasks

Examples

GET /foundry-api/v1/tasks
200
{
  "data": [
    {
      "id": "108",
      "type": "tasks",
      "links": {
        "self": "http://test.host/foundry-api/v1/tasks/108"
      },
      "attributes": {
        "title": "My Task",
        "description": null,
        "status": "pending",
        "due-date": "2017-09-05",
        "created-at": "2017-08-29T10:43:47.997+08:00",
        "updated-at": "2017-08-29T10:43:47.997+08:00"
      },
      "relationships": {
        "assignee": {
          "links": {
            "self": "http://test.host/foundry-api/v1/tasks/108/relationships/assignee",
            "related": "http://test.host/foundry-api/v1/tasks/108/assignee"
          }
        },
        "assigner": {
          "links": {
            "self": "http://test.host/foundry-api/v1/tasks/108/relationships/assigner",
            "related": "http://test.host/foundry-api/v1/tasks/108/assigner"
          }
        },
        "taggable": {
          "links": {
            "self": "http://test.host/foundry-api/v1/tasks/108/relationships/taggable",
            "related": "http://test.host/foundry-api/v1/tasks/108/taggable"
          }
        },
        "comment-threads": {
          "links": {
            "self": "http://test.host/foundry-api/v1/tasks/108/relationships/comment-threads",
            "related": "http://test.host/foundry-api/v1/tasks/108/comment-threads"
          }
        },
        "followers": {
          "links": {
            "self": "http://test.host/foundry-api/v1/tasks/108/relationships/followers",
            "related": "http://test.host/foundry-api/v1/tasks/108/followers"
          }
        }
      }
    }
  ],
  "meta": {
    "total-pages": 1,
    "record-count": 1
  },
  "links": {
    "first": "http://test.host/foundry-api/v1/tasks?page%5Bnumber%5D=1&page%5Bsize%5D=10",
    "last": "http://test.host/foundry-api/v1/tasks?page%5Bnumber%5D=1&page%5Bsize%5D=10"
  }
}

GET /api/v1/tasks/:id
Show a task

Examples

GET /foundry-api/v1/tasks/22
400
{
  "errors": [
    {
      "title": "No authorization provided."
    }
  ]
}

Params

Param name Description
id
required

Task ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.


POST /api/v1/tasks
Create a task

Examples

POST /foundry-api/v1/tasks
{
  "data": {
    "type": "tasks",
    "attributes": {
      "title": "My Task",
      "description": null,
      "status": "pending",
      "due-date": "2017-09-05",
      "created-at": null,
      "updated-at": null
    },
    "relationships": {
      "assignee": {
        "data": {
          "type": "accounts",
          "id": "137"
        }
      },
      "taggable": {
        "data": {
          "type": "companies",
          "id": "170"
        }
      }
    }
  }
}
201
{
  "data": {
    "id": "23",
    "type": "tasks",
    "links": {
      "self": "http://test.host/foundry-api/v1/tasks/23"
    },
    "attributes": {
      "title": "My Task",
      "description": null,
      "status": "pending",
      "due-date": "2017-09-05",
      "created-at": "2017-08-29T10:43:05.858+08:00",
      "updated-at": "2017-08-29T10:43:05.858+08:00"
    },
    "relationships": {
      "assignee": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/23/relationships/assignee",
          "related": "http://test.host/foundry-api/v1/tasks/23/assignee"
        }
      },
      "assigner": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/23/relationships/assigner",
          "related": "http://test.host/foundry-api/v1/tasks/23/assigner"
        }
      },
      "taggable": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/23/relationships/taggable",
          "related": "http://test.host/foundry-api/v1/tasks/23/taggable"
        }
      },
      "comment-threads": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/23/relationships/comment-threads",
          "related": "http://test.host/foundry-api/v1/tasks/23/comment-threads"
        }
      },
      "followers": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/23/relationships/followers",
          "related": "http://test.host/foundry-api/v1/tasks/23/followers"
        }
      }
    }
  }
}

PATCH /api/v1/tasks/:id
Update a task

Examples

PATCH /foundry-api/v1/tasks/53
{
  "data": {
    "id": "53",
    "type": "tasks",
    "attributes": {
      "title": "My Task",
      "description": null,
      "status": "rejected",
      "due-date": "2017-09-05",
      "created-at": "2017-08-29 10:43:26 +0800",
      "updated-at": "2017-08-29 10:43:26 +0800"
    }
  }
}
200
{
  "data": {
    "id": "53",
    "type": "tasks",
    "links": {
      "self": "http://test.host/foundry-api/v1/tasks/53"
    },
    "attributes": {
      "title": "My Task",
      "description": null,
      "status": "rejected",
      "due-date": "2017-09-05",
      "created-at": "2017-08-29T10:43:26.100+08:00",
      "updated-at": "2017-08-29T10:43:26.449+08:00"
    },
    "relationships": {
      "assignee": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/53/relationships/assignee",
          "related": "http://test.host/foundry-api/v1/tasks/53/assignee"
        }
      },
      "assigner": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/53/relationships/assigner",
          "related": "http://test.host/foundry-api/v1/tasks/53/assigner"
        }
      },
      "taggable": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/53/relationships/taggable",
          "related": "http://test.host/foundry-api/v1/tasks/53/taggable"
        }
      },
      "comment-threads": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/53/relationships/comment-threads",
          "related": "http://test.host/foundry-api/v1/tasks/53/comment-threads"
        }
      },
      "followers": {
        "links": {
          "self": "http://test.host/foundry-api/v1/tasks/53/relationships/followers",
          "related": "http://test.host/foundry-api/v1/tasks/53/followers"
        }
      }
    }
  }
}

Params

Param name Description
id
required

Task ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.


DELETE /api/v1/tasks/:id
Delete a task

Examples

DELETE /foundry-api/v1/tasks/45
401
{
  "errors": [
    {
      "title": "You are not authorized to access this request"
    }
  ]
}

Params

Param name Description
id
required

Task ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.