curl --request POST \
--url https://api-0{X}.moengage.com/v1.0/business_event \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: <content-type>' \
--data '
{
"event_name": "NameOfOTTSeries",
"event_attributes": [
{
"attribute_name": "season",
"attribute_data_type": "string"
},
{
"attribute_name": "episodes",
"attribute_data_type": "int"
},
{
"attribute_name": "cast",
"attribute_data_type": "array"
},
{
"attribute_name": "released_on",
"attribute_data_type": "date"
},
{
"attribute_name": "budget",
"attribute_data_type": "float"
}
],
"created_by": "john.doe@example.com"
}
'import requests
url = "https://api-0{X}.moengage.com/v1.0/business_event"
payload = {
"event_name": "NameOfOTTSeries",
"event_attributes": [
{
"attribute_name": "season",
"attribute_data_type": "string"
},
{
"attribute_name": "episodes",
"attribute_data_type": "int"
},
{
"attribute_name": "cast",
"attribute_data_type": "array"
},
{
"attribute_name": "released_on",
"attribute_data_type": "date"
},
{
"attribute_name": "budget",
"attribute_data_type": "float"
}
],
"created_by": "john.doe@example.com"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Basic <encoded-value>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Basic <encoded-value>'},
body: JSON.stringify({
event_name: 'NameOfOTTSeries',
event_attributes: [
{attribute_name: 'season', attribute_data_type: 'string'},
{attribute_name: 'episodes', attribute_data_type: 'int'},
{attribute_name: 'cast', attribute_data_type: 'array'},
{attribute_name: 'released_on', attribute_data_type: 'date'},
{attribute_name: 'budget', attribute_data_type: 'float'}
],
created_by: 'john.doe@example.com'
})
};
fetch('https://api-0{X}.moengage.com/v1.0/business_event', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-0{X}.moengage.com/v1.0/business_event",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'event_name' => 'NameOfOTTSeries',
'event_attributes' => [
[
'attribute_name' => 'season',
'attribute_data_type' => 'string'
],
[
'attribute_name' => 'episodes',
'attribute_data_type' => 'int'
],
[
'attribute_name' => 'cast',
'attribute_data_type' => 'array'
],
[
'attribute_name' => 'released_on',
'attribute_data_type' => 'date'
],
[
'attribute_name' => 'budget',
'attribute_data_type' => 'float'
]
],
'created_by' => 'john.doe@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-0{X}.moengage.com/v1.0/business_event"
payload := strings.NewReader("{\n \"event_name\": \"NameOfOTTSeries\",\n \"event_attributes\": [\n {\n \"attribute_name\": \"season\",\n \"attribute_data_type\": \"string\"\n },\n {\n \"attribute_name\": \"episodes\",\n \"attribute_data_type\": \"int\"\n },\n {\n \"attribute_name\": \"cast\",\n \"attribute_data_type\": \"array\"\n },\n {\n \"attribute_name\": \"released_on\",\n \"attribute_data_type\": \"date\"\n },\n {\n \"attribute_name\": \"budget\",\n \"attribute_data_type\": \"float\"\n }\n ],\n \"created_by\": \"john.doe@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-0{X}.moengage.com/v1.0/business_event")
.header("Content-Type", "<content-type>")
.header("Authorization", "Basic <encoded-value>")
.body("{\n \"event_name\": \"NameOfOTTSeries\",\n \"event_attributes\": [\n {\n \"attribute_name\": \"season\",\n \"attribute_data_type\": \"string\"\n },\n {\n \"attribute_name\": \"episodes\",\n \"attribute_data_type\": \"int\"\n },\n {\n \"attribute_name\": \"cast\",\n \"attribute_data_type\": \"array\"\n },\n {\n \"attribute_name\": \"released_on\",\n \"attribute_data_type\": \"date\"\n },\n {\n \"attribute_name\": \"budget\",\n \"attribute_data_type\": \"float\"\n }\n ],\n \"created_by\": \"john.doe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{X}.moengage.com/v1.0/business_event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Basic <encoded-value>'
request.body = "{\n \"event_name\": \"NameOfOTTSeries\",\n \"event_attributes\": [\n {\n \"attribute_name\": \"season\",\n \"attribute_data_type\": \"string\"\n },\n {\n \"attribute_name\": \"episodes\",\n \"attribute_data_type\": \"int\"\n },\n {\n \"attribute_name\": \"cast\",\n \"attribute_data_type\": \"array\"\n },\n {\n \"attribute_name\": \"released_on\",\n \"attribute_data_type\": \"date\"\n },\n {\n \"attribute_name\": \"budget\",\n \"attribute_data_type\": \"float\"\n }\n ],\n \"created_by\": \"john.doe@example.com\"\n}"
response = http.request(request)
puts response.read_bodyCreate Business Event
This API allows you to create business events in MoEngage. You can use these events to trigger campaigns whenever they occur.
Rate Limit: The rate limits are at the workspace level. You can create a maximum of 50 business events for each workspace.
curl --request POST \
--url https://api-0{X}.moengage.com/v1.0/business_event \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: <content-type>' \
--data '
{
"event_name": "NameOfOTTSeries",
"event_attributes": [
{
"attribute_name": "season",
"attribute_data_type": "string"
},
{
"attribute_name": "episodes",
"attribute_data_type": "int"
},
{
"attribute_name": "cast",
"attribute_data_type": "array"
},
{
"attribute_name": "released_on",
"attribute_data_type": "date"
},
{
"attribute_name": "budget",
"attribute_data_type": "float"
}
],
"created_by": "john.doe@example.com"
}
'import requests
url = "https://api-0{X}.moengage.com/v1.0/business_event"
payload = {
"event_name": "NameOfOTTSeries",
"event_attributes": [
{
"attribute_name": "season",
"attribute_data_type": "string"
},
{
"attribute_name": "episodes",
"attribute_data_type": "int"
},
{
"attribute_name": "cast",
"attribute_data_type": "array"
},
{
"attribute_name": "released_on",
"attribute_data_type": "date"
},
{
"attribute_name": "budget",
"attribute_data_type": "float"
}
],
"created_by": "john.doe@example.com"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Basic <encoded-value>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Basic <encoded-value>'},
body: JSON.stringify({
event_name: 'NameOfOTTSeries',
event_attributes: [
{attribute_name: 'season', attribute_data_type: 'string'},
{attribute_name: 'episodes', attribute_data_type: 'int'},
{attribute_name: 'cast', attribute_data_type: 'array'},
{attribute_name: 'released_on', attribute_data_type: 'date'},
{attribute_name: 'budget', attribute_data_type: 'float'}
],
created_by: 'john.doe@example.com'
})
};
fetch('https://api-0{X}.moengage.com/v1.0/business_event', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-0{X}.moengage.com/v1.0/business_event",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'event_name' => 'NameOfOTTSeries',
'event_attributes' => [
[
'attribute_name' => 'season',
'attribute_data_type' => 'string'
],
[
'attribute_name' => 'episodes',
'attribute_data_type' => 'int'
],
[
'attribute_name' => 'cast',
'attribute_data_type' => 'array'
],
[
'attribute_name' => 'released_on',
'attribute_data_type' => 'date'
],
[
'attribute_name' => 'budget',
'attribute_data_type' => 'float'
]
],
'created_by' => 'john.doe@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-0{X}.moengage.com/v1.0/business_event"
payload := strings.NewReader("{\n \"event_name\": \"NameOfOTTSeries\",\n \"event_attributes\": [\n {\n \"attribute_name\": \"season\",\n \"attribute_data_type\": \"string\"\n },\n {\n \"attribute_name\": \"episodes\",\n \"attribute_data_type\": \"int\"\n },\n {\n \"attribute_name\": \"cast\",\n \"attribute_data_type\": \"array\"\n },\n {\n \"attribute_name\": \"released_on\",\n \"attribute_data_type\": \"date\"\n },\n {\n \"attribute_name\": \"budget\",\n \"attribute_data_type\": \"float\"\n }\n ],\n \"created_by\": \"john.doe@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-0{X}.moengage.com/v1.0/business_event")
.header("Content-Type", "<content-type>")
.header("Authorization", "Basic <encoded-value>")
.body("{\n \"event_name\": \"NameOfOTTSeries\",\n \"event_attributes\": [\n {\n \"attribute_name\": \"season\",\n \"attribute_data_type\": \"string\"\n },\n {\n \"attribute_name\": \"episodes\",\n \"attribute_data_type\": \"int\"\n },\n {\n \"attribute_name\": \"cast\",\n \"attribute_data_type\": \"array\"\n },\n {\n \"attribute_name\": \"released_on\",\n \"attribute_data_type\": \"date\"\n },\n {\n \"attribute_name\": \"budget\",\n \"attribute_data_type\": \"float\"\n }\n ],\n \"created_by\": \"john.doe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{X}.moengage.com/v1.0/business_event")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Basic <encoded-value>'
request.body = "{\n \"event_name\": \"NameOfOTTSeries\",\n \"event_attributes\": [\n {\n \"attribute_name\": \"season\",\n \"attribute_data_type\": \"string\"\n },\n {\n \"attribute_name\": \"episodes\",\n \"attribute_data_type\": \"int\"\n },\n {\n \"attribute_name\": \"cast\",\n \"attribute_data_type\": \"array\"\n },\n {\n \"attribute_name\": \"released_on\",\n \"attribute_data_type\": \"date\"\n },\n {\n \"attribute_name\": \"budget\",\n \"attribute_data_type\": \"float\"\n }\n ],\n \"created_by\": \"john.doe@example.com\"\n}"
response = http.request(request)
puts response.read_bodyOverview
In MoEngage, you can set up event-triggered campaigns to notify users about new episodes, flight delays, or price reductions on items they have viewed, wished for, or added to their carts.FAQs
What are the different data types supported in the creation of a business event?
What are the different data types supported in the creation of a business event?
Can I create two business events with the same name and different attributes?
Can I create two business events with the same name and different attributes?
How can I see the list of all the created business events in MoEngage?
How can I see the list of all the created business events in MoEngage?
Authorizations
The Basic authentication header contains your Base64-encoded key. This authentication parameter, used for access control, must be passed with the request.
Format: Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY==
Headers
Set the Content-Type header to application/json.
Body
Business event definition.
This field contains the name of the business event.
"NameOfOTTSeries"
This field contains the event attributes of the business event being created.
Show child attributes
Show child attributes
The email address of the creator of the business event.
"john.doe@example.com"
Was this page helpful?