Messaging
Send a message
Sends an SMS or MMS message to a contact using the practice’s configured outbound messaging number.
POST
/
api
/
care
/
message
/
Send a message
curl --request POST \
--url https://api.prod.peerlogic.com/api/care/message/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"practice_id": "<string>",
"contact_phone_number": "+15105550123",
"message": "<string>",
"mms_media": [
"<string>"
]
}
'import requests
url = "https://api.prod.peerlogic.com/api/care/message/"
payload = {
"practice_id": "<string>",
"contact_phone_number": "+15105550123",
"message": "<string>",
"mms_media": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
practice_id: '<string>',
contact_phone_number: '+15105550123',
message: '<string>',
mms_media: ['<string>']
})
};
fetch('https://api.prod.peerlogic.com/api/care/message/', 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/care/message/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'practice_id' => '<string>',
'contact_phone_number' => '+15105550123',
'message' => '<string>',
'mms_media' => [
'<string>'
]
]),
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/care/message/"
payload := strings.NewReader("{\n \"practice_id\": \"<string>\",\n \"contact_phone_number\": \"+15105550123\",\n \"message\": \"<string>\",\n \"mms_media\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.prod.peerlogic.com/api/care/message/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"practice_id\": \"<string>\",\n \"contact_phone_number\": \"+15105550123\",\n \"message\": \"<string>\",\n \"mms_media\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.peerlogic.com/api/care/message/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"practice_id\": \"<string>\",\n \"contact_phone_number\": \"+15105550123\",\n \"message\": \"<string>\",\n \"mms_media\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"practice_contact": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"name_first": "<string>",
"name_last": "<string>",
"name_middle": "<string>",
"name_preferred": "<string>",
"organization": "<string>",
"title": "<string>",
"email": "jsmith@example.com",
"phone_numbers": [
{
"id": "<string>",
"phone_number": "<string>",
"source_type": "call",
"sip_caller_name": "<string>",
"is_primary_contact": true,
"phone_number_type": "home"
}
],
"address_line_1": "<string>",
"address_line_2": "<string>",
"address_city": "<string>",
"address_state": "<string>",
"zip_code": "<string>",
"date_of_birth": "2023-12-25",
"gender": "male",
"manually_edited_fields": "<string>"
},
"content_object": "<string>",
"interaction_type": "call",
"practice_phone_number": "<string>",
"contact_phone_number": "<string>",
"interaction_direction": "inbound",
"is_viewed": true
}{
"practice_id": [
"This field is required."
]
}{
"detail": "'Authorization' header is required"
}{
"message": "No permissions assigned to permit access to this endpoint."
}{
"error": "The connected practice-management system could not fulfill the request."
}Authorizations
Bearer access token issued by Peerlogic.
Body
application/json
Response
Message accepted and recorded as a practice interaction.
Minimum string length:
1Show child attributes
Show child attributes
Available options:
call, message, voicemail, conversation_webchat, conversation_voicechat, conversation_sms, fax Minimum string length:
1Minimum string length:
1Available options:
inbound, outbound, not_applicable Was this page helpful?
Send a message
curl --request POST \
--url https://api.prod.peerlogic.com/api/care/message/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"practice_id": "<string>",
"contact_phone_number": "+15105550123",
"message": "<string>",
"mms_media": [
"<string>"
]
}
'import requests
url = "https://api.prod.peerlogic.com/api/care/message/"
payload = {
"practice_id": "<string>",
"contact_phone_number": "+15105550123",
"message": "<string>",
"mms_media": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
practice_id: '<string>',
contact_phone_number: '+15105550123',
message: '<string>',
mms_media: ['<string>']
})
};
fetch('https://api.prod.peerlogic.com/api/care/message/', 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/care/message/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'practice_id' => '<string>',
'contact_phone_number' => '+15105550123',
'message' => '<string>',
'mms_media' => [
'<string>'
]
]),
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/care/message/"
payload := strings.NewReader("{\n \"practice_id\": \"<string>\",\n \"contact_phone_number\": \"+15105550123\",\n \"message\": \"<string>\",\n \"mms_media\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.prod.peerlogic.com/api/care/message/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"practice_id\": \"<string>\",\n \"contact_phone_number\": \"+15105550123\",\n \"message\": \"<string>\",\n \"mms_media\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.peerlogic.com/api/care/message/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"practice_id\": \"<string>\",\n \"contact_phone_number\": \"+15105550123\",\n \"message\": \"<string>\",\n \"mms_media\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"practice_contact": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"name_first": "<string>",
"name_last": "<string>",
"name_middle": "<string>",
"name_preferred": "<string>",
"organization": "<string>",
"title": "<string>",
"email": "jsmith@example.com",
"phone_numbers": [
{
"id": "<string>",
"phone_number": "<string>",
"source_type": "call",
"sip_caller_name": "<string>",
"is_primary_contact": true,
"phone_number_type": "home"
}
],
"address_line_1": "<string>",
"address_line_2": "<string>",
"address_city": "<string>",
"address_state": "<string>",
"zip_code": "<string>",
"date_of_birth": "2023-12-25",
"gender": "male",
"manually_edited_fields": "<string>"
},
"content_object": "<string>",
"interaction_type": "call",
"practice_phone_number": "<string>",
"contact_phone_number": "<string>",
"interaction_direction": "inbound",
"is_viewed": true
}{
"practice_id": [
"This field is required."
]
}{
"detail": "'Authorization' header is required"
}{
"message": "No permissions assigned to permit access to this endpoint."
}{
"error": "The connected practice-management system could not fulfill the request."
}