Javascript Example
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",
tags: [
"new subscriber",
"welcome"
],
groups: [
"first-group",
"second-group"
],
roles: [
"admin",
"developers"
],
users: [
"user1@example.com",
"user2@example.com"
],
properties: [
{key: "value"},
{key2: "value2"}
],
externalChannels: [
"channel-code",
"other-channel-code"
],
icon: "🤪",
link: "https://www.example.com",
push: true
}
axios.post("https://api.everylog.io/api/v1/log-entries", data, { headers: headers });