API Reference
Add a post in your code
Add a POST request to the EveryLog API in your code and you'll be all set!
Your app will receive its first notification.
The minimum set of required params is:
- projectId
- title
- summary
- body All others params are not mandatory
Minimum sample code for post
javascript example
import axios from 'axios';
const headers = { 'Authorization': `Bearer ${API_KEY}` }
const data = {
projectId: "project-name",
title: "New subscription",
summary: "A new user has subscribed to base plan",
body: "foo@bar.com just subscribed to plan XYZ",
push: true
}
RestClient.post(everylog_url,
body.to_json,
{Authorization: "Bearer #{api_key}",
content_type: :json})
Full list of available params
Param | Description |
---|---|
projectId | Id of the Channel in which you want to post the notification. |
title | Title of the notification. |
summary | Summary of the notification. |
body | Content of the notification. Can be simple text or html. Take a look at Allowed HTML Tags to know which tags you can use. |
push | Set it to true if you want to send notification, false if you only want to log the event. |
icon | You can specify an emoji to be used in your notification instead of the EveryLog logo. |
link | Add an external link to your notification. |
tags | Array of tags (comma-separated strings). |
properties | Array of properties: [{ key1: 'val1' }, { key2: 'val2' }] |
groups | Array of group-code. You can specify if your notification should be received and be available only for users inside a group. |
users | Array of user-id or emails. You can specify if your notification should be received and be available only for specific users. |
roles | Array of roles. You can specify if your notification should be received and be available only for users with a specific role. |