developers API Documentation

Account Notification Attributes

Name Type Default val Example Writable? Description
id integer auto-incremented 1234 yes The unique id of the account notification
user_id integer 1234 yes The user_id of the account notification
account_id integer 1234 yes The account_id of the account notification
text text Awesome notification yes The content of the notification
read_at datetime 2015/09/07 15:26:10 -0500 yes Timestamp for when note was read
seen boolean true, false yes Boolean used to mark seen account notifications
created_at datetime 2015/09/07 15:26:10 -0500 yes Timestamp for when note was created
updated_at datetime 2015/09/07 15:26:10 -0500 yes Timestamp for when note was updated
hide_popup boolean false true, false no Used only for create, displays/hides popup for user when account notification is created

Receive a list of account notifications

Request format

GET /account_notifications.json

Request Parameters

Param Type Description
page integer The page offest.
per_page integer The number of calendar entries per page.
conditions[user_id] integer The account_notifications that are assigned to user_id

Examples

curl "https://api.pipelinedeals.com/api/v3/account_notifications.json?api_key=abc1234"
HTTP Code
200
Body
{
  "pagination": {
    "total": 50,
    "per_page": 30,
    "page": 1
  },
  "entries": [
    {
      "id": 5413,
      "user_id": 444,
      "account_id": 21,
      "read_at": "2015/09/07 10:57:04 -0400",
      "seen": true,
      "text": "awesome notification",
      "created_at": "2015/09/07 07:57:04 -0400",
      "updated_at": "2015/09/07 07:57:04 -0400"
    }
  ]
}

Retrieve a single account notification

Request format

GET /account_notifications/:id.json

Examples

curl "https://api.pipelinedeals.com/api/v3/account_notifications/4.json?api_key=abc1234"
HTTP Code
200
Body
{
  "id": 4,
  "user_id": 444,
  "account_id": 21,
  "read_at": "2015/09/07 10:57:04 -0400",
  "seen": true,
  "text": "awesome notification",
  "created_at": "2015/09/07 07:57:04 -0400",
  "updated_at": "2015/09/07 07:57:04 -0400"
}

Failure Response

HTTP Code
404
Body
{
  "error": "AccountNotification not found."
}

Create an account notification

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

Request format

You can only send 'user_id', 'text' and 'hide_popup' attributes for create.
Only 'text' is obligatory.
'user_id' can be omitted (it will be set to logged in user).
'hide_popup' can be omitted (it will be set to false).

POST /account_notifications.json

Examples

curl -X POST -d "account_notification[text]=awesome notification&account_notification[user_id]=444 \
  &account_notification[hide_popup]=false" \
  "https://api.pipelinedeals.com/api/v3/account_notifications.json?api_key=abc1234"
HTTP Code
200
Body
{
  "id": 5413,
  "user_id": 444,
  "account_id": 21,
  "read_at": null,
  "seen": false,
  "text": "awesome notification",
  "created_at": "2015/09/07 07:57:04 -0400",
  "updated_at": "2015/09/07 07:57:04 -0400"
}

Failure Response

HTTP Code
400
Body
{
  "error": "Text cannot be blank. You have to pass parameters like: account_notification: {user_id: 1000, text: 'message', hide_popup: true}"
}

Update an account notification

Request format

You can only send 'read_at' and 'seen' attributes for update.
'read_at' is obligatory.
'seen' can be omitted (it will be set to false if read_as is nil, or it will be set to true if read_at is a date).

PUT /account_notifications/:id.json

Examples

curl -X PUT -d "account_notification[read_at]=2015-03-13 07:00&account_notification[seen]=true" \
  "https://api.pipelinedeals.com/api/v3/account_notifications/4.json?api_key=abc1234"
HTTP Code
200
Body
{
  "id": 5413,
  "user_id": 444,
  "account_id": 21,
  "read_at": "2015/09/07 10:57:04 -0400",
  "seen": true,
  "text": "awesome notification",
  "created_at": "2015/09/07 07:57:04 -0400",
  "updated_at": "2015/09/07 07:57:04 -0400"
}

Failure Response

HTTP Code
400
Body
{
  "error": "You have to pass parameters like: account_notification: {read_at '2015-10-12 12:20', seen: true}"
}

Delete an account notification

Request format

DELETE /account_notifications/:id.json

Examples

curl -X DELETE "https://api.pipelinedeals.com/api/v3/account_notifications/13.json?api_key=abc1234"
HTTP Code
200
Body
{
  "id": 13,
  "user_id": 444,
  "account_id": 21,
  "read_at": "2015/09/07 10:57:04 -0400",
  "seen": true,
  "text": "awesome notification",
  "created_at": "2015/09/07 07:57:04 -0400",
  "updated_at": "2015/09/07 07:57:04 -0400"
}

Failure Response

HTTP Code
404
Body
{
  "error": "AccountNotification not found."
}