1. Notifications
Spencer Integration API
  • Spencer Integration API
  • Identity
    • Request access token
      POST
  • News
    • Fetch news publications
      GET
    • Fetch news publications for userlist
      GET
    • Create news draft
      POST
  • Users
    • Create user
      POST
    • Fetch user
      GET
    • Update user
      PUT
    • Delete user
      DELETE
    • Check if user exists
      HEAD
    • Add user profile picture
      POST
    • Create user tag
      POST
    • Update user tag
      PUT
    • Check if user tag exists
      HEAD
  • Document library
    • Fetch node
      GET
  • Notifications
    • Create notification
      POST
  1. Notifications

Create notification

POST
/agent/integration/api/v1/notifications
Sends a (mobile push) notification to the targeted audience.

Notification content#

The notification content exists of 3 parts:
title: (translated) title of the push notification, limited to 50 characters and auto-truncated
description: (translated) body text of the push notification, limited to 140 characters and auto-truncated
url: the url that should be opened, in most cases a universal deeplink to a specific entity in the Spencer app (e.g. https://delighter.spencer.app/news/1234)
The title and description are language specific, and they must be provided in a translations array.

Notification delivery#

The target attribute defines to whom the notification is sent:
all: send to everyone in the organization
users: send to a specific list of users in recipients, indicated by a specific identifier key user_identifier (e.g. external_id)
user_lists: send to one or more Spencer userlists in user_lists
On top of that, the notification type defines the push notification topic.
The notification will only be sent to users subscribed to the given type (and who are part of the target of course).
And as mentioned before, the user's language setting must match one of the translations.
There is no fallback to a default language; if the user's language is not included in the translations array, the push is not sent.
To summarize, successful delivery is a combination of 3 aspects:
target for defining the target audience
type for selecting the push notification topic
provided translations

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************

Request Code Samples

Shell
HTTP
Request Request Example
Shell
HTTP
curl --location --request POST '/agent/integration/api/v1/notifications' \
--header 'Authorization: Bearer <token>'

Responses

🟢201Success
application/json
Bodyapplication/json

Example
{}
🟠400
🟠401
🟠403
Previous
Fetch node
Built with