Contacts
List all contacts
GET
/
contacts
cURL
curl --request GET \
--url https://api.caspen.com/v1/contactsimport requests
url = "https://api.caspen.com/v1/contacts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.caspen.com/v1/contacts', 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.caspen.com/v1/contacts",
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://api.caspen.com/v1/contacts"
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://api.caspen.com/v1/contacts")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/contacts")
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": "con_01HQFQ9QWTNNPY58FZ8CB3FWWK",
"type": "third_party_payer",
"title": "Dr",
"first_name": "John",
"last_name": "Smith",
"preferred_name": "Johnny",
"profession": "General Practitioner",
"company": "City Medical Centre",
"email": "john.smith@citymedical.com",
"notes": "Preferred referrer for orthopedic cases.",
"phone_numbers": [
{
"id": "pho_01HQR12PABCD1234EFGH56789",
"code": "+61",
"number": "400123456",
"type": "mobile"
}
],
"address": {
"line1": "123 Medical Street",
"line2": "Suite 4",
"city": "Sydney",
"state": "NSW",
"postal_code": "2000",
"country_code": "AU"
},
"tag_ids": [
"tag_01HYHYQHA682J0K1RW7B2HVA9F",
"tag_01HYHYW37MTYJPMT5JV4RN99GK"
],
"created_at": "2024-01-01T12:00:00Z"
}
],
"links": {
"prev": "<string>",
"next": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}⌘I
cURL
curl --request GET \
--url https://api.caspen.com/v1/contactsimport requests
url = "https://api.caspen.com/v1/contacts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.caspen.com/v1/contacts', 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.caspen.com/v1/contacts",
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://api.caspen.com/v1/contacts"
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://api.caspen.com/v1/contacts")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/contacts")
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": "con_01HQFQ9QWTNNPY58FZ8CB3FWWK",
"type": "third_party_payer",
"title": "Dr",
"first_name": "John",
"last_name": "Smith",
"preferred_name": "Johnny",
"profession": "General Practitioner",
"company": "City Medical Centre",
"email": "john.smith@citymedical.com",
"notes": "Preferred referrer for orthopedic cases.",
"phone_numbers": [
{
"id": "pho_01HQR12PABCD1234EFGH56789",
"code": "+61",
"number": "400123456",
"type": "mobile"
}
],
"address": {
"line1": "123 Medical Street",
"line2": "Suite 4",
"city": "Sydney",
"state": "NSW",
"postal_code": "2000",
"country_code": "AU"
},
"tag_ids": [
"tag_01HYHYQHA682J0K1RW7B2HVA9F",
"tag_01HYHYW37MTYJPMT5JV4RN99GK"
],
"created_at": "2024-01-01T12:00:00Z"
}
],
"links": {
"prev": "<string>",
"next": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}