curl --request GET \
--url https://devapi.prov.ae/v2/public/leads/{id}/assignment \
--header 'Authorization: Bearer <token>'import requests
url = "https://devapi.prov.ae/v2/public/leads/{id}/assignment"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://devapi.prov.ae/v2/public/leads/{id}/assignment', 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://devapi.prov.ae/v2/public/leads/{id}/assignment",
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://devapi.prov.ae/v2/public/leads/{id}/assignment"
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://devapi.prov.ae/v2/public/leads/{id}/assignment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://devapi.prov.ae/v2/public/leads/{id}/assignment")
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_bodyWho a lead was assigned to
For most leads the agent is chosen by a routing engine that runs AFTER POST /public/leads has answered, so an ownerless lead on the create response is normal. This tells you whether an agent is coming.
Poll ~30s after creating the lead, then every retryAfterSeconds while status is pending, and stop at ~2 minutes. assigned, unassigned and pool are FINAL — stop polling. Better still, take the lead.assigned webhook and do not poll at all.
Returns the agent’s work contacts and the status only — nothing about the customer or the enquiry.
curl --request GET \
--url https://devapi.prov.ae/v2/public/leads/{id}/assignment \
--header 'Authorization: Bearer <token>'import requests
url = "https://devapi.prov.ae/v2/public/leads/{id}/assignment"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://devapi.prov.ae/v2/public/leads/{id}/assignment', 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://devapi.prov.ae/v2/public/leads/{id}/assignment",
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://devapi.prov.ae/v2/public/leads/{id}/assignment"
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://devapi.prov.ae/v2/public/leads/{id}/assignment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://devapi.prov.ae/v2/public/leads/{id}/assignment")
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_bodyAuthorizations
Response
Assignment state
Who a lead ended up with. Branch on status, not on whether agent is set.
assigned = a real agent owns it, contact them. pending = routing has not finished, ask again after retryAfterSeconds and tell the customer nothing yet. unassigned = routing ran and nobody took it; FINAL, send the generic reply and notify no one. pool = deliberately ownerless in a shared pool until an agent claims it; also a generic reply. unassigned and pool together account for roughly 30% of leads — they are not errors.
assigned, pending, unassigned, pool