curl --request GET \
--url https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'MOE-APPKEY: <moe-appkey>'import requests
url = "https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}"
headers = {
"MOE-APPKEY": "<moe-appkey>",
"Authorization": "Basic <encoded-value>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'MOE-APPKEY': '<moe-appkey>', Authorization: 'Basic <encoded-value>'}
};
fetch('https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}', 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/coupon-list/{coupon_list_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"MOE-APPKEY: <moe-appkey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("MOE-APPKEY", "<moe-appkey>")
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.get("https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}")
.header("MOE-APPKEY", "<moe-appkey>")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["MOE-APPKEY"] = '<moe-appkey>'
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"name": "signup coupons",
"label": "signup_coupons",
"expires_at": "2024-10-26T18:29:00.000Z",
"status": "ACTIVE",
"total_coupons": 0,
"created_at": "2024-10-01T11:29:00.000Z",
"updated_at": "2024-10-01T11:39:00.000Z",
"email_alert_subscribers": [
"john.doe@example.com"
],
"alert_conditions": {
"success_alert": true,
"failure_alert": true,
"expiry_alert": {
"alert": true,
"days_before": 100
},
"coupon_shortage_alert": {
"alert": true,
"threshold_count": 100
}
},
"available_coupons": 0,
"personalization_snippet": "{{Coupons.CouponListName[signup_coupons]}}",
"created_by": "test_user",
"_id": "{{coupon_list_id}}"
}{
"error": {
"code": "bad-request",
"message": "Possible issues include duplicates, such as coupon list names, invalid data types, or missing mandatory attributes."
}
}{
"error": {
"code": "request-unauthenticated",
"message": "Your request is unauthorized. Verify your credentials and try again."
}
}{
"error": {
"code": "request-forbidden",
"message": "Your account does not have access to the Coupon Management features. Contact the MoEngage team for further assistance."
}
}{
"error": {
"code": "unexpected-error",
"message": "Something went wrong with your request. Please contact the MoEngage team for further assistance."
}
}Fetch Coupon List Details
This API allows you to retrieve the specifications of a particular coupon list. It includes information such as configurations, statuses, expiry dates, and alert conditions with real-time counts of added and currently available coupons. Using this API, you can easily access and manage critical data about individual coupon lists.
curl --request GET \
--url https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'MOE-APPKEY: <moe-appkey>'import requests
url = "https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}"
headers = {
"MOE-APPKEY": "<moe-appkey>",
"Authorization": "Basic <encoded-value>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'MOE-APPKEY': '<moe-appkey>', Authorization: 'Basic <encoded-value>'}
};
fetch('https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}', 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/coupon-list/{coupon_list_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"MOE-APPKEY: <moe-appkey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("MOE-APPKEY", "<moe-appkey>")
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.get("https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}")
.header("MOE-APPKEY", "<moe-appkey>")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-0{dc}.moengage.com/v1/coupon-list/{coupon_list_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["MOE-APPKEY"] = '<moe-appkey>'
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"name": "signup coupons",
"label": "signup_coupons",
"expires_at": "2024-10-26T18:29:00.000Z",
"status": "ACTIVE",
"total_coupons": 0,
"created_at": "2024-10-01T11:29:00.000Z",
"updated_at": "2024-10-01T11:39:00.000Z",
"email_alert_subscribers": [
"john.doe@example.com"
],
"alert_conditions": {
"success_alert": true,
"failure_alert": true,
"expiry_alert": {
"alert": true,
"days_before": 100
},
"coupon_shortage_alert": {
"alert": true,
"threshold_count": 100
}
},
"available_coupons": 0,
"personalization_snippet": "{{Coupons.CouponListName[signup_coupons]}}",
"created_by": "test_user",
"_id": "{{coupon_list_id}}"
}{
"error": {
"code": "bad-request",
"message": "Possible issues include duplicates, such as coupon list names, invalid data types, or missing mandatory attributes."
}
}{
"error": {
"code": "request-unauthenticated",
"message": "Your request is unauthorized. Verify your credentials and try again."
}
}{
"error": {
"code": "request-forbidden",
"message": "Your account does not have access to the Coupon Management features. Contact the MoEngage team for further assistance."
}
}{
"error": {
"code": "unexpected-error",
"message": "Something went wrong with your request. Please contact the MoEngage team for further assistance."
}
}Rate Limit
You can fetch 10000 coupon lists per day.Authorizations
Uses Workspace ID as username and API Key as password.
Headers
This is the workspace ID (earlier APP ID) of your MoEngage workspace. The MOE-APPKEY has to be passed in the request. You can find your MoEngage Workspace ID in the MoEngage Dashboard: Settings -> Account -> APIs -> Workspace ID (earlier app id).
Path Parameters
The unique identifier for the coupon list.
Response
Success Indicates that the request is successful and the coupon list is fetched.
This field consists of the unique name of the coupon list.
This field consists of the label name for the fetched coupon list.
This field consists of the expiry date of the coupon list in yyyy-mm-dd format.
This field shows one of the following statuses of the fetched coupon list:
- ACTIVE
- EXPIRED
- ARCHIVED
This field consists of the total number of coupons in the coupon list.
This field consists of the date and time the coupon list was created.
This field consists of the date and time of the most recent update to the coupon list.
This field consists of the email address of the coupon list subscriber.
This field consists of the alert conditions and their statuses specified while creating the coupon list.
This field consists of the available number of coupons in coupon list.
This field consists of the personalization snippet of the coupon list.
This field consists of the user name who created the fetched coupon list.
This field contains the unique ID corresponding to a successful coupon list fetch request. This ID is also used to update and archive coupon lists.
Was this page helpful?