Update an existing Sales Rep
curl --request PATCH \
--url https://commerce.driv.ly/api/salesreps/{id} \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"agent": "<string>",
"address": "<string>",
"primaryPhoneNumber": "<string>",
"primaryEmail": "<string>",
"lastName": "<string>",
"firstName": "<string>",
"emails": [
"<string>"
],
"phoneNumbers": [
"<string>"
],
"roles": [
"<string>"
],
"creditBands": [
"<string>"
],
"templates": [
"<string>"
],
"isAcceptingNewLeads": true
}
'import requests
url = "https://commerce.driv.ly/api/salesreps/{id}"
payload = {
"id": "<string>",
"agent": "<string>",
"address": "<string>",
"primaryPhoneNumber": "<string>",
"primaryEmail": "<string>",
"lastName": "<string>",
"firstName": "<string>",
"emails": ["<string>"],
"phoneNumbers": ["<string>"],
"roles": ["<string>"],
"creditBands": ["<string>"],
"templates": ["<string>"],
"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: '<string>',
agent: '<string>',
address: '<string>',
primaryPhoneNumber: '<string>',
primaryEmail: '<string>',
lastName: '<string>',
firstName: '<string>',
emails: ['<string>'],
phoneNumbers: ['<string>'],
roles: ['<string>'],
creditBands: ['<string>'],
templates: ['<string>'],
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' => '<string>',
'agent' => '<string>',
'address' => '<string>',
'primaryPhoneNumber' => '<string>',
'primaryEmail' => '<string>',
'lastName' => '<string>',
'firstName' => '<string>',
'emails' => [
'<string>'
],
'phoneNumbers' => [
'<string>'
],
'roles' => [
'<string>'
],
'creditBands' => [
'<string>'
],
'templates' => [
'<string>'
],
'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\": \"<string>\",\n \"agent\": \"<string>\",\n \"address\": \"<string>\",\n \"primaryPhoneNumber\": \"<string>\",\n \"primaryEmail\": \"<string>\",\n \"lastName\": \"<string>\",\n \"firstName\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"phoneNumbers\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"creditBands\": [\n \"<string>\"\n ],\n \"templates\": [\n \"<string>\"\n ],\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\": \"<string>\",\n \"agent\": \"<string>\",\n \"address\": \"<string>\",\n \"primaryPhoneNumber\": \"<string>\",\n \"primaryEmail\": \"<string>\",\n \"lastName\": \"<string>\",\n \"firstName\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"phoneNumbers\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"creditBands\": [\n \"<string>\"\n ],\n \"templates\": [\n \"<string>\"\n ],\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\": \"<string>\",\n \"agent\": \"<string>\",\n \"address\": \"<string>\",\n \"primaryPhoneNumber\": \"<string>\",\n \"primaryEmail\": \"<string>\",\n \"lastName\": \"<string>\",\n \"firstName\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"phoneNumbers\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"creditBands\": [\n \"<string>\"\n ],\n \"templates\": [\n \"<string>\"\n ],\n \"isAcceptingNewLeads\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"lastName": "<string>",
"firstName": "<string>",
"agent": "<string>",
"address": "<string>",
"primaryPhoneNumber": "<string>",
"primaryEmail": "<string>",
"emails": [
"<string>"
],
"phoneNumbers": [
"<string>"
],
"roles": [
"<string>"
],
"creditBands": [
"<string>"
],
"templates": [
"<string>"
],
"isAcceptingNewLeads": true
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}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": "<string>",
"agent": "<string>",
"address": "<string>",
"primaryPhoneNumber": "<string>",
"primaryEmail": "<string>",
"lastName": "<string>",
"firstName": "<string>",
"emails": [
"<string>"
],
"phoneNumbers": [
"<string>"
],
"roles": [
"<string>"
],
"creditBands": [
"<string>"
],
"templates": [
"<string>"
],
"isAcceptingNewLeads": true
}
'import requests
url = "https://commerce.driv.ly/api/salesreps/{id}"
payload = {
"id": "<string>",
"agent": "<string>",
"address": "<string>",
"primaryPhoneNumber": "<string>",
"primaryEmail": "<string>",
"lastName": "<string>",
"firstName": "<string>",
"emails": ["<string>"],
"phoneNumbers": ["<string>"],
"roles": ["<string>"],
"creditBands": ["<string>"],
"templates": ["<string>"],
"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: '<string>',
agent: '<string>',
address: '<string>',
primaryPhoneNumber: '<string>',
primaryEmail: '<string>',
lastName: '<string>',
firstName: '<string>',
emails: ['<string>'],
phoneNumbers: ['<string>'],
roles: ['<string>'],
creditBands: ['<string>'],
templates: ['<string>'],
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' => '<string>',
'agent' => '<string>',
'address' => '<string>',
'primaryPhoneNumber' => '<string>',
'primaryEmail' => '<string>',
'lastName' => '<string>',
'firstName' => '<string>',
'emails' => [
'<string>'
],
'phoneNumbers' => [
'<string>'
],
'roles' => [
'<string>'
],
'creditBands' => [
'<string>'
],
'templates' => [
'<string>'
],
'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\": \"<string>\",\n \"agent\": \"<string>\",\n \"address\": \"<string>\",\n \"primaryPhoneNumber\": \"<string>\",\n \"primaryEmail\": \"<string>\",\n \"lastName\": \"<string>\",\n \"firstName\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"phoneNumbers\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"creditBands\": [\n \"<string>\"\n ],\n \"templates\": [\n \"<string>\"\n ],\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\": \"<string>\",\n \"agent\": \"<string>\",\n \"address\": \"<string>\",\n \"primaryPhoneNumber\": \"<string>\",\n \"primaryEmail\": \"<string>\",\n \"lastName\": \"<string>\",\n \"firstName\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"phoneNumbers\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"creditBands\": [\n \"<string>\"\n ],\n \"templates\": [\n \"<string>\"\n ],\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\": \"<string>\",\n \"agent\": \"<string>\",\n \"address\": \"<string>\",\n \"primaryPhoneNumber\": \"<string>\",\n \"primaryEmail\": \"<string>\",\n \"lastName\": \"<string>\",\n \"firstName\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"phoneNumbers\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"creditBands\": [\n \"<string>\"\n ],\n \"templates\": [\n \"<string>\"\n ],\n \"isAcceptingNewLeads\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"lastName": "<string>",
"firstName": "<string>",
"agent": "<string>",
"address": "<string>",
"primaryPhoneNumber": "<string>",
"primaryEmail": "<string>",
"emails": [
"<string>"
],
"phoneNumbers": [
"<string>"
],
"roles": [
"<string>"
],
"creditBands": [
"<string>"
],
"templates": [
"<string>"
],
"isAcceptingNewLeads": true
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}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 }
⌘I