Audiences
PUT /audiences/loyalty-tiers/{groupId}
Update loyalty tier audiences in a group
PUT
/
audiences
/
loyalty-tiers
/
{groupId}
cURL
curl --request PUT \
--url https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groupName": "<string>",
"tiers": [
{
"name": "<string>",
"order": 123,
"startValue": 123,
"endValue": 123,
"iconName": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groupName: '<string>',
tiers: [
{
name: '<string>',
order: 123,
startValue: 123,
endValue: 123,
iconName: '<string>'
}
]
})
};
fetch('https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId}"
payload = {
"groupName": "<string>",
"tiers": [
{
"name": "<string>",
"order": 123,
"startValue": 123,
"endValue": 123,
"iconName": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId}"
payload := strings.NewReader("{\n \"groupName\": \"<string>\",\n \"tiers\": [\n {\n \"name\": \"<string>\",\n \"order\": 123,\n \"startValue\": 123,\n \"endValue\": 123,\n \"iconName\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"audiences": [
{
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imports": [
{
"archived": true,
"audienceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"errorCount": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"processedConsumers": 123,
"progress": 123,
"s3Key": "<string>",
"status": "PENDING",
"errors": [
{
"issues": [
"<unknown>"
],
"row": 123
}
],
"totalConsumers": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
}
],
"name": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rules": [
{
"audienceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"field": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"operator": "EQUALS",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"values": [
"<string>"
],
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"position": 0
}
],
"type": "DYNAMIC",
"description": "<string>",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupName": "<string>",
"groupType": "SEGMENTED_VALUE",
"iconName": "<string>",
"lastRefreshedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"primaryExternalId": "<string>",
"primaryLastSyncedAt": "2023-11-07T05:31:56Z",
"primarySourceVendor": "<string>",
"primarySyncSource": {
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"syncSource": "<string>",
"syncSourceId": "<string>",
"lastSyncedAt": "2023-11-07T05:31:56Z",
"sourceData": {},
"syncStatus": "PENDING",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
},
"primarySyncSourceId": "<string>",
"refreshIntervalSeconds": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
}
],
"tierGroup": "<string>"
}{
"error": "validation_error",
"issues": [
{
"expected": "<string>",
"kind": "<string>",
"message": "<string>",
"path": [
{
"input": "<unknown>",
"key": "<string>",
"origin": "<string>",
"type": "<string>"
}
],
"received": "<string>",
"type": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Fanfare secret key. Keep secret credentials on your server.
Path Parameters
Body
application/json
⌘I
cURL
curl --request PUT \
--url https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groupName": "<string>",
"tiers": [
{
"name": "<string>",
"order": 123,
"startValue": 123,
"endValue": 123,
"iconName": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groupName: '<string>',
tiers: [
{
name: '<string>',
order: 123,
startValue: 123,
endValue: 123,
iconName: '<string>'
}
]
})
};
fetch('https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId}"
payload = {
"groupName": "<string>",
"tiers": [
{
"name": "<string>",
"order": 123,
"startValue": 123,
"endValue": 123,
"iconName": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://admin.fanfare.io/api/audiences/loyalty-tiers/{groupId}"
payload := strings.NewReader("{\n \"groupName\": \"<string>\",\n \"tiers\": [\n {\n \"name\": \"<string>\",\n \"order\": 123,\n \"startValue\": 123,\n \"endValue\": 123,\n \"iconName\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"audiences": [
{
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imports": [
{
"archived": true,
"audienceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"errorCount": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"processedConsumers": 123,
"progress": 123,
"s3Key": "<string>",
"status": "PENDING",
"errors": [
{
"issues": [
"<unknown>"
],
"row": 123
}
],
"totalConsumers": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
}
],
"name": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rules": [
{
"audienceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"field": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"operator": "EQUALS",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"values": [
"<string>"
],
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"position": 0
}
],
"type": "DYNAMIC",
"description": "<string>",
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupName": "<string>",
"groupType": "SEGMENTED_VALUE",
"iconName": "<string>",
"lastRefreshedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"primaryExternalId": "<string>",
"primaryLastSyncedAt": "2023-11-07T05:31:56Z",
"primarySourceVendor": "<string>",
"primarySyncSource": {
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"syncSource": "<string>",
"syncSourceId": "<string>",
"lastSyncedAt": "2023-11-07T05:31:56Z",
"sourceData": {},
"syncStatus": "PENDING",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
},
"primarySyncSourceId": "<string>",
"refreshIntervalSeconds": 123,
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
}
],
"tierGroup": "<string>"
}{
"error": "validation_error",
"issues": [
{
"expected": "<string>",
"kind": "<string>",
"message": "<string>",
"path": [
{
"input": "<unknown>",
"key": "<string>",
"origin": "<string>",
"type": "<string>"
}
],
"received": "<string>",
"type": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}