# Notification

We would like to introduce you to our notifications. With this API endpoint you can build your own TONIC. newsfeed to keep yourself up-to-date on campaign optimizations, system alerts, new features and other useful information.

With this API you can integrate these news into your workflow and be on time as soon as something changes.

The notifications are plain markdown documents, which means you can render them in every design you like, depending on the renderer you choose.

# Request the Newsfeed

This Endpoint returns your personalized newsfeed. It is a list of unread messages that are currently published. You can always get a list of all notifications including messages you marked as read and messages from the past.

URL : /notifications

Method : GET

Parameters:

Parameter Type Values Description
all boolean true, y, false, n List all notifications, including all past and read ones. Default false

Request example

GET https://api.advertiser.tonic.com/v1/notifications

Response example

[
	{
		"id": 1,
		"headline": "Update your campaign budget",
		"type": "campaign-optimization",
		"thumbnail_url": "https://notification-img.tonic.com/1234.jpg",
		"read_timestamp": null
	},
	{
		"id": 5,
		"headline": "New Feature: Notifications",
		"type": "new-feature",
		"thumbnail_url": "https://notification-img.tonic.com/5678.jpg",
		"read_timestamp": null
	}
]

# Get a Message

After you received a newsfeed you can request a complete message as markdown document.

URL : /notifications/:notificationId

Method : GET

Content Type : text/markdown

Request example

GET https://api.advertiser.tonic.com/v1/notifications/5

Response example

# New Feature: Notifications

We are happy to announce the *brand new* notification feature!

# Mark Message as read

This will hide the message from the current newsfeed, but you will still be able to access it by id and list it with the all flag.

URL : /notifications/:notificationId

Method : PATCH or PUT

Request example

PATCH https://api.advertiser.tonic.com/v1/notifications/5

Response example

{
	"id": 5,
	"headline": "New Feature: Notifications",
	"type": "new-feature",
	"thumbnail_url": "https://notification-img.tonic.com/5678.jpg",
	"read_timestamp": "2019-03-30 09:15:00",
	"published_at": "2019-03-21 12:00:00",
	"notify_until": "2019-04-04 12:00:00"
}

# Mark Message as unread

Want the message to appear in the newsfeed again? Add a request body with read set to false:

{
	"read": false
}

# Get Message Metadata

This will return additional data of a notification like the newsfeed, but includes the time range the notification was published in.

URL : /notifications/:notificationId/metadata

Method : GET

Request example

GET https://api.advertiser.tonic.com/v1/notifications/5/metadata

Response example

{
	"id": 5,
	"headline": "New Feature: Notifications",
	"type": "new-feature",
	"thumbnail_url": "https://notification-img.tonic.com/5678.jpg",
	"read_timestamp": null,
	"published_at": "2019-03-21 12:00:00",
	"notify_until": "2019-04-04 12:00:00"
}
Last Updated: 5/26/2021, 1:43:45 PM