curl --request POST \
--url https://api-0{X}.moengage.com/v1.0/business_event/search \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: <content-type>' \
--data '
{
"event_ids": [
"6447b078712cd8c650074840"
]
}
'import requests
url = "https://api-0{X}.moengage.com/v1.0/business_event/search"
payload = { "event_ids": ["6447b078712cd8c650074840"] }
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_ids: ['6447b078712cd8c650074840']})
};
fetch('https://api-0{X}.moengage.com/v1.0/business_event/search', 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/search",
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_ids' => [
'6447b078712cd8c650074840'
]
]),
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/search"
payload := strings.NewReader("{\n \"event_ids\": [\n \"6447b078712cd8c650074840\"\n ]\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/search")
.header("Content-Type", "<content-type>")
.header("Authorization", "Basic <encoded-value>")
.body("{\n \"event_ids\": [\n \"6447b078712cd8c650074840\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{X}.moengage.com/v1.0/business_event/search")
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_ids\": [\n \"6447b078712cd8c650074840\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"db_name": "Sample_App",
"event_id": "647597767459c85d7d6d6dfd",
"event_name": "NewMovies",
"event_attributes": [
{
"attribute_name": "MovieName",
"attribute_data_type": "array"
},
{
"attribute_name": "rating",
"attribute_data_type": "string"
}
],
"created_at": "2023-05-29T18:36:52.390000",
"total_trigger": 0,
"users_in_segment": 0,
"usage_count": 0,
"created_by": "john.doe@moengage.com",
"last_received_time": "2023-05-30T06:28:06.498000",
"_id": "64a54500633fda13b6681163"
}
]
}{
"error": {
"code": "400 Bad Request",
"message": "Additional fields are not allowed document schema for class BusinessEventSearchRequest:event_name",
"details": [
{
"code": "InvalidValue",
"target": "event_name",
"message": "Additional fields are not allowed document schema for class BusinessEventSearchRequest:event_name"
}
],
"request_id": "64a54e62633fda13b6681431"
}
}{
"error": {
"code": "401 Authentication error",
"message": "Authentication required",
"details": [
{
"code": "InvalidValue",
"target": "Authorization",
"message": {
"code": "MissingValue",
"target": "Authorization",
"message": "APP_ID and APP_SECRET_KEY is missing in Authorization Header."
}
}
],
"request_id": "64a54e0e633fda13b6681430"
}
}{
"status": "error",
"data": {
"code": 429,
"title": "rate limiter exception",
"description": "Exceeded rate limit for this app"
}
}{
"title": "Internal Server Error",
"message": "An unexpected error was encountered while processing this request. Please contact MoEngage Team"
}Search Business Events
This API allows you to search for business events by specifying their event IDs.
curl --request POST \
--url https://api-0{X}.moengage.com/v1.0/business_event/search \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: <content-type>' \
--data '
{
"event_ids": [
"6447b078712cd8c650074840"
]
}
'import requests
url = "https://api-0{X}.moengage.com/v1.0/business_event/search"
payload = { "event_ids": ["6447b078712cd8c650074840"] }
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_ids: ['6447b078712cd8c650074840']})
};
fetch('https://api-0{X}.moengage.com/v1.0/business_event/search', 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/search",
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_ids' => [
'6447b078712cd8c650074840'
]
]),
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/search"
payload := strings.NewReader("{\n \"event_ids\": [\n \"6447b078712cd8c650074840\"\n ]\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/search")
.header("Content-Type", "<content-type>")
.header("Authorization", "Basic <encoded-value>")
.body("{\n \"event_ids\": [\n \"6447b078712cd8c650074840\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{X}.moengage.com/v1.0/business_event/search")
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_ids\": [\n \"6447b078712cd8c650074840\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"db_name": "Sample_App",
"event_id": "647597767459c85d7d6d6dfd",
"event_name": "NewMovies",
"event_attributes": [
{
"attribute_name": "MovieName",
"attribute_data_type": "array"
},
{
"attribute_name": "rating",
"attribute_data_type": "string"
}
],
"created_at": "2023-05-29T18:36:52.390000",
"total_trigger": 0,
"users_in_segment": 0,
"usage_count": 0,
"created_by": "john.doe@moengage.com",
"last_received_time": "2023-05-30T06:28:06.498000",
"_id": "64a54500633fda13b6681163"
}
]
}{
"error": {
"code": "400 Bad Request",
"message": "Additional fields are not allowed document schema for class BusinessEventSearchRequest:event_name",
"details": [
{
"code": "InvalidValue",
"target": "event_name",
"message": "Additional fields are not allowed document schema for class BusinessEventSearchRequest:event_name"
}
],
"request_id": "64a54e62633fda13b6681431"
}
}{
"error": {
"code": "401 Authentication error",
"message": "Authentication required",
"details": [
{
"code": "InvalidValue",
"target": "Authorization",
"message": {
"code": "MissingValue",
"target": "Authorization",
"message": "APP_ID and APP_SECRET_KEY is missing in Authorization Header."
}
}
],
"request_id": "64a54e0e633fda13b6681430"
}
}{
"status": "error",
"data": {
"code": 429,
"title": "rate limiter exception",
"description": "Exceeded rate limit for this app"
}
}{
"title": "Internal Server Error",
"message": "An unexpected error was encountered while processing this request. Please contact MoEngage Team"
}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
Search criteria. At least one of event_ids or event_names should be provided.
This field contains the list of event ids associated with the business events that need to be fetched.
Structure: "event_ids": ["event_id1","event_id2","event_id3"]
event_id: The event id is the unique identifier for a business event and is generated by MoEngage at the time of business event creation. You must store and use this value while looking up a business event using the search API.
["6447b078712cd8c650074840"]
This field contains the list of event names associated with the business events that need to be fetched.
Structure: "event_names": ["event_name1","event_name2","event_name3"]
event_name: The event name is the name associated with the Business Event that is provided during the creation of the event.
["NewMovies"]
Response
This response is returned when the request is processed successfully.
Show child attributes
Show child attributes
Was this page helpful?