Consumers
GET /consumers/distribution
Get distribution of consumer attribute values for visualization
GET
/
consumers
/
distribution
cURL
curl --request GET \
--url https://admin.fanfare.io/api/consumers/distribution \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://admin.fanfare.io/api/consumers/distribution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://admin.fanfare.io/api/consumers/distribution"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://admin.fanfare.io/api/consumers/distribution"
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))
}{
"buckets": [
{
"maxValue": "<string>",
"minValue": "<string>",
"percentage": 123,
"range": "<string>",
"value": 123,
"x": 123
}
],
"field": "<string>",
"stats": {
"max": "<string>",
"mean": "<string>",
"median": "<string>",
"min": "<string>",
"stdDev": "<string>"
},
"totalCount": 123,
"cachedAt": "2023-11-07T05:31:56Z"
}{
"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.
⌘I
cURL
curl --request GET \
--url https://admin.fanfare.io/api/consumers/distribution \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://admin.fanfare.io/api/consumers/distribution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://admin.fanfare.io/api/consumers/distribution"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://admin.fanfare.io/api/consumers/distribution"
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))
}{
"buckets": [
{
"maxValue": "<string>",
"minValue": "<string>",
"percentage": 123,
"range": "<string>",
"value": 123,
"x": 123
}
],
"field": "<string>",
"stats": {
"max": "<string>",
"mean": "<string>",
"median": "<string>",
"min": "<string>",
"stdDev": "<string>"
},
"totalCount": 123,
"cachedAt": "2023-11-07T05:31:56Z"
}{
"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>"
}