Other Operations
Preview Routing
Returns the assignees that would be selected by routing rules for a hypothetical lead matching the supplied name, email and other attributes. Useful for previewing routing before creating the lead.
Notes:
- firstName and email are required.
- The response lists one entry per role matched by routing.
POST
/
v1.0
/
leads
/
assignee
Preview Routing
curl --request POST \
--url https://api.lofty.com/v1.0/leads/assignee \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"firstName": "Bob",
"email": "123456789@gmail.com",
"lastName": "Li",
"phone": "1234567890",
"birthday": "Jun 5, 2001"
}
'import requests
url = "https://api.lofty.com/v1.0/leads/assignee"
payload = {
"firstName": "Bob",
"email": "123456789@gmail.com",
"lastName": "Li",
"phone": "1234567890",
"birthday": "Jun 5, 2001"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
firstName: 'Bob',
email: '123456789@gmail.com',
lastName: 'Li',
phone: '1234567890',
birthday: 'Jun 5, 2001'
})
};
fetch('https://api.lofty.com/v1.0/leads/assignee', 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.lofty.com/v1.0/leads/assignee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'Bob',
'email' => '123456789@gmail.com',
'lastName' => 'Li',
'phone' => '1234567890',
'birthday' => 'Jun 5, 2001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v1.0/leads/assignee"
payload := strings.NewReader("{\n \"firstName\": \"Bob\",\n \"email\": \"123456789@gmail.com\",\n \"lastName\": \"Li\",\n \"phone\": \"1234567890\",\n \"birthday\": \"Jun 5, 2001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lofty.com/v1.0/leads/assignee")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"firstName\": \"Bob\",\n \"email\": \"123456789@gmail.com\",\n \"lastName\": \"Li\",\n \"phone\": \"1234567890\",\n \"birthday\": \"Jun 5, 2001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/leads/assignee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"firstName\": \"Bob\",\n \"email\": \"123456789@gmail.com\",\n \"lastName\": \"Li\",\n \"phone\": \"1234567890\",\n \"birthday\": \"Jun 5, 2001\"\n}"
response = http.request(request)
puts response.read_body[
{
"leadId": 123,
"leadUserId": 123,
"firstName": "<string>",
"lastName": "<string>",
"customRoleAssignees": [
{
"agentFullName": "<string>",
"roleId": 123,
"role": "<string>",
"assigneeId": 123,
"assignee": "<string>",
"permissionProfileName": "<string>"
}
]
}
]"<string>""<string>""<string>"Body
application/json
Hypothetical lead info used to resolve assignees.
The first name of the lead
Example:
"Bob"
The email address associated with the lead
Example:
"123456789@gmail.com"
The last name of the lead
Example:
"Li"
The phone number associated with the lead. (No more than 20 characters per phone)
Example:
"1234567890"
The birthday of the lead(pattern:MMM d, yyyy)
Example:
"Jun 5, 2001"
⌘I
Preview Routing
curl --request POST \
--url https://api.lofty.com/v1.0/leads/assignee \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"firstName": "Bob",
"email": "123456789@gmail.com",
"lastName": "Li",
"phone": "1234567890",
"birthday": "Jun 5, 2001"
}
'import requests
url = "https://api.lofty.com/v1.0/leads/assignee"
payload = {
"firstName": "Bob",
"email": "123456789@gmail.com",
"lastName": "Li",
"phone": "1234567890",
"birthday": "Jun 5, 2001"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
firstName: 'Bob',
email: '123456789@gmail.com',
lastName: 'Li',
phone: '1234567890',
birthday: 'Jun 5, 2001'
})
};
fetch('https://api.lofty.com/v1.0/leads/assignee', 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.lofty.com/v1.0/leads/assignee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'Bob',
'email' => '123456789@gmail.com',
'lastName' => 'Li',
'phone' => '1234567890',
'birthday' => 'Jun 5, 2001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lofty.com/v1.0/leads/assignee"
payload := strings.NewReader("{\n \"firstName\": \"Bob\",\n \"email\": \"123456789@gmail.com\",\n \"lastName\": \"Li\",\n \"phone\": \"1234567890\",\n \"birthday\": \"Jun 5, 2001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.lofty.com/v1.0/leads/assignee")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"firstName\": \"Bob\",\n \"email\": \"123456789@gmail.com\",\n \"lastName\": \"Li\",\n \"phone\": \"1234567890\",\n \"birthday\": \"Jun 5, 2001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/leads/assignee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"firstName\": \"Bob\",\n \"email\": \"123456789@gmail.com\",\n \"lastName\": \"Li\",\n \"phone\": \"1234567890\",\n \"birthday\": \"Jun 5, 2001\"\n}"
response = http.request(request)
puts response.read_body[
{
"leadId": 123,
"leadUserId": 123,
"firstName": "<string>",
"lastName": "<string>",
"customRoleAssignees": [
{
"agentFullName": "<string>",
"roleId": 123,
"role": "<string>",
"assigneeId": 123,
"assignee": "<string>",
"permissionProfileName": "<string>"
}
]
}
]"<string>""<string>""<string>"