Get a salesperson's performance metrics
curl --request GET \
--url https://app.flextell.ai/api/v1/salespeople/{id}/metrics \
--header 'Authorization: Bearer <token>' \
--header 'X-Tenant: <x-tenant>'import requests
url = "https://app.flextell.ai/api/v1/salespeople/{id}/metrics"
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
fetch('https://app.flextell.ai/api/v1/salespeople/{id}/metrics', 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.flextell.ai/api/v1/salespeople/{id}/metrics",
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>",
"X-Tenant: <x-tenant>"
],
]);
$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.flextell.ai/api/v1/salespeople/{id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Tenant", "<x-tenant>")
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.flextell.ai/api/v1/salespeople/{id}/metrics")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/salespeople/{id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"period": "<string>",
"from": "<string>",
"to": "<string>",
"timezone": "<string>",
"currency": "<string>",
"active_leads": 1,
"potential_value": 123,
"won": 1,
"lost": 1,
"win_rate": 123,
"converted_count": 1,
"converted_value": 123
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Salesperson
Get a salesperson's performance metrics
Active leads and potential value are the current snapshot; won, lost, win rate and conversions are counted inside the period. Values are in the tenant base currency.
GET
/
v1
/
salespeople
/
{id}
/
metrics
Get a salesperson's performance metrics
curl --request GET \
--url https://app.flextell.ai/api/v1/salespeople/{id}/metrics \
--header 'Authorization: Bearer <token>' \
--header 'X-Tenant: <x-tenant>'import requests
url = "https://app.flextell.ai/api/v1/salespeople/{id}/metrics"
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
fetch('https://app.flextell.ai/api/v1/salespeople/{id}/metrics', 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.flextell.ai/api/v1/salespeople/{id}/metrics",
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>",
"X-Tenant: <x-tenant>"
],
]);
$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.flextell.ai/api/v1/salespeople/{id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Tenant", "<x-tenant>")
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.flextell.ai/api/v1/salespeople/{id}/metrics")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/salespeople/{id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"period": "<string>",
"from": "<string>",
"to": "<string>",
"timezone": "<string>",
"currency": "<string>",
"active_leads": 1,
"potential_value": 123,
"won": 1,
"lost": 1,
"win_rate": 123,
"converted_count": 1,
"converted_value": 123
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Yetkilendirmeler
oauth2bearer
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Yol Parametreleri
The salesperson identifier
Sorgu Parametreleri
The reporting period for won, lost and converted leads. Defaults to last_30_days. Active leads and potential value are always the current snapshot.
Mevcut seçenekler:
last_7_days, last_30_days, last_90_days, this_year, all, custom, null Custom period start date (Y-m-d, tenant-local, inclusive). Used when period is custom; omitted means unbounded.
Custom period end date (Y-m-d, tenant-local, inclusive). Used when period is custom; must not be before from.