curl --request GET \
--url https://app.masivo.ai/api/storefront/v1/rewards \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.masivo.ai/api/storefront/v1/rewards"
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/rewards', 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/rewards",
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/rewards"
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/rewards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/rewards")
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",
"brand_id": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"team_ids": [
"<string>"
],
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": {},
"platforms": [
"<string>"
],
"labels": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"tiers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"name": "<string>",
"description": "<string>",
"type": "POINTS",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"primitive": "string",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
}
]
}Get rewards
Get all rewards. Rewards are created and managed from the dashboard; there is no API endpoint to create one. To reference a reward as a rule effect’s reward_id when creating a campaign, first create it from the dashboard, then look up its id here.
curl --request GET \
--url https://app.masivo.ai/api/storefront/v1/rewards \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.masivo.ai/api/storefront/v1/rewards"
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/rewards', 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/rewards",
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/rewards"
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/rewards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/rewards")
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",
"brand_id": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"team_ids": [
"<string>"
],
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": {},
"platforms": [
"<string>"
],
"labels": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"tiers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"name": "<string>",
"description": "<string>",
"type": "POINTS",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"primitive": "string",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
}
]
}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
The brand id to filter rewards
The type of the reward
POINTS, DISCOUNT, GIFT_CARD, PRODUCT Filter rewards by platform name
Filter by store id. Rewards with stores = null are included because they have no store restriction; rewards with a non-empty stores array are included only when it contains this id; rewards with stores = [] are excluded.
Filter by channel id. Rewards with channels = null are included because they have no channel restriction; rewards with a non-empty channels array are included only when it contains this id; rewards with channels = [] are excluded.
Filter by product id. Rewards with products = null are included because they have no product restriction; rewards with a non-empty products array are included only when it contains this id; rewards with products = [] are excluded.
Filter by tier id. Rewards with tiers = null are included because they have no tier restriction; rewards with a non-empty tiers array are included only when it contains this id; rewards with tiers = [] are excluded.
Response
Ok
Show child attributes
Show child attributes