Deprecation warning - version 1 of the Capsule API will not be available after October 27, 2017. Developers should use version 2 when developing their applications. Developers who have already built applications please check our migration guide on how to move your applications to the latest version.

Show Task

Retrieve the details of a specified task:

GET /api/task/:task-id

Response

  • partyId and partyName - included on tasks created for a party
  • opportunityId and opportunityName - included on tasks created for a opportunity
  • caseId and caseName - included on tasks created for a case
  • dueDate included where the task has no due time during the day
  • dueDateTime included where the task is due at a specific time
  • completedOn date included for completed tasks
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<task>
  <id>100</id>
  <description>Meet with customer</description>
  <detail>Meeting at Coffee shop</detail>
  <category>Meeting</category>
  <dueDate>2012-02-24T00:00:00Z</dueDate>
  <owner>a.user</owner>
  <partyId>1</partyId>
  <partyName>Eric Jones</partyName>
  <status>OPEN</status>
  <createdOn>2015-11-30T10:15:10Z</createdOn>
  <updatedOn>2015-11-30T10:29:14Z</updatedOn>
</task>{
  "task": {
    "id": "100",
    "description": "Meet with customer",
    "detail": "Meeting at Coffee shop",
    "category": "Meeting",
    "dueDate": "2012-02-24T00:00:00Z",
    "owner": "a.user",
    "partyId": "1",
    "partyName": "Eric Jones",
    "status": "OPEN",
    "createdOn": "2015-11-30T10:15:10Z",
    "updatedOn": "2015-11-30T10:29:14Z"
  }
}

Show as JSONShow as XML

List Tasks

The collection of tasks:

GET /api/tasks

The collection of tasks can be filtered using one of the following filters on the URL:

  • ?category= retrieve only tasks in selected category - URL encoded
  • ?user= retrieve only tasks assigned to selected username - URL encoded
  • ?status= retrieve only tasks in selected status. Valid values are OPEN and COMPLETED. If not supplied then open tasks will be retrieved. Note that if set to COMPLETED maximum limit is 1000

The results can also be paginated using the following options:

  • &start= first record to be returned. The results start with an index of 0.
  • &limit= the maximum number of matching records to be returned

Response

HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<tasks>
  <task>...</task>
  <task>...</task>
</tasks>{
  "tasks": {
    "task": [
      "...",
      "..."
    ]
  }
}

Show as JSONShow as XML

Add a Task

Add a task:

POST /api/task

Or to add the task to a party, opportunity or case:

POST /api/party/:party-id/task
POST /api/opportunity/:opportunity-id/task
POST /api/kase/:case-id/task

Request

  • description - task description
  • category optional task category
  • dueDate or dueDateTime required date or date time the tasks is due
  • detail optional, more details for the task
  • owner optional, if not supplied the authenticated user will be used; see users for available options
  • status - task status, either OPEN or COMPLETED. If not supplied default of OPEN is used
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<task>
  <description>Call customer</description>
  <dueDateTime>2012-04-21T15:00:00Z</dueDateTime>
</task>{
  "task": {
    "description": "Call customer",
    "dueDateTime": "2012-04-21T15:00:00Z"
  }
}

Show as JSONShow as XML

Response

HTTP/1.1 201 Created
Location: https://sample.capsulecrm.com/api/task/59

Update a Task

Update a specific task. Only the elements that are being changed need to be supplied; elements not included remain unchanged. You can complete (or reopen a previously completed tasks) by including a status element setting the task as OPEN or COMPLETED in your JSON or XML instead of using the POST /api/task/:id/complete or POST /api/task/:id/reopen API endpoints. When completing a task you can optionally supply a completedOn element to override the completion date.

PUT /api/task/:task-id

Request

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<task>
  <description>Update time sheets</description>
  <dueDateTime>2012-04-21T15:00:00Z</dueDateTime>
</task>{
  "task": {
    "description": "Update time sheets",
    "dueDateTime": "2012-04-21T15:00:00Z"
  }
}

Show as JSONShow as XML

Response

HTTP/1.1 200 OK

Delete Task

Delete a specific task:

DELETE /api/task/:task-id

Response

HTTP/1.1 200 OK

Complete a task

Complete a task. This can also be performed by using the Update a Task endpoint and setting the status.

POST /api/task/:task-id/complete

Response

HTTP/1.1 200 OK

Re-Open a Task

Reopen a previously completed task. This can also be performed by using the Update a Task endpoint and setting the status.

POST /api/task/:task-id/reopen"

Response

HTTP/1.1 200 OK

List of Task Categories

List of task categories configured for the account:

GET /api/task/categories

Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<taskCategories>
  <taskCategory>Call</taskCategory>
  <taskCategory>Email</taskCategory>
  <taskCategory>Follow-up</taskCategory>
  <taskCategory>Meeting</taskCategory>
  <taskCategory>Milestone</taskCategory>
  <taskCategory>Send</taskCategory>
</taskCategories>{
  "taskCategories": {
    "taskCategory": [
      "Call",
      "Email",
      "Follow-up",
      "Meeting",
      "Milestone",
      "Send"
    ]
  }
}

Show as JSONShow as XML