curl --request GET \
--url https://app.masivo.ai/api/storefront/v1/campaigns \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/v1/campaigns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/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{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "RUNNING",
"attributes": {},
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"tiers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"content": {
"Title": {
"name": "Title",
"type": "input",
"value": "Value of the title"
},
"BannerImage": {
"alt": "Alternative description for the image",
"href": "Href link for the image",
"name": "BannerImage",
"type": "image",
"value": "https://URL_TO_IMAGE"
},
"Description": {
"name": "Name of the description",
"type": "input",
"value": "Value of the description"
}
},
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"from": 0,
"to": 9,
"count": 10
}Get campaigns
Get all campaigns
curl --request GET \
--url https://app.masivo.ai/api/storefront/v1/campaigns \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/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://app.masivo.ai/api/storefront/v1/campaigns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/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{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "RUNNING",
"attributes": {},
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"tiers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"content": {
"Title": {
"name": "Title",
"type": "input",
"value": "Value of the title"
},
"BannerImage": {
"alt": "Alternative description for the image",
"href": "Href link for the image",
"name": "BannerImage",
"type": "image",
"value": "https://URL_TO_IMAGE"
},
"Description": {
"name": "Name of the description",
"type": "input",
"value": "Value of the description"
}
},
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"from": 0,
"to": 9,
"count": 10
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Starting record index, starting from 0
Ending record index, starting from 0
Filter by campaign type The campaign type
BEHAVIOR, COUPONS, PUNCH_CARDS, REFERRALS, SCORE_STREAKS Filter by brand id
Filter campaigns that a customer can participate
Filter by campaign status
RUNNING, PAUSED, SCHEDULED, FINISHED, NOT FINISHED Filter by campaign labels (, separated values)
Filter by platform name
Filter by store id. Campaigns with stores = null are included because they have no store restriction; campaigns with a non-empty stores array are included only when it contains this id; campaigns with stores = [] are excluded.
Filter by channel id. Campaigns with channels = null are included because they have no channel restriction; campaigns with a non-empty channels array are included only when it contains this id; campaigns with channels = [] are excluded.
Filter by product id. Campaigns with products = null are included because they have no product restriction; campaigns with a non-empty products array are included only when it contains this id; campaigns with products = [] are excluded.
Filter by tier id. Campaigns with tiers = null are included because they have no tier restriction; campaigns with a non-empty tiers array are included only when it contains this id; campaigns with tiers = [] are excluded.
Filter by funder
Whether to include additional data inside attributes Only applies to COUPONS campaigns
CODES_SUMMARY