Create Notification

Resource type: notification

With this API call you can create a notification for a user in onOffice enterprise. This allows apps, WordPress websites and other external tools to send notifications to enterprise users, e.g. about a new inquiry or an upcoming deadline.

Each successful call creates exactly one notification for one receiver (receiverUserId). The creator of the notification is always the API user who sends the request.

Optionally, the notification can be linked to an existing task, appointment, property, address or activity. Each of these parameters accepts exactly one ID. If the record does not exist, the notification is still created.

Parameters:

  • subject
    MANDATORY. STRING. Subject of the notification. Maximum 250 characters, longer values are rejected with an error.
  • description
    MANDATORY. STRING. Text of the notification.
  • receiverUserId
    MANDATORY. INTEGER. ID of the user who receives the notification. The ID must belong to a valid user. User IDs can be retrieved with Get users.
  • priority
    STRING. Priority of the notification. Possible values: default, high. Default value: default.
  • relatedTaskId
    INTEGER. ID of an existing task the notification is linked to (see note above).
  • relatedAppointmentId
    INTEGER. ID of an existing appointment the notification is linked to (see note above).
  • relatedEstateId
    INTEGER. ID of an existing property record the notification is linked to (see note above).
  • relatedAddressId
    INTEGER. ID of an existing address record the notification is linked to (see note above).
  • relatedActivityId
    INTEGER. ID of an existing activity (agents log entry) the notification is linked to (see note above).
Example: Create a notification with mandatory parameters only
    {
        "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:create",
        "resourceid": "",
        "resourcetype": "notification",
        "identifier": "",
        "parameters": {
            "subject": "New contact request via website",
            "description": "A new contact request has been received via the contact form on your website.",
            "receiverUserId": 21
        }
    }
Example: Create a notification with high priority, linked to a property
    {
        "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:create",
        "resourceid": "",
        "resourcetype": "notification",
        "identifier": "",
        "parameters": {
            "subject": "New inquiry for estate AC-1234",
            "description": "Max Mustermann has requested the exposé. Please contact the prospect.",
            "receiverUserId": 21,
            "priority": "high",
            "relatedEstateId": 459
        }
    }

If successful, the response contains the status OK (errorcode 0). No record data is returned (records is empty), so the response does not contain the ID of the new notification.