Restore a Lead version by its id
curl --request POST \
--url https://commerce.driv.ly/api/leads/versions/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://commerce.driv.ly/api/leads/versions/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://commerce.driv.ly/api/leads/versions/{id}', 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://commerce.driv.ly/api/leads/versions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://commerce.driv.ly/api/leads/versions/{id}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://commerce.driv.ly/api/leads/versions/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/leads/versions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"doc": {
"updatedAt": "<string>",
"createdAt": "<string>",
"latestEvent": 123,
"notes": "<string>",
"statusTracker": "<string>",
"searches": [
123
],
"attachments": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"call": "<string>",
"zipcode": "<string>",
"email": "<string>",
"loginEmail": "<string>",
"purchaseOption": "<string>",
"timeToPurchase": [],
"monthlyPayment": 123,
"budgetLower": "<string>",
"budgetUpper": "<string>",
"mileageLower": 123,
"mileageUpper": 123,
"cashDown": 123,
"newOrUsed": "<string>",
"bodyStyle": [],
"carStyle": [],
"truckStyle": [],
"suvStyle": [],
"vanStyle": [],
"yearLower": 123,
"yearUpper": 123,
"year": 123,
"make": "<string>",
"model": "<string>",
"exterior": [],
"interior": [],
"fuelType": [],
"drivetrain": [],
"transmission": [],
"comfort": [],
"safety": [],
"entertainment": [],
"utility": [],
"subscribe": true,
"agree": true,
"customer": "<string>",
"messageNotifications": true,
"emailNotifications": true,
"emailAlerts": true,
"emailOffers": true,
"leadEvents": [
123
],
"cfZipcode": "<string>",
"cfState": "<string>",
"cfCity": "<string>",
"completedDate": "<string>",
"localTime": "<string>",
"trade": [
123
],
"messages": [
123
],
"creditScore": "<string>",
"contactScore": "<string>",
"contactBelongsTo": "<string>",
"contactType": "<string>",
"contactValid": true,
"testingCustomer": true,
"estimatedAgeRange": "<string>",
"estimatedAddress": "<string>",
"estimatedZipcode": "<string>",
"meetings": [
123
],
"makeAndModel": "<string>",
"conversation": "<string>",
"city": "<string>",
"state": "<string>",
"preApprovalId": "<string>",
"vdpEmails": [
123
],
"favorites": [
123
],
"calls": [
123
],
"salesRep": 123,
"preApprovals": [
123
],
"anonymousId": "<string>",
"manual": true,
"trim": "<string>",
"oneOwner": true,
"customers": 123
},
"message": "<string>"
}{
"errors": [
{
"message": "<string>"
}
]
}Leads
Restore a Lead version by its id
Restore a Lead version by its id
POST
/
leads
/
versions
/
{id}
Restore a Lead version by its id
curl --request POST \
--url https://commerce.driv.ly/api/leads/versions/{id} \
--header 'Authorization: <api-key>'import requests
url = "https://commerce.driv.ly/api/leads/versions/{id}"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://commerce.driv.ly/api/leads/versions/{id}', 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://commerce.driv.ly/api/leads/versions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://commerce.driv.ly/api/leads/versions/{id}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://commerce.driv.ly/api/leads/versions/{id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/leads/versions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"doc": {
"updatedAt": "<string>",
"createdAt": "<string>",
"latestEvent": 123,
"notes": "<string>",
"statusTracker": "<string>",
"searches": [
123
],
"attachments": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"call": "<string>",
"zipcode": "<string>",
"email": "<string>",
"loginEmail": "<string>",
"purchaseOption": "<string>",
"timeToPurchase": [],
"monthlyPayment": 123,
"budgetLower": "<string>",
"budgetUpper": "<string>",
"mileageLower": 123,
"mileageUpper": 123,
"cashDown": 123,
"newOrUsed": "<string>",
"bodyStyle": [],
"carStyle": [],
"truckStyle": [],
"suvStyle": [],
"vanStyle": [],
"yearLower": 123,
"yearUpper": 123,
"year": 123,
"make": "<string>",
"model": "<string>",
"exterior": [],
"interior": [],
"fuelType": [],
"drivetrain": [],
"transmission": [],
"comfort": [],
"safety": [],
"entertainment": [],
"utility": [],
"subscribe": true,
"agree": true,
"customer": "<string>",
"messageNotifications": true,
"emailNotifications": true,
"emailAlerts": true,
"emailOffers": true,
"leadEvents": [
123
],
"cfZipcode": "<string>",
"cfState": "<string>",
"cfCity": "<string>",
"completedDate": "<string>",
"localTime": "<string>",
"trade": [
123
],
"messages": [
123
],
"creditScore": "<string>",
"contactScore": "<string>",
"contactBelongsTo": "<string>",
"contactType": "<string>",
"contactValid": true,
"testingCustomer": true,
"estimatedAgeRange": "<string>",
"estimatedAddress": "<string>",
"estimatedZipcode": "<string>",
"meetings": [
123
],
"makeAndModel": "<string>",
"conversation": "<string>",
"city": "<string>",
"state": "<string>",
"preApprovalId": "<string>",
"vdpEmails": [
123
],
"favorites": [
123
],
"calls": [
123
],
"salesRep": 123,
"preApprovals": [
123
],
"anonymousId": "<string>",
"manual": true,
"trim": "<string>",
"oneOwner": true,
"customers": 123
},
"message": "<string>"
}{
"errors": [
{
"message": "<string>"
}
]
}Usage with the Drivly SDK
Usage with the Drivly SDK
Make sure you install our SDK first. You can find out how, and more here.
import { SDK } from '@drivly/commerce'
import type { leads } from '@drivly/commerce'
const sdk = new SDK(...)
const leads = await sdk.leads.create(data: leads): Promise<leads>
Authorizations
Path Parameters
id of the Lead version
Query Parameters
number of levels to automatically populate relationships and uploads
retrieves document(s) in a specific locale
specifies a fallback locale if no locale value exists
⌘I