API Docs
Event api params
Here are all event api’s parameters. Only name is required, everything else is optional.
Required, must be a string, max 26 characters, more characters will be truncated.
1 character only. Rest will be truncated.
If left blank, defaults to ‘text’. Controls how content field is rendered. Options are ‘text’, ‘rows’, ‘json’, ‘image’.
Defaults to null. Use this to map events to specific users. If a number is passed, it will be converted to a string.
Mixed content type, can be a string or JSON depending on what type is set.
JSON Array, defaults to an empty array. Related to actions.
Defaults to false. If true, won’t show up in the events UI unless the unmute button next to the search bar is clicked.
Defaults to false. If true, will send you a push notification(if enabled on your device)
Optional, boolean, defaults to false. If true, this event won’t show up unless test mode is activated.
Defaults to null. Related to contexts.
Defaults to false. Related to contexts.
const ops = new Operational("yourapikey");
const e = {
name: "some event",
avatar: "🤖",
type: "text",
userId: null,
content: "Hello mellow!",
actions: [],
muted: false,
notify: false,
test: false,
contextId: null,
contextStart: false
};
await ops.events.ingest(e);
Copyconst e = {
name: "some event",
avatar: "🤖",
type: "text",
userId: null,
content: "Hello mellow!",
actions: [],
muted: false,
notify: false,
test: false,
contextId: null,
contextStart: false
};
const token = "ops_yourapikey";
const config = {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`
},
body: JSON.stringify(e)
}
await fetch(url, config);'
Copy