developers API Documentation

Notes are called "Activities" in the PipelineDeals UI, but for historic reasons are still called "Notes" in the api. Notes are attached to either a Deal,Person, or Company.


Note Attributes

Name Type Default val Example Writable? Description
id integer auto-incremented 1234 no The unique id of the note
deal_id integer 1234 yes The deal id of the note
person_id integer 1234 yes The person id of the note
company_id integer 1234 yes The company id of the note
comments object { "entries": [ ] } see Comments An embedded list of comments on the given note; also available by adding /comments before the .json in the URL for the given note.
title string Note title yes The note title, if any
user_id integer 1234 yes The owner of the note
user object {id: 1234, first_name: 'Bob', last_name: 'Smith', avatar_thumb_url: 'https://s3.amazonaws.com/pipelinedeals/avatars/1234/thumb/bob.png'} yes A convenience object to get the full name of the note owner
note_category_id integer 1234 yes The category of the note
content text This is the content yes The note content
created_at datetime 2012/02/07 15:26:10 -0500 yes Timestamp for when note was created
updated_at datetime 2012/02/07 15:26:10 -0500 yes Timestamp for when note was last updated
note_category object {id: 1234, name: 'Phone Call'} yes A convenience object to get the name of the note category
possible_notify_user_ids array [1,2,3,4,5] no The list of user_ids that can be added to notify_user_ids.
notify_user_ids array [1,2,3,4,5] yes These are the ids of the users who will receive emails when new comments are added to the given note/activity.
is_sent_message boolean null no Describes if an activity with Email category is a sent or received message. It can also have a value of `null` for other activity categories.
primary_association_id integer 1234 no The primary association model id of the note
primary_association_type string Deal no The primary association type name. Can be a Deal, Person or Company

Receive a list of notes

Notes are attached to companies, deals, or people. In order to get a list of notes you must query the assocation by id.

Request format

Deals

GET /notes.json?deal_id=1234

People

GET /notes.json?person_id=1234

Companies

GET /notes.json?company_id=1234

Combo time

GET /notes.json?company_id=1234&deal_id=1234

Request Parameters

Param Type Default Description
page integer 1 The offset of notes.
per_page integer 5 The number of notes per page.
search_id integer Search notes by previously saved filter with given search_id. Note: when you provide a search_id, all parameters except page and per_page will be ignored.
deal_id integer 5 Filter by a specific deal_id
person_id integer 5 Filter by a specific person_id
company_id integer 5 Filter by a specific company_id
conditions[activity_modified] datetime range Companies updated within the specified date range. See the docs about datetime range for more info.

Examples

