developers API Documentation

Users can add Comments to Activities (historically called Notes).


Comment Attributes

Name Type Default val Example Writable? Description
created_at datetime 2012/02/07 15:26:10 -0500 no Timestamp for when comment was created
user_id integer 1234 yes The owner of the comment
id integer auto-incremented 1234 no The unique id of the comment
user object { id: 2, last_name: "Honey", first_name: "Pablo", avatar_thumb_url: "https://s3.amazonaws.com/pipelinedeals/avatars/2/thumb/pablo.png" } no A convenient, simple representation of the comment's owner
comment string "F1rst!!1!" yes The content of the comment
updated_at datetime 2012/02/07 15:26:10 -0500 yes Timestamp for when comment was last updated
note_id integer 127 yes The note id of the comment
edited_by_person_id integer 2 yes The user id of the last person to edit the note; must be manually set when updating a comment.

Receive a list of comments

Comments are attached to notes (called "activities" in the PipelineDeals UI). In order to get a list of comments, you must query the note by id.

Request format

GET /notes/:note_id/comments.json

Optionally, you can leave in the company, deal, or company information associated to the note:

GET /companies/:association_id/notes/:note_id/comments.json
GET /deals/:association_id/notes/:note_id/comments.json
GET /people/:association_id/notes/:note_id/comments.json

These are provided to make it easier to construct URLs while exploring the API; the actual :association_id is ignored.

Request Parameters

Param Type Default Description
page integer 1 The offset of comments.
per_page integer 5 The number of comments per page.

Examples

curl "https://api.pipelinedeals.com/api/v3/notes/127/comments.json?api_key=abc1234"
HTTP Code
200
Body
{
  "entries": [
  {
    "created_at": "2013/05/20 15:27:39 -0400",
    "user_id": 2,
    "id": 3,
    "user": {
      "id": 2,
      "last_name": "Honey",
      "first_name": "Pablo",
      "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/2/thumb/pablo.png"
    },
    "comment": "Y'all're cray cray",
    "updated_at": "2013/05/20 15:27:39 -0400",
    "note_id": 127,
    "edited_by_user_id": null
  },
  {
    "created_at": "2013/05/20 15:03:32 -0400",
    "user_id": 3,
    "id": 2,
    "user": {
      "id": 3,
      "last_name": "Lee",
      "first_name": "Harper",
      "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/3/thumb/lee.png"
    },
    "comment": "less biased commentary",
    "updated_at": "2013/05/20 16:12:08 -0400",
    "note_id": 127,
    "edited_by_user_id": null
  },
  {
    "created_at": "2013/05/20 14:30:38 -0400",
    "user_id": 1,
    "id": 1,
    "user": {
      "id": 1,
      "last_name": "hoboson",
      "first_name": "hobo",
      "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/1/thumb/hobo.png"
    },
    "comment": "E plurbis unum carpe diem a ha haha hah.",
    "updated_at": "2013/05/20 14:30:38 -0400",
    "note_id": 127,
    "edited_by_user_id": null
  }
  ],
  "pagination": {
    "total": 3,
    "page": 1,
    "page_var": "page",
    "per_page": 200,
    "pages": 1
  }
}

Create a comment

Request format

POST /notes/:note_id/comments.json

Examples

curl -X POST -d "comment[comment]=Here's my outrageous commentary" \
  "https://api.pipelinedeals.com/api/v3/notes/127/comments.json?api_key=abc1234"
HTTP Code
200
Body
{
  "updated_at":"2013/05/20 15:36:43 -0400",
  "note_id":127,
  "created_at":"2013/05/20 15:36:43 -0400",
  "user":{
    "id":2
    "first_name":"Pablo",
    "last_name":"Honey",
    "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/2/thumb/newavatar.png"
  },
  "id":4,
  "comment":"Here's my outrageous commentary",
  "user_id":2,
  "edited_by_user_id":null
}

Failure Response

HTTP Code
422
Body
[
  {
    "field":"comment",
    "humanized_field":"Comment",
    "msg":"can't be blank"
  }
]

Retrieve a comment

Request format

GET /notes/:note_id/comments/:id.json

Examples

curl "https://api.pipelinedeals.com/api/v3/notes/127/comments/2?api_key=abc1234"
HTTP Code
200
Body
{
  "updated_at": "2013/05/20 15:03:32 -0400",
  "note_id": 127,
  "created_at": "2013/05/20 15:03:32 -0400",
  "user": {
    "id": 3,
    "first_name": "Harper",
    "last_name": "Lee",
    "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/3/thumb/lee.png"
  },
  "id": 2,
  "comment": "Here's my outrageous commentary",
  "user_id": 3,
  "edited_by_user_id": null
}

Update a comment

Request format

PUT /notes/:note_id/comments/:id.json

Examples

curl -X PUT -d "comment[comment]=less biased commentary" \
          "https://api.pipelinedeals.com/api/v3/notes/127/comments/2.json?api_key=abc1234"
HTTP Code
200
Body
{
  "updated_at": "2013/05/20 16:12:08 -0400",
  "note_id": 127,
  "created_at": "2013/05/20 15:03:32 -0400",
  "user": {
    "id": 3
    "first_name": "Harper",
    "last_name": "Lee",
    "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/3/thumb/lee.png"
  },
  "id": 2,
  "comment": "less biased commentary",
  "user_id": 3,
  "edited_by_user_id": null
}

Failure Response

HTTP Code
422
Body
[
  {
    "field":"comment",
    "humanized_field":"Comment",
    "msg":"can't be blank"
  }
]

Delete a comment

Request format

DELETE /notes/:note_id/comments/:id.json

Examples

curl -f -w "%{http_code}\n" -X DELETE \
  "https://api.pipelinedeals.com/api/v3/notes/127/comments/3.json?api_key=abc1234"
HTTP Code
200
Body
empty

Failure Response

HTTP Code
404
Body
empty