Call opportunities
Update opportunities
PATCH
/
api
/
opportunities
/
{id}
/
Update opportunities
curl --request PATCH \
--url https://api.prod.peerlogic.com/api/opportunities/{id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"is_open": true
}
'import requests
url = "https://api.prod.peerlogic.com/api/opportunities/{id}/"
payload = { "is_open": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_open: true})
};
fetch('https://api.prod.peerlogic.com/api/opportunities/{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://api.prod.peerlogic.com/api/opportunities/{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([
'is_open' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.prod.peerlogic.com/api/opportunities/{id}/"
payload := strings.NewReader("{\n \"is_open\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.prod.peerlogic.com/api/opportunities/{id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"is_open\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.peerlogic.com/api/opportunities/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"is_open\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"followed_up_at": "2023-11-07T05:31:56Z",
"is_open": true,
"status": "success",
"trigger_type": "missed_call",
"opportunity_origin_type": "call_connected",
"originated_at": "2023-11-07T05:31:56Z",
"originating_call_id": "<string>",
"resolving_call_id": "<string>",
"has_any_follow_up": true
}{
"sort": [
"Select a valid choice."
]
}{
"detail": "'Authorization' header is required"
}{
"message": "No permissions assigned to permit access to this endpoint."
}{
"detail": "The requested resource was not found."
}Authorizations
Bearer access token issued by Peerlogic.
Path Parameters
A unique value identifying this opportunity.
Body
application/json
Response
Successful response for update opportunities.
Minimum string length:
1Available options:
success, failure, omitted Available options:
missed_call, missed_call_existing_patient, missed_call_cancellation_reschedule, missed_call_current_appointment, missed_call_non_business, missed_call_business, high_value_missed_call, connected_call, connected_call_existing_patient, connected_call_new_patient, connected_call_high_value, lost_opportunity, lost_opportunity_new_patient, lost_opportunity_existing_patient, lost_opportunity_high_value, aimee_escalation, aimee_booked, aimee_reschedule, aimee_cancellation, aimee_inbound_message, extracted_opportunity, care_task_handed_off, voip_integration_disconnect, ehr_integration_disconnect, fax_inbound_received, fax_outbound_failed Available options:
call_connected, call_missed, message_received, voicemail_received Was this page helpful?
Update opportunities
curl --request PATCH \
--url https://api.prod.peerlogic.com/api/opportunities/{id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"is_open": true
}
'import requests
url = "https://api.prod.peerlogic.com/api/opportunities/{id}/"
payload = { "is_open": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_open: true})
};
fetch('https://api.prod.peerlogic.com/api/opportunities/{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://api.prod.peerlogic.com/api/opportunities/{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([
'is_open' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.prod.peerlogic.com/api/opportunities/{id}/"
payload := strings.NewReader("{\n \"is_open\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.prod.peerlogic.com/api/opportunities/{id}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"is_open\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.peerlogic.com/api/opportunities/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"is_open\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"followed_up_at": "2023-11-07T05:31:56Z",
"is_open": true,
"status": "success",
"trigger_type": "missed_call",
"opportunity_origin_type": "call_connected",
"originated_at": "2023-11-07T05:31:56Z",
"originating_call_id": "<string>",
"resolving_call_id": "<string>",
"has_any_follow_up": true
}{
"sort": [
"Select a valid choice."
]
}{
"detail": "'Authorization' header is required"
}{
"message": "No permissions assigned to permit access to this endpoint."
}{
"detail": "The requested resource was not found."
}