curl "https://api.pipelinedeals.com/api/v3/notes.json?api_key=abc1234&deal_id=247"
HTTP Code
200
Body
{
  "entries": [
    {
      "company_id": 5,
      "note_category": {
        "name": "Phone Call",
        "id": 1
      },
      "deal_id": 2,
      "person_id": 4,
      "title": null,
      "user": {
        "id": 1,
        "first_name": "admin",
        "last_name": "nick",
        "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/1/thumb/newavatar.png"
      },
      "content": "test note",
      "note_category_id": 1,
      "user_id": 1,
      "created_at": "2012/02/14 18:49:09 -0500",
      "mime": null,
      "id": 1,
      "updated_at": "2012/02/14 18:49:09 -0500"
    },
    {
      "company_id": 5,
      "note_category": {
        "name": "Phone Call",
        "id": 1
      },
      "deal_id": 2,
      "person_id": 4,
      "title": null,
      "user": {
        "id": 1,
        "first_name": "admin",
        "last_name": "nick",
        "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/1/thumb/newavatar.png"
      },
      "content": "note test22",
      "note_category_id": 1,
      "user_id": 1,
      "created_at": "2012/02/14 18:49:00 -0500",
      "mime": null,
      "id": 2,
      "updated_at": "2012/05/25 11:36:37 -0400"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 2,
    "total": 31
  }
}

Create a note

Remember, you can POST your data in http-request or JSON format.

Request format

POST /notes.json

Examples

curl -X POST -d "note[content]=note all the things&note[deal_id]=1953002" \
  "https://api.pipelinedeals.com/api/v3/notes.json?api_key=abc1234"
HTTP Code
200
Body
{
  "user_id": 1,
  "company_id": 5,
  "title": null,
  "updated_at": "2012/05/25 11:36:37 -0400",
  "note_category": {
    "name": "Phone Call",
    "id": 1
  },
  "created_at": "2012/02/14 18:49:00 -0500",
  "deal_id": 2,
  "note_category_id": 1,
  "user": {
    "first_name": "admin",
    "last_name": "nick",
    "id": 1,
    "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/1/thumb/newavatar.png"
  },
  "person_id": 4,
  "id": 2,
  "content": "note test22"
}

Failure Response

HTTP Code
422
Body
{
    "errors": [
        {
            "field": "content", 
            "humanized_field": "Content", 
            "msg": "can't be blank"
        }
    ]
}

Retrieve a note

Request format

GET /notes/:id.json

Examples

curl "https://api.pipelinedeals.com/api/v3/notes/16675691.json?api_key=abc1234"
HTTP Code
200
Body
{
  "updated_at": "2013/05/20 06:27:34 -0700",
  "id": 27116928,
  "company_id": 15114195,
  "comments": {
    "pagination": {
      "total": 0,
      "per_page": 30,
      "page_var": "page",
      "pages": 1,
      "page": 1
    },
    "entries": [ ]
  },
  "company": {
    "id": 15114195,
    "name": "X-Men"
  },
  "note_category_id": 143472,
  "note_category": {
    "id": 143472,
    "name": "T-Shirt Sent"
  },
  "title": null,
  "content": "Logan tweeted me to tell me how much he loves his new T!",
  "deal": null,
  "deal_id": null,
  "user_id": 86948,
  "notify_user_ids": [
    4
  ],
  "person": {
    "id": 1009709343,
    "last_name": "Wolverine",
    "first_name": "Logan"
  },
  "created_at": "2013/05/20 06:27:34 -0700",
  "possible_notify_user_ids": [
    1, 2, 3, 4, 5
  ],
  "user": {
    "id": 4,
    "first_name": "Willie",
    "last_name": "Wonka",
    "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/4/thumb/willie-avatar.png"
  },
  "person_id": 1009709343
}

Update a note

Request format

PUT /notes/:id.json

Examples

curl -X PUT -d "note[content]=update the note" \
  "https://api.pipelinedeals.com/api/v3/notes/3.json?api_key=abc1234"
HTTP Code
200
Body
{
  "user_id": 1,
  "company_id": 5,
  "title": null,
  "updated_at": "2012/05/25 11:36:37 -0400",
  "note_category": {
    "name": "Phone Call",
    "id": 1
  },
  "created_at": "2012/02/14 18:49:00 -0500",
  "deal_id": 2,
  "note_category_id": 1,
  "user": {
    "id": 4,
    "first_name": "Admin",
    "last_name": "Nick",
    "avatar_thumb_url": "https://s3.amazonaws.com/pipelinedeals/avatars/4/thumb/nick-avatar.png"
    "id": 1
  },
  "person_id": 4,
  "id": 2,
  "content": "note test22"
}

Failure Response

HTTP Code
422
Body
{
    "errors": [
        {
            "field": "content", 
            "humanized_field": "Content", 
            "msg": "can't be blank"
        }
    ]
}

Delete a note

Request format

DELETE /notes/:id.json

Examples

curl -X DELETE "https://api.pipelinedeals.com/api/v3/notes/10.json?api_key=abc1234"
HTTP Code
200
Body
empty

Failure Response

HTTP Code
404
Body
empty