Update an existing Sales Rep
curl --request PATCH \
--url https://commerce.driv.ly/api/salesreps/{id} \
--header 'Content-Type: application/json' \
--data '
{
"id": "srep_8f9v2j1kd92j",
"emails": [
"sales.rep@example.com",
"contact@example.com"
],
"lastName": "Smith",
"firstName": "Alice",
"templates": [
"Welcome Template",
"Follow-up Template"
],
"creditBands": [
"Prime",
"Subprime"
],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": [
"+1-555-0123",
"+1-555-0456"
],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": true
}
'import requests
url = "https://commerce.driv.ly/api/salesreps/{id}"
payload = {
"id": "srep_8f9v2j1kd92j",
"emails": ["sales.rep@example.com", "contact@example.com"],
"lastName": "Smith",
"firstName": "Alice",
"templates": ["Welcome Template", "Follow-up Template"],
"creditBands": ["Prime", "Subprime"],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": ["+1-555-0123", "+1-555-0456"],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'srep_8f9v2j1kd92j',
emails: ['sales.rep@example.com', 'contact@example.com'],
lastName: 'Smith',
firstName: 'Alice',
templates: ['Welcome Template', 'Follow-up Template'],
creditBands: ['Prime', 'Subprime'],
primaryEmail: 'sales.rep@example.com',
phoneNumbers: ['+1-555-0123', '+1-555-0456'],
primaryPhoneNumber: '+1-555-0123',
isAcceptingNewLeads: true
})
};
fetch('https://commerce.driv.ly/api/salesreps/{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/salesreps/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'srep_8f9v2j1kd92j',
'emails' => [
'sales.rep@example.com',
'contact@example.com'
],
'lastName' => 'Smith',
'firstName' => 'Alice',
'templates' => [
'Welcome Template',
'Follow-up Template'
],
'creditBands' => [
'Prime',
'Subprime'
],
'primaryEmail' => 'sales.rep@example.com',
'phoneNumbers' => [
'+1-555-0123',
'+1-555-0456'
],
'primaryPhoneNumber' => '+1-555-0123',
'isAcceptingNewLeads' => true
]),
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://commerce.driv.ly/api/salesreps/{id}"
payload := strings.NewReader("{\n \"id\": \"srep_8f9v2j1kd92j\",\n \"emails\": [\n \"sales.rep@example.com\",\n \"contact@example.com\"\n ],\n \"lastName\": \"Smith\",\n \"firstName\": \"Alice\",\n \"templates\": [\n \"Welcome Template\",\n \"Follow-up Template\"\n ],\n \"creditBands\": [\n \"Prime\",\n \"Subprime\"\n ],\n \"primaryEmail\": \"sales.rep@example.com\",\n \"phoneNumbers\": [\n \"+1-555-0123\",\n \"+1-555-0456\"\n ],\n \"primaryPhoneNumber\": \"+1-555-0123\",\n \"isAcceptingNewLeads\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://commerce.driv.ly/api/salesreps/{id}")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"srep_8f9v2j1kd92j\",\n \"emails\": [\n \"sales.rep@example.com\",\n \"contact@example.com\"\n ],\n \"lastName\": \"Smith\",\n \"firstName\": \"Alice\",\n \"templates\": [\n \"Welcome Template\",\n \"Follow-up Template\"\n ],\n \"creditBands\": [\n \"Prime\",\n \"Subprime\"\n ],\n \"primaryEmail\": \"sales.rep@example.com\",\n \"phoneNumbers\": [\n \"+1-555-0123\",\n \"+1-555-0456\"\n ],\n \"primaryPhoneNumber\": \"+1-555-0123\",\n \"isAcceptingNewLeads\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/salesreps/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"srep_8f9v2j1kd92j\",\n \"emails\": [\n \"sales.rep@example.com\",\n \"contact@example.com\"\n ],\n \"lastName\": \"Smith\",\n \"firstName\": \"Alice\",\n \"templates\": [\n \"Welcome Template\",\n \"Follow-up Template\"\n ],\n \"creditBands\": [\n \"Prime\",\n \"Subprime\"\n ],\n \"primaryEmail\": \"sales.rep@example.com\",\n \"phoneNumbers\": [\n \"+1-555-0123\",\n \"+1-555-0456\"\n ],\n \"primaryPhoneNumber\": \"+1-555-0123\",\n \"isAcceptingNewLeads\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "srep_8f9v2j1kd92j",
"emails": [
"sales.rep@example.com",
"contact@example.com"
],
"lastName": "Smith",
"firstName": "Alice",
"templates": [
"Welcome Template",
"Follow-up Template"
],
"creditBands": [
"Prime",
"Subprime"
],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": [
"+1-555-0123",
"+1-555-0456"
],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": true
},
"success": true
}{
"error": {
"code": 401,
"message": "Unauthorized"
},
"success": false
}{
"error": {
"code": 404,
"message": "Sales Rep Not Found"
},
"success": false
}{
"error": {
"code": 429,
"message": "Too Many Requests"
},
"success": false
}Sales
Update an existing Sales Rep
PATCH
/
salesreps
/
{id}
Update an existing Sales Rep
curl --request PATCH \
--url https://commerce.driv.ly/api/salesreps/{id} \
--header 'Content-Type: application/json' \
--data '
{
"id": "srep_8f9v2j1kd92j",
"emails": [
"sales.rep@example.com",
"contact@example.com"
],
"lastName": "Smith",
"firstName": "Alice",
"templates": [
"Welcome Template",
"Follow-up Template"
],
"creditBands": [
"Prime",
"Subprime"
],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": [
"+1-555-0123",
"+1-555-0456"
],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": true
}
'import requests
url = "https://commerce.driv.ly/api/salesreps/{id}"
payload = {
"id": "srep_8f9v2j1kd92j",
"emails": ["sales.rep@example.com", "contact@example.com"],
"lastName": "Smith",
"firstName": "Alice",
"templates": ["Welcome Template", "Follow-up Template"],
"creditBands": ["Prime", "Subprime"],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": ["+1-555-0123", "+1-555-0456"],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'srep_8f9v2j1kd92j',
emails: ['sales.rep@example.com', 'contact@example.com'],
lastName: 'Smith',
firstName: 'Alice',
templates: ['Welcome Template', 'Follow-up Template'],
creditBands: ['Prime', 'Subprime'],
primaryEmail: 'sales.rep@example.com',
phoneNumbers: ['+1-555-0123', '+1-555-0456'],
primaryPhoneNumber: '+1-555-0123',
isAcceptingNewLeads: true
})
};
fetch('https://commerce.driv.ly/api/salesreps/{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/salesreps/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'srep_8f9v2j1kd92j',
'emails' => [
'sales.rep@example.com',
'contact@example.com'
],
'lastName' => 'Smith',
'firstName' => 'Alice',
'templates' => [
'Welcome Template',
'Follow-up Template'
],
'creditBands' => [
'Prime',
'Subprime'
],
'primaryEmail' => 'sales.rep@example.com',
'phoneNumbers' => [
'+1-555-0123',
'+1-555-0456'
],
'primaryPhoneNumber' => '+1-555-0123',
'isAcceptingNewLeads' => true
]),
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://commerce.driv.ly/api/salesreps/{id}"
payload := strings.NewReader("{\n \"id\": \"srep_8f9v2j1kd92j\",\n \"emails\": [\n \"sales.rep@example.com\",\n \"contact@example.com\"\n ],\n \"lastName\": \"Smith\",\n \"firstName\": \"Alice\",\n \"templates\": [\n \"Welcome Template\",\n \"Follow-up Template\"\n ],\n \"creditBands\": [\n \"Prime\",\n \"Subprime\"\n ],\n \"primaryEmail\": \"sales.rep@example.com\",\n \"phoneNumbers\": [\n \"+1-555-0123\",\n \"+1-555-0456\"\n ],\n \"primaryPhoneNumber\": \"+1-555-0123\",\n \"isAcceptingNewLeads\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://commerce.driv.ly/api/salesreps/{id}")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"srep_8f9v2j1kd92j\",\n \"emails\": [\n \"sales.rep@example.com\",\n \"contact@example.com\"\n ],\n \"lastName\": \"Smith\",\n \"firstName\": \"Alice\",\n \"templates\": [\n \"Welcome Template\",\n \"Follow-up Template\"\n ],\n \"creditBands\": [\n \"Prime\",\n \"Subprime\"\n ],\n \"primaryEmail\": \"sales.rep@example.com\",\n \"phoneNumbers\": [\n \"+1-555-0123\",\n \"+1-555-0456\"\n ],\n \"primaryPhoneNumber\": \"+1-555-0123\",\n \"isAcceptingNewLeads\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/salesreps/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"srep_8f9v2j1kd92j\",\n \"emails\": [\n \"sales.rep@example.com\",\n \"contact@example.com\"\n ],\n \"lastName\": \"Smith\",\n \"firstName\": \"Alice\",\n \"templates\": [\n \"Welcome Template\",\n \"Follow-up Template\"\n ],\n \"creditBands\": [\n \"Prime\",\n \"Subprime\"\n ],\n \"primaryEmail\": \"sales.rep@example.com\",\n \"phoneNumbers\": [\n \"+1-555-0123\",\n \"+1-555-0456\"\n ],\n \"primaryPhoneNumber\": \"+1-555-0123\",\n \"isAcceptingNewLeads\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "srep_8f9v2j1kd92j",
"emails": [
"sales.rep@example.com",
"contact@example.com"
],
"lastName": "Smith",
"firstName": "Alice",
"templates": [
"Welcome Template",
"Follow-up Template"
],
"creditBands": [
"Prime",
"Subprime"
],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": [
"+1-555-0123",
"+1-555-0456"
],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": true
},
"success": true
}{
"error": {
"code": 401,
"message": "Unauthorized"
},
"success": false
}{
"error": {
"code": 404,
"message": "Sales Rep Not Found"
},
"success": false
}{
"error": {
"code": 429,
"message": "Too Many Requests"
},
"success": false
}Path Parameters
Contact is uniquely identified by id
Query Parameters
The number of levels of related objects to include in the response
Body
application/json
Contact is uniquely identified by id
Contact is automated Agent
Contact has Address
Contact has Primary Phone Number
Pattern:
^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$Contact has Primary Email
Contact has Last Name
Contact has First Name
Contact has Email
Contact has Phone Number
Pattern:
^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$Contact has Role
Sales Rep accepts leads from Credit Band
Sales Rep uses Template
Sales Rep is accepting new leads
Response
Sales Rep Updated
Show child attributes
Show child attributes
Example:
{
"id": "srep_8f9v2j1kd92j",
"emails": [
"sales.rep@example.com",
"contact@example.com"
],
"lastName": "Smith",
"firstName": "Alice",
"templates": ["Welcome Template", "Follow-up Template"],
"creditBands": ["Prime", "Subprime"],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": ["+1-555-0123", "+1-555-0456"],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": true
}