Retrieve a Sales Rep
curl --request GET \
--url https://commerce.driv.ly/api/salesreps/{id}import requests
url = "https://commerce.driv.ly/api/salesreps/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$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/salesreps/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://commerce.driv.ly/api/salesreps/{id}")
.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::Get.new(url)
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
Retrieve a Sales Rep
GET
/
salesreps
/
{id}
Retrieve a Sales Rep
curl --request GET \
--url https://commerce.driv.ly/api/salesreps/{id}import requests
url = "https://commerce.driv.ly/api/salesreps/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
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 => "GET",
]);
$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/salesreps/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://commerce.driv.ly/api/salesreps/{id}")
.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::Get.new(url)
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
Response
Sales Rep Found
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