MoEngage Streams Webhook
curl --request POST \
--url https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams \
--header 'Content-Type: application/json' \
--data '
{
"app_name": "<string>",
"source": "MOENGAGE",
"moe_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"events": [
{
"event_name": "<string>",
"event_code": "<string>",
"event_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_time": 123,
"event_source": "MOENGAGE",
"uid": "<string>",
"event_attributes": {},
"user_attributes": {},
"device_attributes": {}
}
]
}
'import requests
url = "https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams"
payload = {
"app_name": "<string>",
"source": "MOENGAGE",
"moe_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"events": [
{
"event_name": "<string>",
"event_code": "<string>",
"event_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_time": 123,
"event_source": "MOENGAGE",
"uid": "<string>",
"event_attributes": {},
"user_attributes": {},
"device_attributes": {}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
app_name: '<string>',
source: 'MOENGAGE',
moe_request_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
events: [
{
event_name: '<string>',
event_code: '<string>',
event_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
event_time: 123,
event_source: 'MOENGAGE',
uid: '<string>',
event_attributes: {},
user_attributes: {},
device_attributes: {}
}
]
})
};
fetch('https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams', 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{dc}.moengage.com/v1/webhooks/moengage-streams",
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([
'app_name' => '<string>',
'source' => 'MOENGAGE',
'moe_request_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'events' => [
[
'event_name' => '<string>',
'event_code' => '<string>',
'event_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'event_time' => 123,
'event_source' => 'MOENGAGE',
'uid' => '<string>',
'event_attributes' => [
],
'user_attributes' => [
],
'device_attributes' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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{dc}.moengage.com/v1/webhooks/moengage-streams"
payload := strings.NewReader("{\n \"app_name\": \"<string>\",\n \"source\": \"MOENGAGE\",\n \"moe_request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"events\": [\n {\n \"event_name\": \"<string>\",\n \"event_code\": \"<string>\",\n \"event_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"event_time\": 123,\n \"event_source\": \"MOENGAGE\",\n \"uid\": \"<string>\",\n \"event_attributes\": {},\n \"user_attributes\": {},\n \"device_attributes\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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{dc}.moengage.com/v1/webhooks/moengage-streams")
.header("Content-Type", "application/json")
.body("{\n \"app_name\": \"<string>\",\n \"source\": \"MOENGAGE\",\n \"moe_request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"events\": [\n {\n \"event_name\": \"<string>\",\n \"event_code\": \"<string>\",\n \"event_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"event_time\": 123,\n \"event_source\": \"MOENGAGE\",\n \"uid\": \"<string>\",\n \"event_attributes\": {},\n \"user_attributes\": {},\n \"device_attributes\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"app_name\": \"<string>\",\n \"source\": \"MOENGAGE\",\n \"moe_request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"events\": [\n {\n \"event_name\": \"<string>\",\n \"event_code\": \"<string>\",\n \"event_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"event_time\": 123,\n \"event_source\": \"MOENGAGE\",\n \"uid\": \"<string>\",\n \"event_attributes\": {},\n \"user_attributes\": {},\n \"device_attributes\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyWebhooks
MoEngage Streams Webhook
This endpoint represents the incoming webhook from MoEngage Streams. Your server should be configured to accept POST requests with this payload format at your specified endpoint URL. This is not an API you call, but an event you receive from MoEngage.
POST
/
webhooks
/
moengage-streams
MoEngage Streams Webhook
curl --request POST \
--url https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams \
--header 'Content-Type: application/json' \
--data '
{
"app_name": "<string>",
"source": "MOENGAGE",
"moe_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"events": [
{
"event_name": "<string>",
"event_code": "<string>",
"event_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_time": 123,
"event_source": "MOENGAGE",
"uid": "<string>",
"event_attributes": {},
"user_attributes": {},
"device_attributes": {}
}
]
}
'import requests
url = "https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams"
payload = {
"app_name": "<string>",
"source": "MOENGAGE",
"moe_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"events": [
{
"event_name": "<string>",
"event_code": "<string>",
"event_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_time": 123,
"event_source": "MOENGAGE",
"uid": "<string>",
"event_attributes": {},
"user_attributes": {},
"device_attributes": {}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
app_name: '<string>',
source: 'MOENGAGE',
moe_request_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
events: [
{
event_name: '<string>',
event_code: '<string>',
event_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
event_time: 123,
event_source: 'MOENGAGE',
uid: '<string>',
event_attributes: {},
user_attributes: {},
device_attributes: {}
}
]
})
};
fetch('https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams', 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{dc}.moengage.com/v1/webhooks/moengage-streams",
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([
'app_name' => '<string>',
'source' => 'MOENGAGE',
'moe_request_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'events' => [
[
'event_name' => '<string>',
'event_code' => '<string>',
'event_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'event_time' => 123,
'event_source' => 'MOENGAGE',
'uid' => '<string>',
'event_attributes' => [
],
'user_attributes' => [
],
'device_attributes' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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{dc}.moengage.com/v1/webhooks/moengage-streams"
payload := strings.NewReader("{\n \"app_name\": \"<string>\",\n \"source\": \"MOENGAGE\",\n \"moe_request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"events\": [\n {\n \"event_name\": \"<string>\",\n \"event_code\": \"<string>\",\n \"event_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"event_time\": 123,\n \"event_source\": \"MOENGAGE\",\n \"uid\": \"<string>\",\n \"event_attributes\": {},\n \"user_attributes\": {},\n \"device_attributes\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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{dc}.moengage.com/v1/webhooks/moengage-streams")
.header("Content-Type", "application/json")
.body("{\n \"app_name\": \"<string>\",\n \"source\": \"MOENGAGE\",\n \"moe_request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"events\": [\n {\n \"event_name\": \"<string>\",\n \"event_code\": \"<string>\",\n \"event_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"event_time\": 123,\n \"event_source\": \"MOENGAGE\",\n \"uid\": \"<string>\",\n \"event_attributes\": {},\n \"user_attributes\": {},\n \"device_attributes\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{dc}.moengage.com/v1/webhooks/moengage-streams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"app_name\": \"<string>\",\n \"source\": \"MOENGAGE\",\n \"moe_request_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"events\": [\n {\n \"event_name\": \"<string>\",\n \"event_code\": \"<string>\",\n \"event_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"event_time\": 123,\n \"event_source\": \"MOENGAGE\",\n \"uid\": \"<string>\",\n \"event_attributes\": {},\n \"user_attributes\": {},\n \"device_attributes\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyWas this page helpful?
⌘I