Listar clientes del segmento
curl --request GET \
--url https://api.bevits.com/v1/segments/{segment_id}/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bevits.com/v1/segments/{segment_id}/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bevits.com/v1/segments/{segment_id}/customers', 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://api.bevits.com/v1/segments/{segment_id}/customers",
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://api.bevits.com/v1/segments/{segment_id}/customers"
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://api.bevits.com/v1/segments/{segment_id}/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/segments/{segment_id}/customers")
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{
"has_more": true,
"data": [
{
"object": "customer",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"html_url": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "<string>",
"is_subscribed": true,
"is_subscribed_to_email": true,
"total_spent_in_cents": 123,
"total_orders": 123,
"first_purchase_date": "2023-11-07T05:31:56Z",
"last_purchase_date": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "Invalid query parameters.",
"param": "limit",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Referencia
Listar clientes del segmento
Lista los clientes del segmento y permite ordenarlos por el valor total comprado.
GET
/
v1
/
segments
/
{segment_id}
/
customers
Listar clientes del segmento
curl --request GET \
--url https://api.bevits.com/v1/segments/{segment_id}/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bevits.com/v1/segments/{segment_id}/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bevits.com/v1/segments/{segment_id}/customers', 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://api.bevits.com/v1/segments/{segment_id}/customers",
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://api.bevits.com/v1/segments/{segment_id}/customers"
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://api.bevits.com/v1/segments/{segment_id}/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/segments/{segment_id}/customers")
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{
"has_more": true,
"data": [
{
"object": "customer",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"html_url": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"source": "<string>",
"is_subscribed": true,
"is_subscribed_to_email": true,
"total_spent_in_cents": 123,
"total_orders": 123,
"first_purchase_date": "2023-11-07T05:31:56Z",
"last_purchase_date": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "Invalid query parameters.",
"param": "limit",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Autorizaciones
Clave API creada en la configuración de la organización.
Parámetros de ruta
ID público del segmento.
Pattern:
^seg_[A-Za-z0-9_-]+$Parámetros de consulta
Cantidad máxima de elementos por página.
Rango requerido:
1 <= x <= 100ID del último cliente de la página anterior.
Pattern:
^cus_[A-Za-z0-9_-]+$Email exacto del cliente.
Teléfono del cliente, de 3 a 32 caracteres.
Required string length:
3 - 32Filtra clientes por etiqueta.
Pattern:
^tag_[A-Za-z0-9_-]+$Filtra clientes por el estado de la suscripción.
Incluye elementos creados desde este instante, inclusive.
Incluye elementos creados hasta este instante, inclusive.
Incluye clientes actualizados desde este instante, inclusive.
Texto de búsqueda, con hasta 256 caracteres.
Required string length:
1 - 256Ordena por actualización o valor total comprado.
Opciones disponibles:
updated, total_spent