Notifications

Notification objects are created either automatically as a result of connection invitations or manually in the Custom Notifications section of the administrator portal.

Through the administration interface at https://app.dev.medable.com/[your_org_name]/settings/notifications, notifications can be enabled, disabled, or based on organization members’ preferences.

In conjunction with the scripting application programming interface (API), custom notifications can be configured for multiple endpoints and sent via scripts, for example, require("notifications").send("c_my_notif");.

An organization can set up an app for Apple Push Notification Service (APNs) and Google's Firebase Cloud Messaging (FCM), and users can set preferences for how to receive notifications: through APNs, via email, or through SMS for custom notifications.

Note: For customers who cannot use APNs or FCM, Medable incorporates the Tencent notification system.

For more information contact your Medable representative for more information.

Notifications are automatically cleared for connection invitations when they are retrieved using the API. Otherwise, clients should manually clear them using the notifications API.

NameDescription

_id ObjectId

The notification identifier.

context Reference

The context for which the notification was created.

created Date

The date the notification was created. Notifications that are not acknowledged expire after 30 days.

meta Any

An object containing notification metadata. For post updates, for example, it contains the postId and postType. For comments, it also contains the commentId.

object String

The object name (notification).

type ObjectId

The notification type. See Consts for the standard notification type _ids.

{
  "_id": "55238637b9b285167a241439",
  "context": {
    "_id": "5519c01aae2fd2b02915c81f",
    "object": "c_example",
    "path": "/c_examples/5519c01aae2fd2b02915c81f"
  },
  "meta": {
    "postId": "55238637a033479c18311c6e",
    "type": "c_post"
  },
  "object": "notification",
  "type": "4e66204665656473506f7374"
}

List

GET https://api.dev.medable.com/your_org_name/v2/notifications

Path Parameters

NameTypeDescription

your_org_name

string

{
  "data": [
    {
      "_id": "55238637b9b285167a241439",
      "context": {
        "_id": "5519c01aae2fd2b02915c81f",
        "object": "c_example",
        "path": "/c_examples/5519c01aae2fd2b02915c81f"
      },
      "meta": {
        "postId": "55238637a033479c18311c6e",
        "type": "c_post"
      },
      "object": "notification",
      "type": "4e66204665656473506f7374"
    },
    {
      "_id": "5523860eb9b285167a241431",
      "context": {
        "_id": "5519c01aae2fd2b02915c81f",
        "object": "c_example",
        "path": "/c_examples/5519c01aae2fd2b02915c81f"
      },
      "meta": {
        "commentId": "5523860ea033479c18311c65",
        "postId": "55238235bb12a3841950d37e",
        "type": "c_post"
      },
      "object": "notification",
      "type": "4e66204665656473436d6e74"
    }
  ],
  "hasMore": false,
  "object": "list"
}
$.ajax({
    url: "https://api.dev.medable.com/example/v2/notifications",
    method: "GET",
    dataType : "json",
    xhrFields: {
        withCredentials: true
    },
    headers: {
        "Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
    }
}).done(function(data) {
    // ...
});

Read

GET https://api.dev.medable.com/your_org_name/v2/notifications/notification_id

Path Parameters

NameTypeDescription

notification_id

string

your_org_name

string

{
  "_id": "55238637b9b285167a241439",
  "context": {
    "_id": "5519c01aae2fd2b02915c81f",
    "object": "c_example",
    "path": "/c_examples/5519c01aae2fd2b02915c81f"
  },
  "meta": {
    "postId": "55238637a033479c18311c6e",
    "type": "c_post"
  },
  "object": "notification",
  "type": "4e66204665656473506f7374"
}
$.ajax({
    url: "https://api.dev.medable.com/example/v2/notifications/55238637b9b285167a241439",
    method: "GET",
    dataType : "json",
    xhrFields: {
        withCredentials: true
    },
    headers: {
        "Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
    }
}).done(function(data) {
    // ...
});

Clear (one)

PATCH https://api.dev.medable.com/your_org_name/v2/notifications/notification_id

Path Parameters

NameTypeDescription

your_org_name

string

notification_id

string

{
    "object": "result",
    "data": 1
}
$.ajax({
    url: "https://api.dev.medable.com/example/v2/notifications/55238af0b9b285167a2414c8",
    method: "DELETE",
    dataType : "json",
    xhrFields: {
        withCredentials: true
    },
    headers: {
        "Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
    }
}).done(function(data) {
    // ...
});

Clear (many)

PATCH https://api.dev.medable.com/your_org_name/v2/notifications/object_name/object_id

Path Parameters

NameTypeDescription

your_org_name

string

object_name

string

object_id

string

{
    "object": "result",
    "data": 1
}
$.ajax({
    url: "https://api.dev.medable.com/example/v2/notifications/c_examples/5519c01aae2fd2b02915c81f?type=4e6620436e6e637443727464",
    method: "DELETE",
    dataType : "json",
    xhrFields: {
        withCredentials: true
    },
    headers: {
        "Medable-Client-Key": "GsAqlhnIMzrDeD8V2MBQWq"
    }
}).done(function(data) {
    // ...
});

Last updated