Skip to content

Notifications

Get Notifications

  • Endpoint:
GET /notifications
  • Allowed for:

Everyone

Curl example :

$ curl -X GET 'http://api-v2.mycrm.com/notifications'
  • Filters:
Name Type Read-only Comment
seen boolean (0 or 1) yes only notification not read already
action_required boolean (0 or 1) yes notification where an action is required by the user
  • JSON response:
Name Type Read-only Comment
id integer yes Automatically assigned when the property is created
title string yes Notification title
description string yes Notification description
sender User no User who sent the notification (not expanded by default)
receiver User no User who received the notification (not expanded by default)
resource string yes
seen_at string yes Notification seen date (W3C format)
created_at string yes Notification creation date (W3C format)
reason string yes Notification reason (used for property refused notification)
  • JSON response example:
{
    "count": 2,
    "page": 1,
    "per_page": 100,
    "notifications": [
        {
            "id": 1,
            "title": "Unassigned Landlord in Property",
            "description": "The property <span>client1-13<\/span> has no Landlord assigned",
            "sender": {
                "id": 2
            },
            "receiver": {
                "id": 1
            },
            "resource": "\/properties\/1",
            "seen_at": null,
            "created_at": "2014-07-20T22:55:29Z",
            "reason": null
        },
        {
            "id": 2,
            "title": "Property assigned to agent",
            "description": "The property <span>foo<\/span> has been assigned to you by the admin Bar",
            "sender": {
                "id": 2
            },
            "receiver": {
                "id": 1
            },
            "resource": "\/properties\/2",
            "seen_at": "2014-07-20T22:55:29Z",
            "created_at": "2014-07-20T22:55:29Z",
            "reason": null
        },
        {
            "id": 3,
            "title": "Property rejected by your Admin",
            "description": "Your property <span>client1-5</span> has been refused by the admin <span>Jon D</span>",
            "sender": {
                "id": 2
            },
            "receiver": {
                "id": 1
            },
            "resource": "\/properties\/2",
            "seen_at": "2014-07-20T22:55:29Z",
            "created_at": "2014-07-20T22:55:29Z",
            "reason": "Chuck Norris said no"
        }
    ]
}

Mark Notification as read

PATCH /notifications
  • Allowed for:

Everyone

  • JSON request:

Some actions are available:

Name Type Mandatory Comment
op string yes Operation to execute (add)
path string yes Path "/id/seen" to update the approval status. id must be an integer or the wildcard *
value string yes Must be null
  • JSON request example:
{
    "operations": [
        { "op": "add", "path": "/*/seen", "value": null }
    ]
}
  • JSON response:

Will return a 204 http code.