curl --request GET \
--url https://dev.services.engagementagents.com/api/v1/campaigns \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.services.engagementagents.com/api/v1/campaigns"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.services.engagementagents.com/api/v1/campaigns', 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://dev.services.engagementagents.com/api/v1/campaigns",
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: Bearer <token>"
],
]);
$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://dev.services.engagementagents.com/api/v1/campaigns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://dev.services.engagementagents.com/api/v1/campaigns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.services.engagementagents.com/api/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"message": "Marketing campaigns fetched successfully",
"statusCode": 200,
"languages": [
"en",
"fr"
],
"types": [
"Sales",
"Events"
],
"pagination": {
"totalItems": 150,
"totalPages": 3,
"currentPage": 2,
"pageSize": 50,
"next": "/api/v1/campaigns?imageSize=1080x1080&limit=50&page=3&sortKey=startDate&sortOrder=asc",
"prev": "/api/v1/campaigns?imageSize=1080x1080&limit=50&page=1&sortKey=startDate&sortOrder=asc"
},
"data": [
{
"headline": {
"en": "Make Special Moments Shine Bright",
"fr": "Faites scintiller les moments spéciaux"
},
"description": {
"en": "Wrap up a special set to make their season unforgettable. Shop now and save 20% on our thoughtfully styled gift sets.",
"fr": "Emballez un ensemble spécial pour rendre leur saison des fêtes inoubliable. Magasinez maintenant et obtenez un rabais de 20% sur nos ensembles-cadeaux soigneusement agencés."
},
"type": "Sales",
"startDate": "2022-12-08",
"endDate": "2022-12-15",
"publishByDate": "2022-12-08",
"campaignNumber": "62",
"brand": "Pandora",
"brandId": "1853b8a4-63a7-4fb9-a973-3a27bdd5e1b4",
"storeIds": [
"84b5de1a-9005-4239-8f27-b8a9fe7c32ef",
"fec6959e-3607-4614-8695-3ad7e745ca20"
],
"slug": "pandora-62-make-special-moments-shine-bright",
"imageUrls": {
"en": "https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/Bwu8h8ZoLMfFispdncSaTla2Xvkn.png",
"fr": "https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/om8h5frznPNk15SY3HE6loRtz7Bn.png"
},
"updatedAt": "2022-12-19"
},
{
"headline": {
"en": "40% OFF YOUR ENTIRE PURCHASE"
},
"description": {
"en": "• 40% off your entire purchase • Accessories 50% off • Visit your nearest Levi's Store for more great deals!"
},
"type": "Loyalty",
"startDate": "2023-11-20",
"endDate": "2023-11-22",
"publishByDate": "2023-11-20",
"campaignNumber": "423",
"brand": "Levi's US",
"brandId": "5b9b828e-7884-4328-bac0-57903c39bb93",
"storeIds": [
"2d382f8a-b342-4d79-b89c-d9aa1974657d"
],
"slug": "levis-us-423-40-off-your-entire-purchase",
"imageUrls": {
"en": "https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/3UhbkfpYKe9RjNvjdyRh1qWZt3O6.png"
},
"updatedAt": "2023-11-23"
}
]
}{
"ok": false,
"message": "Bad request",
"statusCode": 400,
"errors": [
"Invalid 'sortKey' parameter. It must be one of startDate, endDate, publishByDate, brand.",
"Invalid 'imageSize' parameter. It must be in the format 'WxH'.",
"Invalid 'imageSize' parameter. Mall does not have the required image size"
],
"data": null
}{
"ok": false,
"message": "Unauthorized Request",
"statusCode": 401,
"errors": [
"You are making an unauthorized request. Please provide a valid authorization token. If you do not have one, please contact the support@engagementagents.com."
],
"data": null
}{
"ok": false,
"message": "Too Many Requests",
"statusCode": 429,
"errors": [
"You have exceeded the allowed limit of requests for this endpoint. We allow a maximum of 1000 requests per minute. Please try again later or contact support@engagementagents.com."
],
"data": null
}{
"ok": false,
"message": "Internal Server Error",
"statusCode": 500,
"errors": [
"An internal server error occurred. Please contact support@engagementagents.com for assistance."
],
"data": null
}Marketing Campaigns
Returns the active and upcoming marketing campaigns for the mall your API key is scoped to, filtered to those approved for the web channel.
This request is not side effect free: campaigns returned here are automatically approved for the Mobile Site/Website channel, on the basis that you are about to display them. Avoid calling it from contexts where the results will not be shown.
curl --request GET \
--url https://dev.services.engagementagents.com/api/v1/campaigns \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.services.engagementagents.com/api/v1/campaigns"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.services.engagementagents.com/api/v1/campaigns', 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://dev.services.engagementagents.com/api/v1/campaigns",
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: Bearer <token>"
],
]);
$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://dev.services.engagementagents.com/api/v1/campaigns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://dev.services.engagementagents.com/api/v1/campaigns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.services.engagementagents.com/api/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"message": "Marketing campaigns fetched successfully",
"statusCode": 200,
"languages": [
"en",
"fr"
],
"types": [
"Sales",
"Events"
],
"pagination": {
"totalItems": 150,
"totalPages": 3,
"currentPage": 2,
"pageSize": 50,
"next": "/api/v1/campaigns?imageSize=1080x1080&limit=50&page=3&sortKey=startDate&sortOrder=asc",
"prev": "/api/v1/campaigns?imageSize=1080x1080&limit=50&page=1&sortKey=startDate&sortOrder=asc"
},
"data": [
{
"headline": {
"en": "Make Special Moments Shine Bright",
"fr": "Faites scintiller les moments spéciaux"
},
"description": {
"en": "Wrap up a special set to make their season unforgettable. Shop now and save 20% on our thoughtfully styled gift sets.",
"fr": "Emballez un ensemble spécial pour rendre leur saison des fêtes inoubliable. Magasinez maintenant et obtenez un rabais de 20% sur nos ensembles-cadeaux soigneusement agencés."
},
"type": "Sales",
"startDate": "2022-12-08",
"endDate": "2022-12-15",
"publishByDate": "2022-12-08",
"campaignNumber": "62",
"brand": "Pandora",
"brandId": "1853b8a4-63a7-4fb9-a973-3a27bdd5e1b4",
"storeIds": [
"84b5de1a-9005-4239-8f27-b8a9fe7c32ef",
"fec6959e-3607-4614-8695-3ad7e745ca20"
],
"slug": "pandora-62-make-special-moments-shine-bright",
"imageUrls": {
"en": "https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/Bwu8h8ZoLMfFispdncSaTla2Xvkn.png",
"fr": "https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/om8h5frznPNk15SY3HE6loRtz7Bn.png"
},
"updatedAt": "2022-12-19"
},
{
"headline": {
"en": "40% OFF YOUR ENTIRE PURCHASE"
},
"description": {
"en": "• 40% off your entire purchase • Accessories 50% off • Visit your nearest Levi's Store for more great deals!"
},
"type": "Loyalty",
"startDate": "2023-11-20",
"endDate": "2023-11-22",
"publishByDate": "2023-11-20",
"campaignNumber": "423",
"brand": "Levi's US",
"brandId": "5b9b828e-7884-4328-bac0-57903c39bb93",
"storeIds": [
"2d382f8a-b342-4d79-b89c-d9aa1974657d"
],
"slug": "levis-us-423-40-off-your-entire-purchase",
"imageUrls": {
"en": "https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/3UhbkfpYKe9RjNvjdyRh1qWZt3O6.png"
},
"updatedAt": "2023-11-23"
}
]
}{
"ok": false,
"message": "Bad request",
"statusCode": 400,
"errors": [
"Invalid 'sortKey' parameter. It must be one of startDate, endDate, publishByDate, brand.",
"Invalid 'imageSize' parameter. It must be in the format 'WxH'.",
"Invalid 'imageSize' parameter. Mall does not have the required image size"
],
"data": null
}{
"ok": false,
"message": "Unauthorized Request",
"statusCode": 401,
"errors": [
"You are making an unauthorized request. Please provide a valid authorization token. If you do not have one, please contact the support@engagementagents.com."
],
"data": null
}{
"ok": false,
"message": "Too Many Requests",
"statusCode": 429,
"errors": [
"You have exceeded the allowed limit of requests for this endpoint. We allow a maximum of 1000 requests per minute. Please try again later or contact support@engagementagents.com."
],
"data": null
}{
"ok": false,
"message": "Internal Server Error",
"statusCode": 500,
"errors": [
"An internal server error occurred. Please contact support@engagementagents.com for assistance."
],
"data": null
}Authorizations
An API key issued by Engagement Agents, sent as Authorization: Bearer <key>. Contact support@engagementagents.com to obtain or rotate a key.
Query Parameters
The image size that determines which image is used in each of the returned campaigns. Strictly width, the letter x, then height, both whole numbers - for example 1080x1080. It must be a size configured for your mall; any other value returns 400.
^\d+x\d+$"1080x1080"
The maximum number of results to return. Must be between 1 and 100 inclusive; values outside that range return 400.
1 <= x <= 100The page number to return given the limit. Must be a positive integer.
x >= 1The key to sort the results by
startDate, endDate, publishByDate, brand The order to sort the results by
asc, desc A search term to filter the results by. Fields that will not be included in search; imageUrls. All other fields will be included in the search. For searching dates, use the format YYYY-MM-DD
An array of types to filter the results by. If not provided, all types will be returned.
Sales, Events, New Arrivals, Loyalty Response
A list of marketing campaigns for your given location
Indicates if the request was successful
A message describing the result of the request
The status code of the response
An array of languages that the campaigns are available in. Note, some languages may not have translations
An array of campaign types that are in the returned results. Note, these may only include a subset of the types available or that were requested in the query
Information about the pagination of the results returned
Show child attributes
Show child attributes
The list of marketing campaigns
Show child attributes
Show child attributes
