Create a lead (callback, quote, finance, insurance) with the buyer's consent
curl --request POST \
--url https://api.truckaurbus.com/v1/leads \
--header 'Content-Type: application/json' \
--data '
{
"buyer_name": "<string>",
"buyer_phone": "<string>",
"consent": true,
"buyer_pin": "<string>",
"dealer_id": 123,
"intent": "exploring",
"kind": "callback",
"locale": "en",
"location_id": 123,
"notes": "<string>",
"vehicle_ref": "<string>",
"wants_finance": false,
"wants_insurance": false,
"dealer_slug": ""
}
'import requests
url = "https://api.truckaurbus.com/v1/leads"
payload = {
"buyer_name": "<string>",
"buyer_phone": "<string>",
"consent": True,
"buyer_pin": "<string>",
"dealer_id": 123,
"intent": "exploring",
"kind": "callback",
"locale": "en",
"location_id": 123,
"notes": "<string>",
"vehicle_ref": "<string>",
"wants_finance": False,
"wants_insurance": False,
"dealer_slug": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
buyer_name: '<string>',
buyer_phone: '<string>',
consent: true,
buyer_pin: '<string>',
dealer_id: 123,
intent: 'exploring',
kind: 'callback',
locale: 'en',
location_id: 123,
notes: '<string>',
vehicle_ref: '<string>',
wants_finance: false,
wants_insurance: false,
dealer_slug: ''
})
};
fetch('https://api.truckaurbus.com/v1/leads', 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.truckaurbus.com/v1/leads",
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([
'buyer_name' => '<string>',
'buyer_phone' => '<string>',
'consent' => true,
'buyer_pin' => '<string>',
'dealer_id' => 123,
'intent' => 'exploring',
'kind' => 'callback',
'locale' => 'en',
'location_id' => 123,
'notes' => '<string>',
'vehicle_ref' => '<string>',
'wants_finance' => false,
'wants_insurance' => false,
'dealer_slug' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.truckaurbus.com/v1/leads"
payload := strings.NewReader("{\n \"buyer_name\": \"<string>\",\n \"buyer_phone\": \"<string>\",\n \"consent\": true,\n \"buyer_pin\": \"<string>\",\n \"dealer_id\": 123,\n \"intent\": \"exploring\",\n \"kind\": \"callback\",\n \"locale\": \"en\",\n \"location_id\": 123,\n \"notes\": \"<string>\",\n \"vehicle_ref\": \"<string>\",\n \"wants_finance\": false,\n \"wants_insurance\": false,\n \"dealer_slug\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.truckaurbus.com/v1/leads")
.header("Content-Type", "application/json")
.body("{\n \"buyer_name\": \"<string>\",\n \"buyer_phone\": \"<string>\",\n \"consent\": true,\n \"buyer_pin\": \"<string>\",\n \"dealer_id\": 123,\n \"intent\": \"exploring\",\n \"kind\": \"callback\",\n \"locale\": \"en\",\n \"location_id\": 123,\n \"notes\": \"<string>\",\n \"vehicle_ref\": \"<string>\",\n \"wants_finance\": false,\n \"wants_insurance\": false,\n \"dealer_slug\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truckaurbus.com/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"buyer_name\": \"<string>\",\n \"buyer_phone\": \"<string>\",\n \"consent\": true,\n \"buyer_pin\": \"<string>\",\n \"dealer_id\": 123,\n \"intent\": \"exploring\",\n \"kind\": \"callback\",\n \"locale\": \"en\",\n \"location_id\": 123,\n \"notes\": \"<string>\",\n \"vehicle_ref\": \"<string>\",\n \"wants_finance\": false,\n \"wants_insurance\": false,\n \"dealer_slug\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"buyer_phone_masked": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": 123,
"kind": "<string>",
"status": "<string>",
"dealer_id": 123,
"dealer_name": "<string>",
"vehicle_ref": "<string>"
}v1
Create a lead (callback, quote, finance, insurance) with the buyer's consent
Create a lead for a dealer (callback, quote, finance or insurance) with the buyer’s explicit consent; your key’s prefix is recorded as the source.
POST
/
v1
/
leads
Create a lead (callback, quote, finance, insurance) with the buyer's consent
curl --request POST \
--url https://api.truckaurbus.com/v1/leads \
--header 'Content-Type: application/json' \
--data '
{
"buyer_name": "<string>",
"buyer_phone": "<string>",
"consent": true,
"buyer_pin": "<string>",
"dealer_id": 123,
"intent": "exploring",
"kind": "callback",
"locale": "en",
"location_id": 123,
"notes": "<string>",
"vehicle_ref": "<string>",
"wants_finance": false,
"wants_insurance": false,
"dealer_slug": ""
}
'import requests
url = "https://api.truckaurbus.com/v1/leads"
payload = {
"buyer_name": "<string>",
"buyer_phone": "<string>",
"consent": True,
"buyer_pin": "<string>",
"dealer_id": 123,
"intent": "exploring",
"kind": "callback",
"locale": "en",
"location_id": 123,
"notes": "<string>",
"vehicle_ref": "<string>",
"wants_finance": False,
"wants_insurance": False,
"dealer_slug": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
buyer_name: '<string>',
buyer_phone: '<string>',
consent: true,
buyer_pin: '<string>',
dealer_id: 123,
intent: 'exploring',
kind: 'callback',
locale: 'en',
location_id: 123,
notes: '<string>',
vehicle_ref: '<string>',
wants_finance: false,
wants_insurance: false,
dealer_slug: ''
})
};
fetch('https://api.truckaurbus.com/v1/leads', 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.truckaurbus.com/v1/leads",
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([
'buyer_name' => '<string>',
'buyer_phone' => '<string>',
'consent' => true,
'buyer_pin' => '<string>',
'dealer_id' => 123,
'intent' => 'exploring',
'kind' => 'callback',
'locale' => 'en',
'location_id' => 123,
'notes' => '<string>',
'vehicle_ref' => '<string>',
'wants_finance' => false,
'wants_insurance' => false,
'dealer_slug' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.truckaurbus.com/v1/leads"
payload := strings.NewReader("{\n \"buyer_name\": \"<string>\",\n \"buyer_phone\": \"<string>\",\n \"consent\": true,\n \"buyer_pin\": \"<string>\",\n \"dealer_id\": 123,\n \"intent\": \"exploring\",\n \"kind\": \"callback\",\n \"locale\": \"en\",\n \"location_id\": 123,\n \"notes\": \"<string>\",\n \"vehicle_ref\": \"<string>\",\n \"wants_finance\": false,\n \"wants_insurance\": false,\n \"dealer_slug\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.truckaurbus.com/v1/leads")
.header("Content-Type", "application/json")
.body("{\n \"buyer_name\": \"<string>\",\n \"buyer_phone\": \"<string>\",\n \"consent\": true,\n \"buyer_pin\": \"<string>\",\n \"dealer_id\": 123,\n \"intent\": \"exploring\",\n \"kind\": \"callback\",\n \"locale\": \"en\",\n \"location_id\": 123,\n \"notes\": \"<string>\",\n \"vehicle_ref\": \"<string>\",\n \"wants_finance\": false,\n \"wants_insurance\": false,\n \"dealer_slug\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.truckaurbus.com/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"buyer_name\": \"<string>\",\n \"buyer_phone\": \"<string>\",\n \"consent\": true,\n \"buyer_pin\": \"<string>\",\n \"dealer_id\": 123,\n \"intent\": \"exploring\",\n \"kind\": \"callback\",\n \"locale\": \"en\",\n \"location_id\": 123,\n \"notes\": \"<string>\",\n \"vehicle_ref\": \"<string>\",\n \"wants_finance\": false,\n \"wants_insurance\": false,\n \"dealer_slug\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"buyer_phone_masked": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": 123,
"kind": "<string>",
"status": "<string>",
"dealer_id": 123,
"dealer_name": "<string>",
"vehicle_ref": "<string>"
}Body
application/json
Response
OK

