Entries

These endpoints allow you to retrieve and update notes and emails associated with your parties, cases and opportunities. You’ll also be able to use these endpoints to create new notes. For a full description of the model see the Entry model definition

List Entries

List notes, emails and completed tasks for parties, kases and opportunities. Which you choose is defined by the entity parameter inside the url which must be parties, opportunities or kases. entityId should be the id of a party, case or opportunity on the account.

GET
https://api.capsulecrm.com/api/v2/{entity}/{entityId}/entries

Query Parameters

Name Type Description
page Integer

The page of results to return. Default: 1

perPage Integer

Number of entities to return per page. Value must be between 1 and 100 Default: 50

embed Array of String

Can be used to specify extra entities to fully include in the result. If provided, should be a comma separated list of strings. Accepted values are party, kase, opportunity, creator.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property entries which is an array of entry objects. In the case of an invalid request, an error message will be returned, as described in the errors section.

HTTP/1.1 200
Link: <https://api.capsulecrm.com/api/v2/entries?page=2>; rel="next"
{
  "entries" : [ {
    "id" : 12,
    "type" : "task",
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "test",
    "entryAt" : "2015-12-07T16:54:27Z",
    "kase" : null,
    "opportunity" : null,
    "party" : {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    }
  }, {
    "id" : 11,
    "type" : "note",
    "attachments" : [ {
      "id" : 4,
      "filename" : "works of William Shakespeare.pdf",
      "contentType" : "application/pdf",
      "size" : 5557452
    } ],
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "Shall I compare thee to a summer's day?",
    "entryAt" : "2015-12-07T16:54:27Z",
    "kase" : null,
    "opportunity" : null,
    "party" : {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    }
  }, {
    "id" : 10,
    "type" : "email",
    "attachments" : [ {
      "id" : 2,
      "filename" : "photo 1.JPG",
      "contentType" : "image/jpeg",
      "size" : 107307
    } ],
    "parties" : [ {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    } ],
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "subject" : "Fwd: Development Notes",
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
    "entryAt" : "2015-12-07T16:54:27Z",
    "participants" : [ {
      "id" : 43360750,
      "address" : "hello@zestia.com",
      "name" : "Hello",
      "role" : "FROM"
    }, {
      "id" : 43360751,
      "address" : "support@capsulecrm.com",
      "name" : "Support",
      "role" : "TO"
    } ],
    "kase" : null,
    "opportunity" : null
  } ]
}

Headers:

Name Type Description
Link String

Links to the next and previous pages, encoded as defined in RFC 5988

List By Date

List notes, emails and the details of completed party tasks in descending order starting with the most recent entry date first.

GET
https://api.capsulecrm.com/api/v2/entries

Query Parameters

Name Type Description
page Integer

The page of results to return. Default: 1

perPage Integer

Number of entities to return per page. Value must be between 1 and 100 Default: 50

embed Array of String

Can be used to specify extra entities to fully include in the result. If provided, should be a comma separated list of strings. Accepted values are party, kase, opportunity, creator.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property entries which is an array of entry objects. In the case of an invalid request, an error message will be returned, as described in the errors section.

HTTP/1.1 200
Link: <https://api.capsulecrm.com/api/v2/entries?page=2>; rel="next"
{
  "entries" : [ {
    "id" : 12,
    "type" : "task",
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "test",
    "entryAt" : "2015-12-07T16:54:27Z",
    "kase" : null,
    "opportunity" : null,
    "party" : {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    }
  }, {
    "id" : 11,
    "type" : "note",
    "attachments" : [ {
      "id" : 4,
      "filename" : "works of William Shakespeare.pdf",
      "contentType" : "application/pdf",
      "size" : 5557452
    } ],
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "Shall I compare thee to a summer's day?",
    "entryAt" : "2015-12-07T16:54:27Z",
    "kase" : null,
    "opportunity" : null,
    "party" : {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    }
  }, {
    "id" : 10,
    "type" : "email",
    "attachments" : [ {
      "id" : 2,
      "filename" : "photo 1.JPG",
      "contentType" : "image/jpeg",
      "size" : 107307
    } ],
    "parties" : [ {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    } ],
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "subject" : "Fwd: Development Notes",
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
    "entryAt" : "2015-12-07T16:54:27Z",
    "participants" : [ {
      "id" : 43360750,
      "address" : "hello@zestia.com",
      "name" : "Hello",
      "role" : "FROM"
    }, {
      "id" : 43360751,
      "address" : "support@capsulecrm.com",
      "name" : "Support",
      "role" : "TO"
    } ],
    "kase" : null,
    "opportunity" : null
  } ]
}

Headers:

Name Type Description
Link String

Links to the next and previous pages, encoded as defined in RFC 5988

Show entry

Show a specified note, email or the details of a completed party task.

GET
https://api.capsulecrm.com/api/v2/entries/{id}

Query Parameters

Name Type Description
embed Array of String

Can be used to specify extra entities to fully include in the result. If provided, should be a comma separated list of strings. Accepted values are party, kase, opportunity, creator.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property entry which will contain a Entry object.

HTTP/1.1 200
{
  "entry" : {
    "id" : 101,
    "type" : "note",
    "attachments" : [ ],
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "The quick brown fox\njumped over the lazy dog",
    "entryAt" : "2015-12-07T16:54:27Z",
    "kase" : null,
    "opportunity" : null,
    "party" : {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    }
  }
}

Create Entry

Creates a new entry. The body must contain an object with a single property entry which must be a Entry object. The note needs to be created for a party, case or opportunity so exactly one of these need to be included it the body of the post.

This endpoint can only be used for creating notes; the type parameter must be set in the body of the request but currently the only accepted option is note.

POST
https://api.capsulecrm.com/api/v2/entries
          {
  "entry" : {
    "party" : {
      "id" : 892
    },
    "type" : "note",
    "content" : "The quick brown fox\njumped over the lazy dog"
  }
}
        

Response

Returns HTTP status code 201. The body of the response will contain the entry as it was stored in Capsule.

HTTP/1.1 201
Location: https://api.capsulecrm.com/api/v2/entries/101
{
  "entry" : {
    "id" : 101,
    "type" : "note",
    "attachments" : [ ],
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "The quick brown fox\njumped over the lazy dog",
    "entryAt" : "2015-12-07T16:54:27Z",
    "kase" : null,
    "opportunity" : null,
    "party" : {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    }
  }
}

Headers:

Name Type Description
Location String

The URL that identifies the new party

Update Entry

Update the content of notes and emails. The body must contain an object with a single property entry which must be a Entry object. This endpoint can only applied to entries of type email or note.

PUT
https://api.capsulecrm.com/api/v2/entries/{id}
          {
  "entry" : {
    "content" : "The quick brown fox\njumped over the lazy dog"
  }
}
        

Response

Returns HTTP status code 200. The body of the response will contain the entry as it was stored in Capsule.

HTTP/1.1 200
{
  "entry" : {
    "id" : 101,
    "type" : "note",
    "attachments" : [ ],
    "creator" : {
      "id" : 61,
      "username" : "ted",
      "name" : "Ted Danson"
    },
    "createdAt" : "2015-12-07T16:54:27Z",
    "updatedAt" : "2015-12-07T16:54:27Z",
    "content" : "The quick brown fox\njumped over the lazy dog",
    "entryAt" : "2015-12-07T16:54:27Z",
    "kase" : null,
    "opportunity" : null,
    "party" : {
      "id" : 892,
      "type" : "organisation",
      "name" : "Zestia",
      "pictureURL" : "http://assets0.zestia.biz:8080/theme/default/images/org_avatar_70.png"
    }
  }
}

Delete Entry

Removes a entry from the capsule account and any associated attachments.

DELETE
https://api.capsulecrm.com/api/v2/entries/{id}

Response

Returns HTTP status code 204. Returns status code 204 with an empty body if the party was successfully deleted. In some cases Capsule might schedule the deletion for later and return HTTP status 202 Accepted as defined in Long Running Operation section.

HTTP/1.1 204