NAV
php python javascript bash

Penga API Documentation

The following documentation is a provided as reference guide for the Penga RESTful API.

1. Users

Endpoints for managing Users.

Get Current.

Get the current logged on User's info.

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "U-00000007",
    "name": "Dentists Owner",
    "first_name": "Dentists",
    "last_name": "Owner",
    "email": "admin@eg-dentists.co.uk",
    "activated": 1,
    "mobile": "07123456789",
    "mobile_verified": 1,
    "description": "The Boss of Our Company",
    "remember_token": "cFS0N215UGX87T64ptWUPOhUSBDuQyNCH9FfYaznzOg1CXhvTfNaow7jtPX6",
    "undelete_token": "Ryc0JkHO2OJxS9YgoqXgeYGxL7LmArZWHnmIYdvdRfbR2bslVAjdLO4mDzsn4UzD",
    "card_last4": "4242",
    "created_at": 1677253403,
    "updated_at": 1677253534,
    "deleted_at": null,
    "appointment_statuses": [
        {
            "external_id": "AS-00000003",
            "name": "Completed",
            "description": "Appointment Completed",
            "color": "#22e5ff",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AS-00000002",
            "name": "Cancelled",
            "description": "Appointment Cancelled",
            "color": "#E0A800",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AS-00000001",
            "name": "Pending",
            "description": "Appointment Pending",
            "color": "#00d422",
            "created_at": 1677253402,
            "updated_at": 1677253402
        }
    ],
    "appointment_types": [
        {
            "external_id": "AT-00000005",
            "name": "Consultation",
            "description": "Consultation Appointment",
            "color": "#807dba",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AT-00000004",
            "name": "Follow Up",
            "description": "Follow Up Appointment",
            "color": "#f2d69e",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "description": "Dental Checkup",
            "color": "#41ab5d",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AT-00000002",
            "name": "Orthodontic",
            "description": "Orthodontic Appointment",
            "color": "#e08214",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AT-00000001",
            "name": "General",
            "description": "General Dental Appointments",
            "color": "#c1fffb",
            "created_at": 1677253402,
            "updated_at": 1677253402
        }
    ],
    "display_formats_date": [
        {
            "id": 1,
            "date_display_format": "jS M y",
            "date_display_format_moment_js": "Do MMM YY",
            "date_display_format_representation": "22nd Aug 18"
        },
        {
            "id": 2,
            "date_display_format": "M jS y",
            "date_display_format_moment_js": "MMM Do YY",
            "date_display_format_representation": "Aug 22nd 18"
        },
        {
            "id": 3,
            "date_display_format": "d-m-Y",
            "date_display_format_moment_js": "DD-MM-YYYY",
            "date_display_format_representation": "22-08-2018"
        },
        {
            "id": 4,
            "date_display_format": "Y-m-d",
            "date_display_format_moment_js": "YYYY-MM-DD",
            "date_display_format_representation": "2018-08-22"
        }
    ],
    "display_formats_time": [
        {
            "id": 1,
            "time_display_format": "g:ia",
            "time_display_format_moment_js": "h:mma",
            "time_display_format_representation": "8:30pm"
        },
        {
            "id": 2,
            "time_display_format": "h:ia",
            "time_display_format_moment_js": "hh:mma",
            "time_display_format_representation": "08:30pm"
        },
        {
            "id": 3,
            "time_display_format": "h:i:sa",
            "time_display_format_moment_js": "hh:mm:ssa",
            "time_display_format_representation": "08:30:32pm"
        },
        {
            "id": 4,
            "time_display_format": "H:ia",
            "time_display_format_moment_js": "HH:mm",
            "time_display_format_representation": "20:30"
        },
        {
            "id": 5,
            "time_display_format": "h:i:s",
            "time_display_format_moment_js": "HH:mm:ss",
            "time_display_format_representation": "20:30:32"
        }
    ],
    "display_formats_date_time": [
        {
            "id": 1,
            "date_and_time_display_format": "jS M y - g:ia",
            "date_and_time_display_format_moment_js": "Do MMM YY - h:mma",
            "date_and_time_display_format_representation": "22nd Aug 18 - 8:15pm"
        },
        {
            "id": 2,
            "date_and_time_display_format": "M jS y - g:ia",
            "date_and_time_display_format_moment_js": "MMM Do YY - h:mma",
            "date_and_time_display_format_representation": "Aug 22nd 18 - 8:15pm"
        },
        {
            "id": 3,
            "date_and_time_display_format": "jS M Y - g:ia",
            "date_and_time_display_format_moment_js": "Do MMM YYYY - h:mma",
            "date_and_time_display_format_representation": "22nd Aug 2018 - 8:15pm"
        },
        {
            "id": 4,
            "date_and_time_display_format": "M jS Y - g:ia",
            "date_and_time_display_format_moment_js": "MMM Do YYYY - h:mma",
            "date_and_time_display_format_representation": "Aug 22nd 2018 - 8:15pm"
        },
        {
            "id": 5,
            "date_and_time_display_format": "jS M Y - g:i:sa",
            "date_and_time_display_format_moment_js": "Do MMM YYYY - h:mm:ssa",
            "date_and_time_display_format_representation": "22nd Aug 2018 - 8:15:32pm"
        },
        {
            "id": 6,
            "date_and_time_display_format": "M jS Y - g:i:sa",
            "date_and_time_display_format_moment_js": "MMM Do YYYY - h:mm:ssa",
            "date_and_time_display_format_representation": "Aug 22nd 2018 - 8:15:32pm"
        },
        {
            "id": 7,
            "date_and_time_display_format": "jS M Y - h:i",
            "date_and_time_display_format_moment_js": "Do MMM YYYY - hh:mm",
            "date_and_time_display_format_representation": "22nd Aug 2018 - 20:15"
        },
        {
            "id": 8,
            "date_and_time_display_format": "M jS Y - h:i",
            "date_and_time_display_format_moment_js": "MMM Do YYYY - hh:mm",
            "date_and_time_display_format_representation": "Aug 22nd 2018 - 20:15"
        },
        {
            "id": 9,
            "date_and_time_display_format": "Y-m-d h:i",
            "date_and_time_display_format_moment_js": "YYYY-MM-DD hh:mm",
            "date_and_time_display_format_representation": "2018-08-22 20:15"
        },
        {
            "id": 10,
            "date_and_time_display_format": "d-m-Y h:i",
            "date_and_time_display_format_moment_js": "DD-MM-YYYY hh:mm",
            "date_and_time_display_format_representation": "22-08-2018 20:15"
        },
        {
            "id": 11,
            "date_and_time_display_format": "Y-m-d h:i:s",
            "date_and_time_display_format_moment_js": "YYYY-MM-DD hh:mm:ss",
            "date_and_time_display_format_representation": "2018-08-22 20:15:32"
        },
        {
            "id": 12,
            "date_and_time_display_format": "m-d-Y h:i:s",
            "date_and_time_display_format_moment_js": "MM-DD-YYYY hh:mm:ss",
            "date_and_time_display_format_representation": "08-22-2018 20:15:32"
        }
    ],
    "roles": [
        {
            "external_id": "R-00000001",
            "name": "Organistion Owner",
            "slug": "owner",
            "description": "Admin for a Registered Organisation",
            "level": 100
        }
    ],
    "profile": {
        "theme_id": 1,
        "avatar": null,
        "avatar_status": 0,
        "created_at": 1677253403,
        "updated_at": 1677253403
    },
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9",
            "created_at": 1677253401,
            "updated_at": 1677253401
        }
    ],
    "organisation": {
        "external_id": "O-00000002",
        "name": "The Dentists",
        "description": "The Dentists",
        "suspended_at": null,
        "limits": {
            "user_limit": 20,
            "client_limit": 1000,
            "department_limit": 20,
            "appointmenttype_limit": 100,
            "appointmentstatus_limit": 10,
            "smstemplate_limit": 10,
            "smscampaign_limit": 0,
            "smscampaign_recipients_limit": 100
        }
    },
    "organisation_properties": {
        "address_id": null,
        "name": "E.G Dentists",
        "description": "The Tooth Factory",
        "telephone": null,
        "logo": "/images/e-g-dentists.png",
        "logo_status": 1,
        "created_at": 1677253401,
        "updated_at": 1677253401,
        "address": null
    },
    "settings_general": {
        "account_activation_enabled": 1,
        "two_factor_auth_enabled": 0,
        "two_factor_auth_notification_method_id": 3,
        "new_appointment_sms_notifications_enabled": 1,
        "appointment_sms_reminders_enabled": 1,
        "appointment_sms_reminder_delay_id": 4,
        "two_factor_auth_notification_method": {
            "id": 3,
            "name": "SMS and Email",
            "description": "Email and Mobile Text Message"
        },
        "appointment_sms_reminder_delay": {
            "id": 4,
            "delay_seconds": "3600",
            "delay_representation": "One Hour Before"
        }
    },
    "settings_preferences": {
        "date_and_time_display_format_id": 1,
        "notes_panels_per_page": 4,
        "sms_panels_per_page": 4,
        "appointment_history_panels_per_page": 4,
        "open_views_in_new_tab": 1,
        "date_and_time_display_format": {
            "id": 1,
            "date_and_time_display_format": "jS M y - g:ia",
            "date_and_time_display_format_moment_js": "Do MMM YY - h:mma",
            "date_and_time_display_format_representation": "22nd Aug 18 - 8:15pm"
        }
    },
    "settings_appointments": {
        "table_per_page": 1,
        "time_display_format_id": 1,
        "date_display_format_id": 1,
        "time_separator": " : ",
        "date_separator": " : ",
        "time_display_format": {
            "id": 1,
            "time_display_format": "g:ia",
            "time_display_format_moment_js": "h:mma",
            "time_display_format_representation": "8:30pm"
        },
        "date_display_format": {
            "id": 1,
            "date_display_format": "jS M y",
            "date_display_format_moment_js": "Do MMM YY",
            "date_display_format_representation": "22nd Aug 18"
        }
    },
    "settings_appointment_types": {
        "table_per_page": 1
    },
    "settings_appointment_statuses": {
        "table_per_page": 1
    },
    "settings_clients": {
        "table_per_page": 1
    },
    "settings_departments": {
        "table_per_page": 1
    },
    "settings_users": {
        "table_per_page": 1
    },
    "settings_organisations": {
        "table_per_page": 1
    },
    "settings_sms_templates": {
        "table_per_page": 1
    },
    "settings_sms_messages": {
        "table_per_page": 1
    },
    "settings_sms_campaigns": {
        "table_per_page": 1
    },
    "settings_department_calendars": {
        "table_per_page": 1
    },
    "settings_user_calendars": {
        "table_per_page": 1
    },
    "theme": [
        {
            "id": 1,
            "name": "Default",
            "link": "null",
            "notes": null,
            "status": 1,
            "taggable_type": "theme",
            "taggable_id": 1,
            "created_at": "2023-02-24T15:43:18.000000Z",
            "updated_at": "2023-02-24T15:43:18.000000Z",
            "deleted_at": null
        }
    ]
}

HTTP Request

GET user

Get All Deleted Users.

Get all Users that have been deleted, but not permanently deleted.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/deleted',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/deleted'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/deleted"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/deleted" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[]

HTTP Request

GET user/deleted

Search.

Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Dentist',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/search'
params = {
  'searchTerm': 'Dentist',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/user/search"
);

let params = {
    "searchTerm": "Dentist",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/search?searchTerm=Dentist" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253556,
        "roles": [
            {
                "external_id": "R-00000001",
                "name": "Organistion Owner",
                "description": "Admin for a Registered Organisation"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "description": "Managerial Staff",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "U-00000012",
        "name": "Dentists Bookings Only",
        "first_name": "Dentists",
        "last_name": "Bookings Only",
        "email": "bookingsonly@eg-dentists.co.uk",
        "mobile": "07678901234",
        "description": "Telephone Booking Line User",
        "created_at": 1677253404,
        "updated_at": 1677253404,
        "roles": [
            {
                "external_id": "R-00000006",
                "name": "Employee Bookings Only",
                "description": "Employee can only be booked against"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "description": "General Dentistry Department",
                "color": "#B4B7BA"
            }
        ]
    },
    {
        "external_id": "U-00000008",
        "name": "Dentists Admin",
        "first_name": "Dentists",
        "last_name": "Admin",
        "email": "user@eg-dentists.co.uk",
        "mobile": "07234567890",
        "description": "Shift Manager",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000002",
                "name": "Admin User",
                "description": "Admin User, create edit, delete"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "description": "Managerial Staff",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "U-00000009",
        "name": "Dentists RW Employee",
        "first_name": "Dentists",
        "last_name": "Read Write",
        "email": "readwrite@eg-dentists.co.uk",
        "mobile": "07345678901",
        "description": "Dental Hygienist",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000003",
                "name": "Employee Read Write",
                "description": "Employee can View, and Edit Calendar"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "description": "Calendar Administrators",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "U-00000010",
        "name": "Dentists RW Own Employee",
        "first_name": "Dentists",
        "last_name": "Read Write Own",
        "email": "readwriteown@eg-dentists.co.uk",
        "mobile": "07456789012",
        "description": "Reception Desk",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000004",
                "name": "Employee Read Write Limited",
                "description": "Employee can View, and Edit Calendar"
            }
        ],
        "departments": []
    },
    {
        "external_id": "U-00000011",
        "name": "Dentists RO Employee",
        "first_name": "Dentists",
        "last_name": "Read Only",
        "email": "readonly@eg-dentists.co.uk",
        "mobile": "07567890123",
        "description": "Accounting Department Read Only User",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000005",
                "name": "Employee Read Only",
                "description": "Employee can View Calendar"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "description": "Calendar Administrators",
                "color": "#88B04B"
            }
        ]
    }
]

HTTP Request

GET user/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get All.

Get all Users.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/all',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/all'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/all"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/all" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253558,
        "roles": [
            {
                "external_id": "R-00000001",
                "name": "Organistion Owner",
                "description": "Admin for a Registered Organisation"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "description": "Managerial Staff",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "U-00000008",
        "name": "Dentists Admin",
        "first_name": "Dentists",
        "last_name": "Admin",
        "email": "user@eg-dentists.co.uk",
        "mobile": "07234567890",
        "description": "Shift Manager",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000002",
                "name": "Admin User",
                "description": "Admin User, create edit, delete"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "description": "Managerial Staff",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "U-00000009",
        "name": "Dentists RW Employee",
        "first_name": "Dentists",
        "last_name": "Read Write",
        "email": "readwrite@eg-dentists.co.uk",
        "mobile": "07345678901",
        "description": "Dental Hygienist",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000003",
                "name": "Employee Read Write",
                "description": "Employee can View, and Edit Calendar"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "description": "Calendar Administrators",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "U-00000010",
        "name": "Dentists RW Own Employee",
        "first_name": "Dentists",
        "last_name": "Read Write Own",
        "email": "readwriteown@eg-dentists.co.uk",
        "mobile": "07456789012",
        "description": "Reception Desk",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000004",
                "name": "Employee Read Write Limited",
                "description": "Employee can View, and Edit Calendar"
            }
        ],
        "departments": []
    },
    {
        "external_id": "U-00000011",
        "name": "Dentists RO Employee",
        "first_name": "Dentists",
        "last_name": "Read Only",
        "email": "readonly@eg-dentists.co.uk",
        "mobile": "07567890123",
        "description": "Accounting Department Read Only User",
        "created_at": 1677253403,
        "updated_at": 1677253403,
        "roles": [
            {
                "external_id": "R-00000005",
                "name": "Employee Read Only",
                "description": "Employee can View Calendar"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "description": "Calendar Administrators",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "U-00000012",
        "name": "Dentists Bookings Only",
        "first_name": "Dentists",
        "last_name": "Bookings Only",
        "email": "bookingsonly@eg-dentists.co.uk",
        "mobile": "07678901234",
        "description": "Telephone Booking Line User",
        "created_at": 1677253404,
        "updated_at": 1677253404,
        "roles": [
            {
                "external_id": "R-00000006",
                "name": "Employee Bookings Only",
                "description": "Employee can only be booked against"
            }
        ],
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "description": "General Dentistry Department",
                "color": "#B4B7BA"
            }
        ]
    }
]

HTTP Request

GET user/all

Get One.

Get a User by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/U-00000007',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/U-00000007'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/U-00000007"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/U-00000007" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "U-00000007",
    "name": "Dentists Owner",
    "first_name": "Dentists",
    "last_name": "Owner",
    "email": "admin@eg-dentists.co.uk",
    "mobile": "07123456789",
    "description": "The Boss of Our Company",
    "created_at": 1677253403,
    "updated_at": 1677253560,
    "roles": [
        {
            "external_id": "R-00000001",
            "name": "Organistion Owner",
            "description": "Admin for a Registered Organisation"
        }
    ],
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9"
        }
    ]
}

HTTP Request

GET user/{userId}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.

Create.

Create a User.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/user',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'email' => 'nightshift@eg-dentists.co.uk',
            'role' => 'R-00000002',
            'first_name' => 'Night',
            'last_name' => 'Shift',
            'password' => 'dms3eTVZcEsjOA==',
            'password_confirmation' => 'dms3eTVZcEsjOA==',
            'name' => 'Night Manager',
            'description' => 'Night Shift Manager',
            'mobile' => '07789012345',
            'departments' => [
                'D-00000002',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user'
payload = {
    "email": "nightshift@eg-dentists.co.uk",
    "role": "R-00000002",
    "first_name": "Night",
    "last_name": "Shift",
    "password": "dms3eTVZcEsjOA==",
    "password_confirmation": "dms3eTVZcEsjOA==",
    "name": "Night Manager",
    "description": "Night Shift Manager",
    "mobile": "07789012345",
    "departments": [
        "D-00000002"
    ]
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/user"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "email": "nightshift@eg-dentists.co.uk",
    "role": "R-00000002",
    "first_name": "Night",
    "last_name": "Shift",
    "password": "dms3eTVZcEsjOA==",
    "password_confirmation": "dms3eTVZcEsjOA==",
    "name": "Night Manager",
    "description": "Night Shift Manager",
    "mobile": "07789012345",
    "departments": [
        "D-00000002"
    ]
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/user" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"email":"nightshift@eg-dentists.co.uk","role":"R-00000002","first_name":"Night","last_name":"Shift","password":"dms3eTVZcEsjOA==","password_confirmation":"dms3eTVZcEsjOA==","name":"Night Manager","description":"Night Shift Manager","mobile":"07789012345","departments":["D-00000002"]}'

Example response (200):

{
    "external_id": "U-00000032",
    "name": "Night Manager",
    "first_name": "Night",
    "last_name": "Shift",
    "email": "nightshift@eg-dentists.co.uk",
    "mobile": "07789012345",
    "description": "Night Shift Manager",
    "created_at": 1677253563,
    "updated_at": 1677253563,
    "roles": [
        {
            "external_id": "R-00000002",
            "name": "Admin User",
            "description": "Admin User, create edit, delete"
        }
    ],
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9"
        }
    ]
}

HTTP Request

POST user

Body Parameters

Parameter Type Status Description
email required optional The email address of the User. String, Max length 255.
role string required The role id to assign to the User. String. Length 10.
first_name string required The first name of the User. String, Max length 45.
last_name string required The last name of the User. String, Max length 45.
password string required The password for the User. Base64 Encoded String, Requirements: Must be at least 6 characters in length. Must be no more than 20 characters in length. Must contain at least one lowercase letter. Must contain at least one uppercase letter. Must contain at least one digit. Must contain a special character @$!%*#?&.
password_confirmation string required The confirmed password for the User.
name string optional optional The username for the User. String, Max length 40.
description string optional optional The description of the User. String, Max length 100.
mobile string optional optional The mobile phone number of the User. String, Length 11.
departments[0] array optional optional The departments of the User. Array.

Paginate All.

Paginate all Users. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/user/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner",
            "email": "admin@eg-dentists.co.uk",
            "mobile": "07123456789",
            "description": "The Boss of Our Company",
            "created_at": 1677253403,
            "updated_at": 1677253563,
            "roles": [
                {
                    "external_id": "R-00000001",
                    "name": "Organistion Owner",
                    "description": "Admin for a Registered Organisation"
                }
            ],
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "description": "Managerial Staff",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin",
            "email": "user@eg-dentists.co.uk",
            "mobile": "07234567890",
            "description": "Shift Manager",
            "created_at": 1677253403,
            "updated_at": 1677253403,
            "roles": [
                {
                    "external_id": "R-00000002",
                    "name": "Admin User",
                    "description": "Admin User, create edit, delete"
                }
            ],
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "description": "Managerial Staff",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/user/perpage/2?page=1",
    "from": 1,
    "last_page": 4,
    "last_page_url": "https://api.penga.uk/user/perpage/2?page=4",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/user/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/user/perpage/2?page=2",
    "path": "https://api.penga.uk/user/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 7
}

HTTP Request

GET user/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get by Username.

Get a User by username.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/byname/Dentists Admin',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/byname/Dentists Admin'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/byname/Dentists Admin"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/byname/Dentists Admin" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "U-00000008",
    "name": "Dentists Admin",
    "first_name": "Dentists",
    "last_name": "Admin",
    "email": "user@eg-dentists.co.uk",
    "mobile": "07234567890",
    "description": "Shift Manager",
    "created_at": 1677253403,
    "updated_at": 1677253403,
    "roles": [
        {
            "external_id": "R-00000002",
            "name": "Admin User",
            "description": "Admin User, create edit, delete"
        }
    ],
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9"
        }
    ]
}

HTTP Request

GET user/byname/{userName}

URL Parameters

Parameter Status Description
userName required The username of the User. String, Max length 25.

Paginate by Department.

Paginate all Users by Department id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/department/D-00000002/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/department/D-00000002/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/user/department/D-00000002/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/department/D-00000002/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin",
            "email": "user@eg-dentists.co.uk",
            "mobile": "07234567890",
            "description": "Shift Manager",
            "created_at": 1677253403,
            "updated_at": 1677253403,
            "roles": [
                {
                    "external_id": "R-00000002",
                    "name": "Admin User",
                    "description": "Admin User, create edit, delete"
                }
            ],
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "description": "Managerial Staff",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "U-00000032",
            "name": "Night Manager",
            "first_name": "Night",
            "last_name": "Shift",
            "email": "nightshift@eg-dentists.co.uk",
            "mobile": "07789012345",
            "description": "Night Shift Manager",
            "created_at": 1677253563,
            "updated_at": 1677253563,
            "roles": [
                {
                    "external_id": "R-00000002",
                    "name": "Admin User",
                    "description": "Admin User, create edit, delete"
                }
            ],
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "description": "Managerial Staff",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/user/department/D-00000002/perpage/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/user/department/D-00000002/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/department/D-00000002/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/user/department/D-00000002/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 2
}

HTTP Request

GET user/department/{departmentId}/perpage/{perPage}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginated Search.

Paginated Search Users by Username, First Name, Last Name or Email Address. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Dentist',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/search/perpage/2'
params = {
  'searchTerm': 'Dentist',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/user/search/perpage/2"
);

let params = {
    "searchTerm": "Dentist",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner",
            "email": "admin@eg-dentists.co.uk",
            "mobile": "07123456789",
            "description": "The Boss of Our Company",
            "created_at": 1677253403,
            "updated_at": 1677253569,
            "roles": [
                {
                    "external_id": "R-00000001",
                    "name": "Organistion Owner",
                    "description": "Admin for a Registered Organisation"
                }
            ],
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "description": "Managerial Staff",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin",
            "email": "user@eg-dentists.co.uk",
            "mobile": "07234567890",
            "description": "Shift Manager",
            "created_at": 1677253403,
            "updated_at": 1677253403,
            "roles": [
                {
                    "external_id": "R-00000002",
                    "name": "Admin User",
                    "description": "Admin User, create edit, delete"
                }
            ],
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "description": "Managerial Staff",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=1",
    "from": 1,
    "last_page": 4,
    "last_page_url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=4",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/user/search/perpage/2?searchTerm=Dentist&page=2",
    "path": "https://api.penga.uk/user/search/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 7
}

HTTP Request

GET user/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

User Account Restore.

Restore a Deleted User Account by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/undelete/U-00000032',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/undelete/U-00000032'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/undelete/U-00000032"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/undelete/U-00000032" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

GET user/undelete/{userId}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.

Update.

Update a User.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/user/U-00000032',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'email' => 'nightshift@eg-dentists.co.uk',
            'role' => 'R-00000002',
            'first_name' => 'Night',
            'last_name' => 'Shift',
            'password' => 'dms3eTVZcEsjOA==',
            'password_confirmation' => 'dms3eTVZcEsjOA==',
            'name' => 'nightmanager',
            'description' => 'Night Shift Manager',
            'mobile' => '07789012345',
            'departments' => [
                'D-00000002',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/U-00000032'
payload = {
    "email": "nightshift@eg-dentists.co.uk",
    "role": "R-00000002",
    "first_name": "Night",
    "last_name": "Shift",
    "password": "dms3eTVZcEsjOA==",
    "password_confirmation": "dms3eTVZcEsjOA==",
    "name": "nightmanager",
    "description": "Night Shift Manager",
    "mobile": "07789012345",
    "departments": [
        "D-00000002"
    ]
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/user/U-00000032"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "email": "nightshift@eg-dentists.co.uk",
    "role": "R-00000002",
    "first_name": "Night",
    "last_name": "Shift",
    "password": "dms3eTVZcEsjOA==",
    "password_confirmation": "dms3eTVZcEsjOA==",
    "name": "nightmanager",
    "description": "Night Shift Manager",
    "mobile": "07789012345",
    "departments": [
        "D-00000002"
    ]
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/user/U-00000032" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"email":"nightshift@eg-dentists.co.uk","role":"R-00000002","first_name":"Night","last_name":"Shift","password":"dms3eTVZcEsjOA==","password_confirmation":"dms3eTVZcEsjOA==","name":"nightmanager","description":"Night Shift Manager","mobile":"07789012345","departments":["D-00000002"]}'

Example response (200):

{
    "external_id": "U-00000032",
    "name": "nightmanager",
    "first_name": "Night",
    "last_name": "Shift",
    "email": "nightshift@eg-dentists.co.uk",
    "activated": 0,
    "mobile": "07789012345",
    "description": "Night Shift Manager",
    "created_at": 1677253563,
    "updated_at": 1677253574,
    "deleted_at": null,
    "roles": [
        {
            "external_id": "R-00000002",
            "name": "Admin User",
            "description": "Admin User, create edit, delete"
        }
    ],
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9"
        }
    ]
}

HTTP Request

PUT user/{userId}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.

Body Parameters

Parameter Type Status Description
email optional optional The email address of the User. String, Max length 255.
role string optional optional The role id to assign to the User. String. Length 10.
first_name optional required The first name of the User. String, Max length 45.
last_name optional required The last name of the User. String, Max length 45.
password string optional optional The password for the User. Base64 Encoded String, Requirements: Must be at least 6 characters in length. Must be no more than 20 characters in length. Must contain at least one lowercase letter. Must contain at least one uppercase letter. Must contain at least one digit. Must contain a special character @$!%*#?&.
password_confirmation string optional optional The confirmed password for the User.
name string optional optional The username for the User. String, Max length 40.
description string optional optional The description of the User. String, Max length 100.
mobile string optional optional The mobile phone number of the User. String, Length 11.
departments[0] array optional optional The departments of the User. Array.

Delete.

Delete a User.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/user/U-00000032',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/U-00000032'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/U-00000032"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/user/U-00000032" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE user/{userId}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.

Permanently Delete.

Permanently Delete a User.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/user/force/U-00000032',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/force/U-00000032'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/force/U-00000032"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/user/force/U-00000032" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": false
}

HTTP Request

DELETE user/force/{userId}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.

Get a Deleted User.

Get a Deleted User by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/user/deleted/U-00000032',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/user/deleted/U-00000032'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/user/deleted/U-00000032"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/user/deleted/U-00000032" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "U-00000032",
    "name": "nightmanager",
    "first_name": "Night",
    "last_name": "Shift",
    "email": "nightshift@eg-dentists.co.uk",
    "mobile": "07789012345",
    "description": "Night Shift Manager",
    "created_at": 1677253563,
    "updated_at": 1677253575,
    "deleted_at": 1677253575,
    "roles": [
        {
            "external_id": "R-00000002",
            "name": "Admin User",
            "description": "Admin User, create edit, delete"
        }
    ],
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9"
        }
    ]
}

HTTP Request

GET user/deleted/{userId}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.

2. Roles

Endpoints for getting data about Roles.

Get All.

Get all Roles.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/role',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/role'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/role"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/role" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "R-00000001",
        "name": "Organistion Owner",
        "description": "Admin for a Registered Organisation"
    },
    {
        "external_id": "R-00000002",
        "name": "Admin User",
        "description": "Admin User, create edit, delete"
    },
    {
        "external_id": "R-00000003",
        "name": "Employee Read Write",
        "description": "Employee can View, and Edit Calendar"
    },
    {
        "external_id": "R-00000004",
        "name": "Employee Read Write Limited",
        "description": "Employee can View, and Edit Calendar"
    },
    {
        "external_id": "R-00000005",
        "name": "Employee Read Only",
        "description": "Employee can View Calendar"
    },
    {
        "external_id": "R-00000006",
        "name": "Employee Bookings Only",
        "description": "Employee can only be booked against"
    }
]

HTTP Request

GET role

Get One.

Get a Roles by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/role/R-00000001',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/role/R-00000001'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/role/R-00000001"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/role/R-00000001" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "R-00000001",
    "name": "Organistion Owner",
    "description": "Admin for a Registered Organisation"
}

HTTP Request

GET role/{roleId}

URL Parameters

Parameter Status Description
roleId required The id of the Role. String, Length 10.

3. Departments

Endpoints for managing Departments.

Get All.

Get all Departments.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/departments',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/departments"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/departments" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "D-00000002",
        "name": "Management",
        "description": "Managerial Staff",
        "color": "#F7CAC9",
        "created_at": 1677253401,
        "updated_at": 1677253401
    },
    {
        "external_id": "D-00000003",
        "name": "Admin",
        "description": "Calendar Administrators",
        "color": "#88B04B",
        "created_at": 1677253401,
        "updated_at": 1677253401
    },
    {
        "external_id": "D-00000004",
        "name": "Dentistry",
        "description": "General Dentistry Department",
        "color": "#B4B7BA",
        "created_at": 1677253401,
        "updated_at": 1677253401
    },
    {
        "external_id": "D-00000005",
        "name": "Orthadontics",
        "description": "Orthaontic Dentistry Department",
        "color": "#EFC050",
        "created_at": 1677253401,
        "updated_at": 1677253401
    }
]

HTTP Request

GET departments

Search.

Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/departments/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Dentist',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments/search'
params = {
  'searchTerm': 'Dentist',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/departments/search"
);

let params = {
    "searchTerm": "Dentist",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/departments/search?searchTerm=Dentist" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "D-00000004",
        "name": "Dentistry",
        "description": "General Dentistry Department",
        "color": "#B4B7BA",
        "created_at": 1677253401,
        "updated_at": 1677253401
    },
    {
        "external_id": "D-00000005",
        "name": "Orthadontics",
        "description": "Orthaontic Dentistry Department",
        "color": "#EFC050",
        "created_at": 1677253401,
        "updated_at": 1677253401
    }
]

HTTP Request

GET departments/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get One.

Get a Department by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/departments/D-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments/D-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/departments/D-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/departments/D-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "D-00000002",
    "name": "Management",
    "description": "Managerial Staff",
    "color": "#F7CAC9",
    "created_at": 1677253401,
    "updated_at": 1677253401
}

HTTP Request

GET departments/{departmentId}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.

Paginate All.

Paginate all Departments. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/departments/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/departments/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/departments/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9",
            "created_at": 1677253401,
            "updated_at": 1677253401
        },
        {
            "external_id": "D-00000003",
            "name": "Admin",
            "description": "Calendar Administrators",
            "color": "#88B04B",
            "created_at": 1677253401,
            "updated_at": 1677253401
        }
    ],
    "first_page_url": "https://api.penga.uk/departments/perpage/2?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "https://api.penga.uk/departments/perpage/2?page=2",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/departments/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/departments/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/departments/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/departments/perpage/2?page=2",
    "path": "https://api.penga.uk/departments/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 4
}

HTTP Request

GET departments/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginated Search.

Paginated Search Departments by name, and description. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/departments/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Dentist',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments/search/perpage/2'
params = {
  'searchTerm': 'Dentist',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/departments/search/perpage/2"
);

let params = {
    "searchTerm": "Dentist",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/departments/search/perpage/2?searchTerm=Dentist&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "D-00000004",
            "name": "Dentistry",
            "description": "General Dentistry Department",
            "color": "#B4B7BA",
            "created_at": 1677253401,
            "updated_at": 1677253401
        },
        {
            "external_id": "D-00000005",
            "name": "Orthadontics",
            "description": "Orthaontic Dentistry Department",
            "color": "#EFC050",
            "created_at": 1677253401,
            "updated_at": 1677253401
        }
    ],
    "first_page_url": "https://api.penga.uk/departments/search/perpage/2?searchTerm=Dentist&page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/departments/search/perpage/2?searchTerm=Dentist&page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/departments/search/perpage/2?searchTerm=Dentist&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/departments/search/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 2
}

HTTP Request

GET departments/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Create.

Create a Department.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/departments',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Night Workers',
            'color' => '#876354',
            'description' => 'Night Shift Workers',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments'
payload = {
    "name": "Night Workers",
    "color": "#876354",
    "description": "Night Shift Workers"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/departments"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Night Workers",
    "color": "#876354",
    "description": "Night Shift Workers"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/departments" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"name":"Night Workers","color":"#876354","description":"Night Shift Workers"}'

Example response (200):

{
    "name": "Night Workers",
    "color": "#876354",
    "description": "Night Shift Workers",
    "external_id": "D-00000047",
    "updated_at": 1677253590,
    "created_at": 1677253590
}

HTTP Request

POST departments

Body Parameters

Parameter Type Status Description
name string required The name of the Department. String, Max length 40.
color string optional optional The hex code for the color of the Department. String, Max length 7.
description string optional optional The description of the Department. String, Max length 100.

Update.

Update a Department.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/departments/D-00000047',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Night Workers',
            'color' => '#876354',
            'description' => 'Night Shift Workers',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments/D-00000047'
payload = {
    "name": "Night Workers",
    "color": "#876354",
    "description": "Night Shift Workers"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/departments/D-00000047"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Night Workers",
    "color": "#876354",
    "description": "Night Shift Workers"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/departments/D-00000047" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"name":"Night Workers","color":"#876354","description":"Night Shift Workers"}'

Example response (200):

{
    "external_id": "D-00000047",
    "name": "Night Workers",
    "description": "Night Shift Workers",
    "color": "#876354",
    "created_at": 1677253590,
    "updated_at": 1677253590
}

HTTP Request

PUT departments/{departmentId}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.

Body Parameters

Parameter Type Status Description
name string optional optional The name of the Department. String, Max length 40.
color string optional optional The hex code for the color of the Department. String, Max length 7.
description string optional optional The description of the Department. String, Max length 100.

Delete.

Delete a Department.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/departments/D-00000047',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/departments/D-00000047'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/departments/D-00000047"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/departments/D-00000047" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE departments/{departmentId}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.

4. Appointments

Endpoints for managing Appointments.

Paginate All Future.

Paginate all Future Appointments. Maximum page size 10. Ordered by Appointment Start Time in Ascending Order. Returns Appointments which have a start time in the future. For historical Appointments, please use the "Get By Time Period" endpoint.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/future/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/future/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/future/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/future/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00000320",
            "start_time": 1677235500,
            "end_time": 1677237300,
            "description": "Diverse 3rdgeneration attitude",
            "created_at": 1677253426,
            "updated_at": 1677253426,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000001",
                "name": "General",
                "color": "#c1fffb"
            },
            "client": {
                "external_id": "C-00000149",
                "first_name": "Charles",
                "last_name": "Scott"
            },
            "user": {
                "external_id": "U-00000008",
                "name": "Dentists Admin",
                "first_name": "Dentists",
                "last_name": "Admin"
            },
            "createdbyuser": {
                "external_id": "U-00000010",
                "name": "Dentists RW Own Employee",
                "first_name": "Dentists",
                "last_name": "Read Write Own"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00001121",
            "start_time": 1677235500,
            "end_time": 1677241800,
            "description": "Implemented fresh-thinking encryption",
            "created_at": 1677253454,
            "updated_at": 1677253455,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000141",
                "first_name": "Yvette",
                "last_name": "Parker"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/future/perpage/2?page=1",
    "from": 1,
    "last_page": 48,
    "last_page_url": "https://api.penga.uk/appointments/future/perpage/2?page=48",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=47",
            "label": "47",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=48",
            "label": "48",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/future/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/future/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/future/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 95
}

HTTP Request

GET appointments/future/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Search.

Search Appointments by Description or Client details. Ordered by Appointment Start Time in Ascending Order. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Lisa',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/search'
params = {
  'searchTerm': 'Lisa',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/search"
);

let params = {
    "searchTerm": "Lisa",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/search?searchTerm=Lisa" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "APT-00000011",
        "start_time": 1659693600,
        "end_time": 1659700800,
        "description": "Digitized systematic solution",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000012",
        "start_time": 1664697600,
        "end_time": 1664701200,
        "description": "Business-focused multi-state moderator",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "color": "#B4B7BA"
            }
        ]
    },
    {
        "external_id": "APT-00000013",
        "start_time": 1649695500,
        "end_time": 1649696400,
        "description": "De-engineered 4thgeneration benchmark",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000005",
            "name": "Consultation",
            "color": "#807dba"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000014",
        "start_time": 1655802000,
        "end_time": 1655804700,
        "description": "Cross-platform leadingedge structure",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000004",
            "name": "Follow Up",
            "color": "#f2d69e"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000015",
        "start_time": 1674471600,
        "end_time": 1674474300,
        "description": "Function-based coherent adapter",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000001",
            "name": "General",
            "color": "#c1fffb"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000016",
        "start_time": 1649239200,
        "end_time": 1649246400,
        "description": "Facetoface demand-driven middleware",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "color": "#B4B7BA"
            }
        ]
    },
    {
        "external_id": "APT-00000017",
        "start_time": 1657285200,
        "end_time": 1657286100,
        "description": "Cloned directional processimprovement",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000004",
            "name": "Follow Up",
            "color": "#f2d69e"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000018",
        "start_time": 1657467000,
        "end_time": 1657474200,
        "description": "Reduced zeroadministration success",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000010",
            "name": "Dentists RW Own Employee",
            "first_name": "Dentists",
            "last_name": "Read Write Own"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": []
    },
    {
        "external_id": "APT-00000019",
        "start_time": 1649491200,
        "end_time": 1649496600,
        "description": "Triple-buffered context-sensitive interface",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000005",
            "name": "Consultation",
            "color": "#807dba"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000020",
        "start_time": 1671633900,
        "end_time": 1671635700,
        "description": "Distributed bottom-line function",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "createdbyuser": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "color": "#B4B7BA"
            }
        ]
    },
    {
        "external_id": "APT-00000027",
        "start_time": 1654690500,
        "end_time": 1654692300,
        "description": "Re-engineered user-facing utilisation",
        "created_at": 1677253415,
        "updated_at": 1677253416,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000003",
            "first_name": "Mark",
            "last_name": "Twain"
        },
        "user": {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin"
        },
        "createdbyuser": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000042",
        "start_time": 1660122000,
        "end_time": 1660126500,
        "description": "Monitored tangible utilisation",
        "created_at": 1677253416,
        "updated_at": 1677253416,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000001",
            "name": "General",
            "color": "#c1fffb"
        },
        "client": {
            "external_id": "C-00000010",
            "first_name": "Iain",
            "last_name": "Reid"
        },
        "user": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "createdbyuser": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000217",
        "start_time": 1663932600,
        "end_time": 1663939800,
        "description": "Centralized 4thgeneration toolset",
        "created_at": 1677253422,
        "updated_at": 1677253422,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000098",
            "first_name": "Daniel",
            "last_name": "White"
        },
        "user": {
            "external_id": "U-00000010",
            "name": "Dentists RW Own Employee",
            "first_name": "Dentists",
            "last_name": "Read Write Own"
        },
        "createdbyuser": {
            "external_id": "U-00000010",
            "name": "Dentists RW Own Employee",
            "first_name": "Dentists",
            "last_name": "Read Write Own"
        },
        "departments": []
    },
    {
        "external_id": "APT-00000218",
        "start_time": 1648740600,
        "end_time": 1648746900,
        "description": "Innovative scalable support",
        "created_at": 1677253422,
        "updated_at": 1677253422,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000098",
            "first_name": "Daniel",
            "last_name": "White"
        },
        "user": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "createdbyuser": {
            "external_id": "U-00000010",
            "name": "Dentists RW Own Employee",
            "first_name": "Dentists",
            "last_name": "Read Write Own"
        },
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "color": "#B4B7BA"
            }
        ]
    },
    {
        "external_id": "APT-00000260",
        "start_time": 1661181300,
        "end_time": 1661184900,
        "description": "Customer-focused user-facing utilisation",
        "created_at": 1677253424,
        "updated_at": 1677253424,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000001",
            "name": "General",
            "color": "#c1fffb"
        },
        "client": {
            "external_id": "C-00000119",
            "first_name": "Kirsten",
            "last_name": "Roberts"
        },
        "user": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000271",
        "start_time": 1668513600,
        "end_time": 1668515400,
        "description": "Programmable nextgeneration utilisation",
        "created_at": 1677253424,
        "updated_at": 1677253424,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000005",
            "name": "Consultation",
            "color": "#807dba"
        },
        "client": {
            "external_id": "C-00000125",
            "first_name": "Sonia",
            "last_name": "Cox"
        },
        "user": {
            "external_id": "U-00000010",
            "name": "Dentists RW Own Employee",
            "first_name": "Dentists",
            "last_name": "Read Write Own"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": []
    },
    {
        "external_id": "APT-00000325",
        "start_time": 1660208400,
        "end_time": 1660215600,
        "description": "Function-based exuding archive",
        "created_at": 1677253426,
        "updated_at": 1677253426,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000152",
            "first_name": "Lisa",
            "last_name": "Martin"
        },
        "user": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000326",
        "start_time": 1656500400,
        "end_time": 1656505800,
        "description": "Distributed stable processimprovement",
        "created_at": 1677253426,
        "updated_at": 1677253426,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000001",
            "name": "General",
            "color": "#c1fffb"
        },
        "client": {
            "external_id": "C-00000152",
            "first_name": "Lisa",
            "last_name": "Martin"
        },
        "user": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "createdbyuser": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "color": "#B4B7BA"
            }
        ]
    },
    {
        "external_id": "APT-00000443",
        "start_time": 1652534100,
        "end_time": 1652540400,
        "description": "Streamlined bottom-line utilisation",
        "created_at": 1677253430,
        "updated_at": 1677253431,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000211",
            "first_name": "Keeley",
            "last_name": "Harris"
        },
        "user": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000679",
        "start_time": 1659795300,
        "end_time": 1659797100,
        "description": "Synchronised explicit utilisation",
        "created_at": 1677253439,
        "updated_at": 1677253439,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000001",
            "name": "General",
            "color": "#c1fffb"
        },
        "client": {
            "external_id": "C-00000329",
            "first_name": "Holly",
            "last_name": "Lewis"
        },
        "user": {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin"
        },
        "createdbyuser": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000717",
        "start_time": 1652602500,
        "end_time": 1652606100,
        "description": "Distributed clear-thinking utilisation",
        "created_at": 1677253440,
        "updated_at": 1677253440,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000348",
            "first_name": "Arthur",
            "last_name": "Walsh"
        },
        "user": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "createdbyuser": {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000843",
        "start_time": 1665228600,
        "end_time": 1665229500,
        "description": "Optional holistic utilisation",
        "created_at": 1677253445,
        "updated_at": 1677253445,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000005",
            "name": "Consultation",
            "color": "#807dba"
        },
        "client": {
            "external_id": "C-00000411",
            "first_name": "Leah",
            "last_name": "Ross"
        },
        "user": {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000875",
        "start_time": 1674144900,
        "end_time": 1674145800,
        "description": "Quality-focused full-range localareanetwork",
        "created_at": 1677253446,
        "updated_at": 1677253446,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000427",
            "first_name": "Jade",
            "last_name": "James"
        },
        "user": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "createdbyuser": {
            "external_id": "U-00000010",
            "name": "Dentists RW Own Employee",
            "first_name": "Dentists",
            "last_name": "Read Write Own"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00000876",
        "start_time": 1659441600,
        "end_time": 1659443400,
        "description": "Robust client-driven forecast",
        "created_at": 1677253446,
        "updated_at": 1677253446,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000427",
            "first_name": "Jade",
            "last_name": "James"
        },
        "user": {
            "external_id": "U-00000008",
            "name": "Dentists Admin",
            "first_name": "Dentists",
            "last_name": "Admin"
        },
        "createdbyuser": {
            "external_id": "U-00000010",
            "name": "Dentists RW Own Employee",
            "first_name": "Dentists",
            "last_name": "Read Write Own"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00000948",
        "start_time": 1662367500,
        "end_time": 1662368400,
        "description": "Inverse needs-based utilisation",
        "created_at": 1677253448,
        "updated_at": 1677253448,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000463",
            "first_name": "Evelyn",
            "last_name": "Wilkinson"
        },
        "user": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    },
    {
        "external_id": "APT-00001030",
        "start_time": 1657985400,
        "end_time": 1657991700,
        "description": "Compatible assymetric utilisation",
        "created_at": 1677253451,
        "updated_at": 1677253451,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000504",
            "first_name": "Abbie",
            "last_name": "Hall"
        },
        "user": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only"
        },
        "createdbyuser": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "color": "#88B04B"
            }
        ]
    },
    {
        "external_id": "APT-00001103",
        "start_time": 1655637300,
        "end_time": 1655638200,
        "description": "Automated 5thgeneration utilisation",
        "created_at": 1677253453,
        "updated_at": 1677253454,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "Checkup",
            "color": "#41ab5d"
        },
        "client": {
            "external_id": "C-00000056",
            "first_name": "Eileen",
            "last_name": "James"
        },
        "user": {
            "external_id": "U-00000012",
            "name": "Dentists Bookings Only",
            "first_name": "Dentists",
            "last_name": "Bookings Only"
        },
        "createdbyuser": {
            "external_id": "U-00000009",
            "name": "Dentists RW Employee",
            "first_name": "Dentists",
            "last_name": "Read Write"
        },
        "departments": [
            {
                "external_id": "D-00000004",
                "name": "Dentistry",
                "color": "#B4B7BA"
            }
        ]
    },
    {
        "external_id": "APT-00001156",
        "start_time": 1672831800,
        "end_time": 1672838100,
        "description": "Seamless reciprocal budgetarymanagement",
        "created_at": 1677253455,
        "updated_at": 1677253455,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "ab",
            "color": "#f5195c"
        },
        "client": {
            "external_id": "C-00000516",
            "first_name": "Lisa",
            "last_name": "Miller"
        },
        "user": {
            "external_id": "U-00000031",
            "name": "Golf Lessons R Us Owner",
            "first_name": "Golf Lessons R Us",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000031",
            "name": "Golf Lessons R Us Owner",
            "first_name": "Golf Lessons R Us",
            "last_name": "Owner"
        },
        "departments": []
    },
    {
        "external_id": "APT-00001158",
        "start_time": 1651406400,
        "end_time": 1651411800,
        "description": "Secured clear-thinking capacity",
        "created_at": 1677253455,
        "updated_at": 1677253456,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000006",
            "name": "optio",
            "color": "#a6f3ba"
        },
        "client": {
            "external_id": "C-00000516",
            "first_name": "Lisa",
            "last_name": "Miller"
        },
        "user": {
            "external_id": "U-00000031",
            "name": "Golf Lessons R Us Owner",
            "first_name": "Golf Lessons R Us",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000031",
            "name": "Golf Lessons R Us Owner",
            "first_name": "Golf Lessons R Us",
            "last_name": "Owner"
        },
        "departments": []
    },
    {
        "external_id": "APT-00001159",
        "start_time": 1651654800,
        "end_time": 1651656600,
        "description": "Front-line demand-driven core",
        "created_at": 1677253455,
        "updated_at": 1677253456,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "color": "#00d422"
        },
        "appointmenttype": {
            "external_id": "AT-00000003",
            "name": "ab",
            "color": "#f5195c"
        },
        "client": {
            "external_id": "C-00000516",
            "first_name": "Lisa",
            "last_name": "Miller"
        },
        "user": {
            "external_id": "U-00000031",
            "name": "Golf Lessons R Us Owner",
            "first_name": "Golf Lessons R Us",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000031",
            "name": "Golf Lessons R Us Owner",
            "first_name": "Golf Lessons R Us",
            "last_name": "Owner"
        },
        "departments": []
    }
]

HTTP Request

GET appointments/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get One.

Get an Appointment by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/APT-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/APT-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/APT-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/APT-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "APT-00000002",
    "start_time": 1667661300,
    "end_time": 1667663100,
    "description": "Operative multi-state leverage",
    "created_at": 1677253415,
    "updated_at": 1677253415,
    "appointmentstatus": {
        "external_id": "AS-00000001",
        "name": "Pending",
        "description": "Appointment Pending",
        "color": "#00d422",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    "appointmenttype": {
        "external_id": "AT-00000001",
        "name": "General",
        "description": "General Dental Appointments",
        "color": "#c1fffb",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    "client": {
        "external_id": "C-00000001",
        "first_name": "David",
        "last_name": "Best",
        "description": "David B",
        "email": "david@example.com",
        "mobile": "07717443339",
        "created_at": 1652971407,
        "updated_at": 1677253407,
        "address": {
            "external_id": "PA-00000001",
            "house_num_name": "10",
            "address_1": "Downing Street",
            "address_2": "City of Westminster",
            "address_3": "",
            "town": "London",
            "county": "Greater London",
            "postcode": "SW1A 2AA",
            "created_at": 1677253398,
            "updated_at": 1677253398
        },
        "marketing_options": {
            "external_id": "MOC-00000001",
            "notification_sms_allow": 1,
            "notification_email_allow": 1,
            "marketing_sms_allow": 1,
            "marketing_email_allow": 1,
            "manual_notification_email_optout": 0,
            "manual_marketing_email_optout": 0,
            "manual_notification_sms_optout": 0,
            "manual_marketing_sms_optout": 0,
            "created_at": 1677253407,
            "updated_at": 1677253407
        }
    },
    "user": {
        "external_id": "U-00000011",
        "name": "Dentists RO Employee",
        "first_name": "Dentists",
        "last_name": "Read Only",
        "email": "readonly@eg-dentists.co.uk",
        "mobile": "07567890123",
        "description": "Accounting Department Read Only User",
        "created_at": 1677253403,
        "updated_at": 1677253403
    },
    "createdbyuser": {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253686
    },
    "departments": [
        {
            "external_id": "D-00000003",
            "name": "Admin",
            "description": "Calendar Administrators",
            "color": "#88B04B",
            "created_at": 1677253401,
            "updated_at": 1677253401
        }
    ]
}

HTTP Request

GET appointments/{appointmentId}

URL Parameters

Parameter Status Description
appointmentId required The id of the Appointment. String, Length 12.

Create.

Create an Appointment.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/appointments',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'start_time' => '1577836800',
            'end_time' => '1609459200',
            'user_id' => 'U-00000007',
            'client_id' => 'C-00000002',
            'appointmenttype_id' => 'AT-00000002',
            'appointmentstatus_id' => 'AS-00000002',
            'description' => 'Annual checkup',
            'note' => 'Please ensure client is given loyalty discount of 10%',
            'send_alerts' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments'
payload = {
    "start_time": "1577836800",
    "end_time": "1609459200",
    "user_id": "U-00000007",
    "client_id": "C-00000002",
    "appointmenttype_id": "AT-00000002",
    "appointmentstatus_id": "AS-00000002",
    "description": "Annual checkup",
    "note": "Please ensure client is given loyalty discount of 10%",
    "send_alerts": false
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "start_time": "1577836800",
    "end_time": "1609459200",
    "user_id": "U-00000007",
    "client_id": "C-00000002",
    "appointmenttype_id": "AT-00000002",
    "appointmentstatus_id": "AS-00000002",
    "description": "Annual checkup",
    "note": "Please ensure client is given loyalty discount of 10%",
    "send_alerts": false
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/appointments" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"start_time":"1577836800","end_time":"1609459200","user_id":"U-00000007","client_id":"C-00000002","appointmenttype_id":"AT-00000002","appointmentstatus_id":"AS-00000002","description":"Annual checkup","note":"Please ensure client is given loyalty discount of 10%","send_alerts":false}'

Example response (200):

{
    "external_id": "APT-00001165",
    "start_time": 1577836800,
    "end_time": 1609459200,
    "description": "Annual checkup",
    "created_at": 1677253689,
    "updated_at": 1677253689,
    "appointmentstatus": {
        "external_id": "AS-00000002",
        "name": "Missed Appointment",
        "description": "Client missed appointment",
        "color": "#345678",
        "created_at": 1677253402,
        "updated_at": 1677253620
    },
    "appointmenttype": {
        "external_id": "AT-00000002",
        "name": "Catch Up",
        "description": "Catch up session",
        "color": "#345678",
        "created_at": 1677253402,
        "updated_at": 1677253605
    },
    "client": {
        "external_id": "C-00000002",
        "first_name": "Lisa",
        "last_name": "Wright",
        "description": "Lisa W",
        "email": "lisa@example.com",
        "mobile": "07123123456",
        "created_at": 1671551007,
        "updated_at": 1677253407,
        "address": {
            "external_id": "PA-00000002",
            "house_num_name": "16",
            "address_1": "Carmen Village",
            "address_2": "Lake",
            "address_3": null,
            "town": "South Holly",
            "county": "Derbyshire",
            "postcode": "CW11 5SY",
            "created_at": 1677253407,
            "updated_at": 1677253407
        },
        "marketing_options": {
            "external_id": "MOC-00000002",
            "notification_sms_allow": 1,
            "notification_email_allow": 1,
            "marketing_sms_allow": 1,
            "marketing_email_allow": 1,
            "manual_notification_email_optout": 0,
            "manual_marketing_email_optout": 0,
            "manual_notification_sms_optout": 0,
            "manual_marketing_sms_optout": 0,
            "created_at": 1677253407,
            "updated_at": 1677253407
        }
    },
    "user": {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253687
    },
    "createdbyuser": {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253687
    },
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9",
            "created_at": 1677253401,
            "updated_at": 1677253401
        }
    ]
}

HTTP Request

POST appointments

Body Parameters

Parameter Type Status Description
start_time required optional The start time of the period. Unix Timestamp.
end_time required optional The end time of the period. Unix Timestamp.
user_id string required The id of the User. String, Length 10.
client_id string required The id of the Client. String, Length 10.
appointmenttype_id required optional The id of the Appointment Type. String, Length 11.
appointmentstatus_id required optional The id of the Appointment Status. String, Length 11.
description string optional The optional description of the Appointment. String, Max length 255.
note string optional optional note of the Appointment. String, Max length 255.
send_alerts boolean required Should SMS and Email alerts (if allowed by the clients marketing options) be sent?

Paginate by Client.

Paginate all Appointments by Client id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/client/C-00000002/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/client/C-00000002/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/client/C-00000002/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00000016",
            "start_time": 1649239200,
            "end_time": 1649246400,
            "description": "Facetoface demand-driven middleware",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "createdbyuser": {
                "external_id": "U-00000011",
                "name": "Dentists RO Employee",
                "first_name": "Dentists",
                "last_name": "Read Only"
            },
            "departments": [
                {
                    "external_id": "D-00000004",
                    "name": "Dentistry",
                    "color": "#B4B7BA"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=1",
    "from": 1,
    "last_page": 6,
    "last_page_url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=6",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/client/C-00000002/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/client/C-00000002/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 11
}

HTTP Request

GET appointments/client/{clientId}/perpage/{perPage}

URL Parameters

Parameter Status Description
clientId required The id of the Client. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by Appointment Type.

Paginate all Appointments by Appointment Type id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/type/AT-00000002/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/type/AT-00000002/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/type/AT-00000002/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00000341",
            "start_time": 1648198800,
            "end_time": 1648206000,
            "description": "Phased responsive core",
            "created_at": 1677253427,
            "updated_at": 1677253427,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000160",
                "first_name": "Jeremy",
                "last_name": "Robertson"
            },
            "user": {
                "external_id": "U-00000010",
                "name": "Dentists RW Own Employee",
                "first_name": "Dentists",
                "last_name": "Read Write Own"
            },
            "createdbyuser": {
                "external_id": "U-00000009",
                "name": "Dentists RW Employee",
                "first_name": "Dentists",
                "last_name": "Read Write"
            },
            "departments": []
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=1",
    "from": 1,
    "last_page": 114,
    "last_page_url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=114",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=113",
            "label": "113",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=114",
            "label": "114",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/type/AT-00000002/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 227
}

HTTP Request

GET appointments/type/{appoinmentTypeId}/perpage/{perPage}

URL Parameters

Parameter Status Description
appoinmentTypeId required The id of the Appointment Type. String, Length 11.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by Appointment Status.

Paginate all Appointments by Appointment Status id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/status/AS-00000001/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/status/AS-00000001/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/status/AS-00000001/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00000781",
            "start_time": 1648122300,
            "end_time": 1648124100,
            "description": "Decentralized static matrices",
            "created_at": 1677253442,
            "updated_at": 1677253443,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000003",
                "name": "Checkup",
                "color": "#41ab5d"
            },
            "client": {
                "external_id": "C-00000380",
                "first_name": "Maisie",
                "last_name": "Mitchell"
            },
            "user": {
                "external_id": "U-00000011",
                "name": "Dentists RO Employee",
                "first_name": "Dentists",
                "last_name": "Read Only"
            },
            "createdbyuser": {
                "external_id": "U-00000011",
                "name": "Dentists RO Employee",
                "first_name": "Dentists",
                "last_name": "Read Only"
            },
            "departments": [
                {
                    "external_id": "D-00000003",
                    "name": "Admin",
                    "color": "#88B04B"
                }
            ]
        },
        {
            "external_id": "APT-00000447",
            "start_time": 1648123200,
            "end_time": 1648127700,
            "description": "Self-enabling contextually-based initiative",
            "created_at": 1677253431,
            "updated_at": 1677253431,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000003",
                "name": "Checkup",
                "color": "#41ab5d"
            },
            "client": {
                "external_id": "C-00000213",
                "first_name": "Michael",
                "last_name": "Hughes"
            },
            "user": {
                "external_id": "U-00000009",
                "name": "Dentists RW Employee",
                "first_name": "Dentists",
                "last_name": "Read Write"
            },
            "createdbyuser": {
                "external_id": "U-00000009",
                "name": "Dentists RW Employee",
                "first_name": "Dentists",
                "last_name": "Read Write"
            },
            "departments": [
                {
                    "external_id": "D-00000003",
                    "name": "Admin",
                    "color": "#88B04B"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=1",
    "from": 1,
    "last_page": 576,
    "last_page_url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=576",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=575",
            "label": "575",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=576",
            "label": "576",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/status/AS-00000001/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 1151
}

HTTP Request

GET appointments/status/{appoinmentStatusId}/perpage/{perPage}

URL Parameters

Parameter Status Description
appoinmentStatusId required The id of the Appointment Status. String, Length 11.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by Department.

Paginate all Appointments by Department id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/department/D-00000002/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/department/D-00000002/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/department/D-00000002/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00000974",
            "start_time": 1648381500,
            "end_time": 1648388700,
            "description": "Advanced local service-desk",
            "created_at": 1677253449,
            "updated_at": 1677253449,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000005",
                "name": "Consultation",
                "color": "#807dba"
            },
            "client": {
                "external_id": "C-00000476",
                "first_name": "Lily",
                "last_name": "Parker"
            },
            "user": {
                "external_id": "U-00000008",
                "name": "Dentists Admin",
                "first_name": "Dentists",
                "last_name": "Admin"
            },
            "createdbyuser": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=1",
    "from": 1,
    "last_page": 203,
    "last_page_url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=203",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=202",
            "label": "202",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=203",
            "label": "203",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/department/D-00000002/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/department/D-00000002/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 405
}

HTTP Request

GET appointments/department/{departmentId}/perpage/{perPage}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get by User and Time Period.

Get all Appointments by User id within the given Time Period. Ordered by Appointment Start Time in Ascending Order. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "APT-00001165",
        "start_time": 1577836800,
        "end_time": 1609459200,
        "description": "Annual checkup",
        "created_at": 1677253689,
        "updated_at": 1677253689,
        "appointmentstatus": {
            "external_id": "AS-00000002",
            "name": "Missed Appointment",
            "color": "#345678"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    }
]

HTTP Request

GET appointments/user/{userId}/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

Paginate by User and Time Period.

Paginate all Appointments by User id within the given Time Period. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/appointments/user/U-00000007/starttime/1577836800/endtime/1609459200/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET appointments/user/{userId}/starttime/{startTime}/endtime/{endTime}/perpage/{perPage}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by User and Type.

Paginate Appointments by User and Appointment Type id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00000158",
            "start_time": 1649176200,
            "end_time": 1649181600,
            "description": "Persistent disintermediate workforce",
            "created_at": 1677253420,
            "updated_at": 1677253420,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000068",
                "first_name": "James",
                "last_name": "Campbell"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=1",
    "from": 1,
    "last_page": 22,
    "last_page_url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=22",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=21",
            "label": "21",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=22",
            "label": "22",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/user/U-00000007/type/AT-00000002/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 43
}

HTTP Request

GET appointments/user/{userId}/type/{appoinmentTypeId}/perpage/{perPage}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
appoinmentTypeId required The id of the Appointment Type. String, Length 11.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by User and Status.

Paginate Appointments by User and Appointment Status id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00000176",
            "start_time": 1648727100,
            "end_time": 1648731600,
            "description": "Proactive 5thgeneration securedline",
            "created_at": 1677253421,
            "updated_at": 1677253421,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000001",
                "name": "General",
                "color": "#c1fffb"
            },
            "client": {
                "external_id": "C-00000077",
                "first_name": "Christian",
                "last_name": "Harris"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00000158",
            "start_time": 1649176200,
            "end_time": 1649181600,
            "description": "Persistent disintermediate workforce",
            "created_at": 1677253420,
            "updated_at": 1677253420,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000068",
                "first_name": "James",
                "last_name": "Campbell"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=1",
    "from": 1,
    "last_page": 111,
    "last_page_url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=111",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=110",
            "label": "110",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=111",
            "label": "111",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/user/U-00000007/status/AS-00000001/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 221
}

HTTP Request

GET appointments/user/{userId}/status/{appoinmentStatusId}/perpage/{perPage}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
appoinmentStatusId required The id of the Appointment Status. String, Length 11.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by User.

Paginate all Appointments by User id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/user/U-00000007/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/user/U-00000007/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/user/U-00000007/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00000176",
            "start_time": 1648727100,
            "end_time": 1648731600,
            "description": "Proactive 5thgeneration securedline",
            "created_at": 1677253421,
            "updated_at": 1677253421,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000001",
                "name": "General",
                "color": "#c1fffb"
            },
            "client": {
                "external_id": "C-00000077",
                "first_name": "Christian",
                "last_name": "Harris"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=1",
    "from": 1,
    "last_page": 111,
    "last_page_url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=111",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=110",
            "label": "110",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=111",
            "label": "111",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/user/U-00000007/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/user/U-00000007/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 222
}

HTTP Request

GET appointments/user/{userId}/perpage/{perPage}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get by Department and Time Period.

Get all Appointments by Department id within the given Time Period. Ordered by Appointment Start Time in Ascending Order. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "APT-00001165",
        "start_time": 1577836800,
        "end_time": 1609459200,
        "description": "Annual checkup",
        "created_at": 1677253689,
        "updated_at": 1677253689,
        "appointmentstatus": {
            "external_id": "AS-00000002",
            "name": "Missed Appointment",
            "color": "#345678"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    }
]

HTTP Request

GET appointments/department/{departmentId}/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

Paginate by Department and Time Period.

Paginate all Appointments by Department id within the given Time Period. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/appointments/department/D-00000002/starttime/1577836800/endtime/1609459200/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET appointments/department/{departmentId}/starttime/{startTime}/endtime/{endTime}/perpage/{perPage}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get by Time Period.

Get all Appointments within the given Time Period. Ordered by Appointment Start Time in Ascending Order. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "APT-00001165",
        "start_time": 1577836800,
        "end_time": 1609459200,
        "description": "Annual checkup",
        "created_at": 1677253689,
        "updated_at": 1677253689,
        "appointmentstatus": {
            "external_id": "AS-00000002",
            "name": "Missed Appointment",
            "color": "#345678"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    }
]

HTTP Request

GET appointments/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

Paginate by Time Period.

Paginate all Appointments within the given Time Period. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00001165",
            "start_time": 1577836800,
            "end_time": 1609459200,
            "description": "Annual checkup",
            "created_at": 1677253689,
            "updated_at": 1677253689,
            "appointmentstatus": {
                "external_id": "AS-00000002",
                "name": "Missed Appointment",
                "color": "#345678"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "createdbyuser": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/appointments/starttime/1577836800/endtime/1609459200/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET appointments/starttime/{startTime}/endtime/{endTime}/perpage/{perPage}

URL Parameters

Parameter Status Description
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get by Client and Time Period.

Get all Appointments by Client id within the given Time Period. Ordered by Appointment Start Time in Ascending Order. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/client/C-00000002/starttime/1577836800/endtime/1609459200',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/client/C-00000002/starttime/1577836800/endtime/1609459200'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/client/C-00000002/starttime/1577836800/endtime/1609459200"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/client/C-00000002/starttime/1577836800/endtime/1609459200" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "APT-00001165",
        "start_time": 1577836800,
        "end_time": 1609459200,
        "description": "Annual checkup",
        "created_at": 1677253689,
        "updated_at": 1677253689,
        "appointmentstatus": {
            "external_id": "AS-00000002",
            "name": "Missed Appointment",
            "color": "#345678"
        },
        "appointmenttype": {
            "external_id": "AT-00000002",
            "name": "Catch Up",
            "color": "#345678"
        },
        "client": {
            "external_id": "C-00000002",
            "first_name": "Lisa",
            "last_name": "Wright"
        },
        "user": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner"
        },
        "departments": [
            {
                "external_id": "D-00000002",
                "name": "Management",
                "color": "#F7CAC9"
            }
        ]
    }
]

HTTP Request

GET appointments/client/{clientId}/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
clientId required The id of the Client. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

Paginated Search.

Paginated Search Appointments by Description or Client details. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointments/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Lisa',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/search/perpage/2'
params = {
  'searchTerm': 'Lisa',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/search/perpage/2"
);

let params = {
    "searchTerm": "Lisa",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00000011",
            "start_time": 1659693600,
            "end_time": 1659700800,
            "description": "Digitized systematic solution",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000003",
                "name": "Checkup",
                "color": "#41ab5d"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000008",
                "name": "Dentists Admin",
                "first_name": "Dentists",
                "last_name": "Admin"
            },
            "createdbyuser": {
                "external_id": "U-00000011",
                "name": "Dentists RO Employee",
                "first_name": "Dentists",
                "last_name": "Read Only"
            },
            "departments": [
                {
                    "external_id": "D-00000002",
                    "name": "Management",
                    "color": "#F7CAC9"
                }
            ]
        },
        {
            "external_id": "APT-00000012",
            "start_time": 1664697600,
            "end_time": 1664701200,
            "description": "Business-focused multi-state moderator",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000003",
                "name": "Checkup",
                "color": "#41ab5d"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "user": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "createdbyuser": {
                "external_id": "U-00000011",
                "name": "Dentists RO Employee",
                "first_name": "Dentists",
                "last_name": "Read Only"
            },
            "departments": [
                {
                    "external_id": "D-00000004",
                    "name": "Dentistry",
                    "color": "#B4B7BA"
                }
            ]
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=1",
    "from": 1,
    "last_page": 16,
    "last_page_url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=16",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=15",
            "label": "15",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=16",
            "label": "16",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/search/perpage/2?searchTerm=Lisa&page=2",
    "path": "https://api.penga.uk/appointments/search/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 32
}

HTTP Request

GET appointments/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Paginated Filter.

Paginated Filter Appointments by Type, Status, User, and Client id. Ordered by Appointment Start Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/appointments/filter/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'appointmenttype_id'=> 'AT-00000002',
            'appointmentstatus_id'=> 'AS-00000002',
            'user_id'=> 'U-00000007',
            'department_id'=> 'D-00000002',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/filter/perpage/2'
params = {
  'appointmenttype_id': 'AT-00000002',
  'appointmentstatus_id': 'AS-00000002',
  'user_id': 'U-00000007',
  'department_id': 'D-00000002',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/filter/perpage/2"
);

let params = {
    "appointmenttype_id": "AT-00000002",
    "appointmentstatus_id": "AS-00000002",
    "user_id": "U-00000007",
    "department_id": "D-00000002",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/appointments/filter/perpage/2?appointmenttype_id=AT-00000002&appointmentstatus_id=AS-00000002&user_id=U-00000007&department_id=D-00000002&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "APT-00000399",
            "start_time": 1679676300,
            "end_time": 1679677200,
            "description": "Cloned discrete definition",
            "created_at": 1677253429,
            "updated_at": 1677253429,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000002",
                "name": "Catch Up",
                "color": "#345678"
            },
            "client": {
                "external_id": "C-00000189",
                "first_name": "Callum",
                "last_name": "Murphy"
            },
            "user": {
                "external_id": "U-00000009",
                "name": "Dentists RW Employee",
                "first_name": "Dentists",
                "last_name": "Read Write"
            },
            "createdbyuser": {
                "external_id": "U-00000008",
                "name": "Dentists Admin",
                "first_name": "Dentists",
                "last_name": "Admin"
            },
            "departments": [
                {
                    "external_id": "D-00000003",
                    "name": "Admin",
                    "color": "#88B04B"
                }
            ]
        },
        {
            "external_id": "APT-00000349",
            "start_time": 1679670900,
            "end_time": 1679673600,
            "description": "Horizontal neutral openarchitecture",
            "created_at": 1677253427,
            "updated_at": 1677253427,
            "appointmentstatus": {
                "external_id": "AS-00000001",
                "name": "Pending",
                "color": "#00d422"
            },
            "appointmenttype": {
                "external_id": "AT-00000003",
                "name": "Checkup",
                "color": "#41ab5d"
            },
            "client": {
                "external_id": "C-00000164",
                "first_name": "Ellie",
                "last_name": "King"
            },
            "user": {
                "external_id": "U-00000010",
                "name": "Dentists RW Own Employee",
                "first_name": "Dentists",
                "last_name": "Read Write Own"
            },
            "createdbyuser": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "departments": []
        }
    ],
    "first_page_url": "https://api.penga.uk/appointments/filter/perpage/2?page=1",
    "from": 1,
    "last_page": 48,
    "last_page_url": "https://api.penga.uk/appointments/filter/perpage/2?page=48",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=47",
            "label": "47",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=48",
            "label": "48",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointments/filter/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointments/filter/perpage/2?page=2",
    "path": "https://api.penga.uk/appointments/filter/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 95
}

HTTP Request

POST appointments/filter/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
appointmenttype_id required The id of the Appointment Type. String, Length 11.
appointmentstatus_id required The id of the Appointment Status. String, Length 11.
user_id required The id of the User. String, Length 10.
department_id required The id of the Department. String, Length 10.
page optional The page number to return. Integer.

Update.

Update an Appointment.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/appointments/APT-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'start_time' => '1577836800',
            'end_time' => '1609459200',
            'user_id' => 'U-00000007',
            'client_id' => 'C-00000002',
            'appointmenttype_id' => 'AT-00000002',
            'appointmentstatus_id' => 'AS-00000002',
            'description' => 'Annual checkup',
            'note' => 'Please ensure client is given loyalty discount of 10%',
            'send_alerts' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/APT-00000002'
payload = {
    "start_time": "1577836800",
    "end_time": "1609459200",
    "user_id": "U-00000007",
    "client_id": "C-00000002",
    "appointmenttype_id": "AT-00000002",
    "appointmentstatus_id": "AS-00000002",
    "description": "Annual checkup",
    "note": "Please ensure client is given loyalty discount of 10%",
    "send_alerts": true
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/APT-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "start_time": "1577836800",
    "end_time": "1609459200",
    "user_id": "U-00000007",
    "client_id": "C-00000002",
    "appointmenttype_id": "AT-00000002",
    "appointmentstatus_id": "AS-00000002",
    "description": "Annual checkup",
    "note": "Please ensure client is given loyalty discount of 10%",
    "send_alerts": true
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/appointments/APT-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"start_time":"1577836800","end_time":"1609459200","user_id":"U-00000007","client_id":"C-00000002","appointmenttype_id":"AT-00000002","appointmentstatus_id":"AS-00000002","description":"Annual checkup","note":"Please ensure client is given loyalty discount of 10%","send_alerts":true}'

Example response (200):

{
    "external_id": "APT-00000002",
    "start_time": 1577836800,
    "end_time": 1609459200,
    "description": "Annual checkup",
    "created_at": 1677253415,
    "updated_at": 1677253723,
    "appointmentstatus": {
        "external_id": "AS-00000002",
        "name": "Missed Appointment",
        "description": "Client missed appointment",
        "color": "#345678",
        "created_at": 1677253402,
        "updated_at": 1677253620
    },
    "appointmenttype": {
        "external_id": "AT-00000002",
        "name": "Catch Up",
        "description": "Catch up session",
        "color": "#345678",
        "created_at": 1677253402,
        "updated_at": 1677253605
    },
    "client": {
        "external_id": "C-00000002",
        "first_name": "Lisa",
        "last_name": "Wright",
        "description": "Lisa W",
        "email": "lisa@example.com",
        "mobile": "07123123456",
        "created_at": 1671551007,
        "updated_at": 1677253723,
        "address": {
            "external_id": "PA-00000002",
            "house_num_name": "16",
            "address_1": "Carmen Village",
            "address_2": "Lake",
            "address_3": null,
            "town": "South Holly",
            "county": "Derbyshire",
            "postcode": "CW11 5SY",
            "created_at": 1677253407,
            "updated_at": 1677253407
        },
        "marketing_options": {
            "external_id": "MOC-00000002",
            "notification_sms_allow": 1,
            "notification_email_allow": 1,
            "marketing_sms_allow": 1,
            "marketing_email_allow": 1,
            "manual_notification_email_optout": 0,
            "manual_marketing_email_optout": 0,
            "manual_notification_sms_optout": 0,
            "manual_marketing_sms_optout": 0,
            "created_at": 1677253407,
            "updated_at": 1677253407
        }
    },
    "user": {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253722
    },
    "createdbyuser": {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253722
    },
    "departments": [
        {
            "external_id": "D-00000002",
            "name": "Management",
            "description": "Managerial Staff",
            "color": "#F7CAC9",
            "created_at": 1677253401,
            "updated_at": 1677253401
        }
    ]
}

HTTP Request

PUT appointments/{appointmentId}

URL Parameters

Parameter Status Description
appointmentId required The id of the Appointment. String, Length 12.

Body Parameters

Parameter Type Status Description
start_time required optional The start time of the period. Unix Timestamp.
end_time required optional The end time of the period. Unix Timestamp.
user_id string required The id of the User. String, Length 10.
client_id string required The id of the Client. String, Length 10.
appointmenttype_id required optional The id of the Appointment Type. String, Length 11.
appointmentstatus_id required optional The id of the Appointment Status. String, Length 11.
description string optional The optional description of the Appointment. String, Max length 255.
note string optional optional note of the Appointment. String.
send_alerts boolean required Should SMS and Email alerts (if allowed by the clients marketing options) be sent?

Delete.

Delete an Appointment.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/appointments/APT-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointments/APT-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointments/APT-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/appointments/APT-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE appointments/{appointmentId}

URL Parameters

Parameter Status Description
appointmentId required The id of the Appointment. String, Length 12.

5. Appointment Types

Endpoints for managing Appointment Types.

Get All.

Get all Appointment Types.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmenttypes',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmenttypes" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "AT-00000001",
        "name": "General",
        "description": "General Dental Appointments",
        "color": "#c1fffb",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    {
        "external_id": "AT-00000002",
        "name": "Orthodontic",
        "description": "Orthodontic Appointment",
        "color": "#e08214",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    {
        "external_id": "AT-00000003",
        "name": "Checkup",
        "description": "Dental Checkup",
        "color": "#41ab5d",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    {
        "external_id": "AT-00000004",
        "name": "Follow Up",
        "description": "Follow Up Appointment",
        "color": "#f2d69e",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    {
        "external_id": "AT-00000005",
        "name": "Consultation",
        "description": "Consultation Appointment",
        "color": "#807dba",
        "created_at": 1677253402,
        "updated_at": 1677253402
    }
]

HTTP Request

GET appointmenttypes

Paginate All.

Paginate all Appointment Types.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmenttypes/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmenttypes/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "AT-00000001",
            "name": "General",
            "description": "General Dental Appointments",
            "color": "#c1fffb",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AT-00000002",
            "name": "Orthodontic",
            "description": "Orthodontic Appointment",
            "color": "#e08214",
            "created_at": 1677253402,
            "updated_at": 1677253402
        }
    ],
    "first_page_url": "https://api.penga.uk/appointmenttypes/perpage/2?page=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "https://api.penga.uk/appointmenttypes/perpage/2?page=3",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointmenttypes/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointmenttypes/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointmenttypes/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointmenttypes/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointmenttypes/perpage/2?page=2",
    "path": "https://api.penga.uk/appointmenttypes/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 5
}

HTTP Request

GET appointmenttypes/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Search.

Search Appointment Types. Maximum results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmenttypes/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Consultation',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes/search'
params = {
  'searchTerm': 'Consultation',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes/search"
);

let params = {
    "searchTerm": "Consultation",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmenttypes/search?searchTerm=Consultation" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "AT-00000005",
        "name": "Consultation",
        "description": "Consultation Appointment",
        "color": "#807dba",
        "created_at": 1677253402,
        "updated_at": 1677253402
    }
]

HTTP Request

GET appointmenttypes/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get One.

Get an Appointment Type by Id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmenttypes/AT-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes/AT-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes/AT-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmenttypes/AT-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "AT-00000002",
    "name": "Orthodontic",
    "description": "Orthodontic Appointment",
    "color": "#e08214",
    "created_at": 1677253402,
    "updated_at": 1677253402
}

HTTP Request

GET appointmenttypes/{appointmentTypeId}

URL Parameters

Parameter Status Description
appointmentTypeId required The id of the Appointment Type. String, Length 11.

Paginated Search.

Paginated Search Appointment Types.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmenttypes/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Consultation',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes/search/perpage/2'
params = {
  'searchTerm': 'Consultation',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes/search/perpage/2"
);

let params = {
    "searchTerm": "Consultation",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmenttypes/search/perpage/2?searchTerm=Consultation&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "AT-00000005",
            "name": "Consultation",
            "description": "Consultation Appointment",
            "color": "#807dba",
            "created_at": 1677253402,
            "updated_at": 1677253402
        }
    ],
    "first_page_url": "https://api.penga.uk/appointmenttypes/search/perpage/2?searchTerm=Consultation&page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/appointmenttypes/search/perpage/2?searchTerm=Consultation&page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointmenttypes/search/perpage/2?searchTerm=Consultation&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/appointmenttypes/search/perpage/2?searchTerm=Consultation",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET appointmenttypes/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Update.

Update an Appointment Type.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/appointmenttypes/AT-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Catch Up',
            'color' => '#345678',
            'description' => 'Catch up session',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes/AT-00000002'
payload = {
    "name": "Catch Up",
    "color": "#345678",
    "description": "Catch up session"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes/AT-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Catch Up",
    "color": "#345678",
    "description": "Catch up session"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/appointmenttypes/AT-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"name":"Catch Up","color":"#345678","description":"Catch up session"}'

Example response (200):

{
    "external_id": "AT-00000002",
    "name": "Catch Up",
    "description": "Catch up session",
    "color": "#345678",
    "created_at": 1677253402,
    "updated_at": 1677253605
}

HTTP Request

PUT appointmenttypes/{appointmentTypeId}

URL Parameters

Parameter Status Description
appointmentTypeId required The id of the entity. String, Length 11.

Body Parameters

Parameter Type Status Description
name string required The name of the Appointment Type. String, Max length 45.
color string optional optional The hex code for the color of the Appointment Type. String, Max length 7.
description string optional The description of the Appointment Type. String, Max length 255.

Create.

Create an Appointment Type.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/appointmenttypes',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Consultation',
            'color' => '#876543',
            'description' => 'Consultation with a subject matter expert',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes'
payload = {
    "name": "Consultation",
    "color": "#876543",
    "description": "Consultation with a subject matter expert"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Consultation",
    "color": "#876543",
    "description": "Consultation with a subject matter expert"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/appointmenttypes" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"name":"Consultation","color":"#876543","description":"Consultation with a subject matter expert"}'

Example response (200):

{
    "external_id": "AT-00000006",
    "name": "Consultation",
    "description": "Consultation with a subject matter expert",
    "color": "#876543",
    "created_at": 1677253607,
    "updated_at": 1677253607
}

HTTP Request

POST appointmenttypes

Body Parameters

Parameter Type Status Description
name string required The name of the Appointment Type. String, Max length 45.
color string optional optional The hex code for the color of the Appointment Type. String, Length 7.
description string optional The description of the Appointment Type. String, Max length 255.

Delete.

Delete an Appointment Type.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/appointmenttypes/AT-00000006',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmenttypes/AT-00000006'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmenttypes/AT-00000006"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/appointmenttypes/AT-00000006" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE appointmenttypes/{appointmentTypeId}

URL Parameters

Parameter Status Description
appointmentTypeId required The id of the Appointment Type to delete. String, Length 11.

6. Appointment Statuses

Endpoints for managing Appointment Statuses.

Get All.

Get all Appointment Statuses.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmentstatuses',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmentstatuses" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "AS-00000001",
        "name": "Pending",
        "description": "Appointment Pending",
        "color": "#00d422",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    {
        "external_id": "AS-00000002",
        "name": "Cancelled",
        "description": "Appointment Cancelled",
        "color": "#E0A800",
        "created_at": 1677253402,
        "updated_at": 1677253402
    },
    {
        "external_id": "AS-00000003",
        "name": "Completed",
        "description": "Appointment Completed",
        "color": "#22e5ff",
        "created_at": 1677253402,
        "updated_at": 1677253402
    }
]

HTTP Request

GET appointmentstatuses

Paginate All.

Paginate all Appointment Statuses.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmentstatuses/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmentstatuses/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "AS-00000001",
            "name": "Pending",
            "description": "Appointment Pending",
            "color": "#00d422",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        {
            "external_id": "AS-00000002",
            "name": "Cancelled",
            "description": "Appointment Cancelled",
            "color": "#E0A800",
            "created_at": 1677253402,
            "updated_at": 1677253402
        }
    ],
    "first_page_url": "https://api.penga.uk/appointmentstatuses/perpage/2?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "https://api.penga.uk/appointmentstatuses/perpage/2?page=2",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointmentstatuses/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/appointmentstatuses/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointmentstatuses/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/appointmentstatuses/perpage/2?page=2",
    "path": "https://api.penga.uk/appointmentstatuses/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 3
}

HTTP Request

GET appointmentstatuses/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Search.

Search Appointment Statuses. Maximum results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmentstatuses/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Pending',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses/search'
params = {
  'searchTerm': 'Pending',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses/search"
);

let params = {
    "searchTerm": "Pending",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmentstatuses/search?searchTerm=Pending" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "AS-00000001",
        "name": "Pending",
        "description": "Appointment Pending",
        "color": "#00d422",
        "created_at": 1677253402,
        "updated_at": 1677253402
    }
]

HTTP Request

GET appointmentstatuses/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get One.

Get an Appointment Status by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmentstatuses/AS-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses/AS-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses/AS-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmentstatuses/AS-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "AS-00000002",
    "name": "Cancelled",
    "description": "Appointment Cancelled",
    "color": "#E0A800",
    "created_at": 1677253402,
    "updated_at": 1677253402
}

HTTP Request

GET appointmentstatuses/{appointmentStatusId}

URL Parameters

Parameter Status Description
appointmentStatusId required The id of the Appointment Status. String, Length 11.

Paginated Search.

Paginated Search Appointment Statuses.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/appointmentstatuses/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Pending',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses/search/perpage/2'
params = {
  'searchTerm': 'Pending',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses/search/perpage/2"
);

let params = {
    "searchTerm": "Pending",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/appointmentstatuses/search/perpage/2?searchTerm=Pending&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "AS-00000001",
            "name": "Pending",
            "description": "Appointment Pending",
            "color": "#00d422",
            "created_at": 1677253402,
            "updated_at": 1677253402
        }
    ],
    "first_page_url": "https://api.penga.uk/appointmentstatuses/search/perpage/2?searchTerm=Pending&page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/appointmentstatuses/search/perpage/2?searchTerm=Pending&page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/appointmentstatuses/search/perpage/2?searchTerm=Pending&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/appointmentstatuses/search/perpage/2?searchTerm=Pending",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET appointmentstatuses/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Update.

Update an Appointment Status.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/appointmentstatuses/AS-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Missed Appointment',
            'color' => '#345678',
            'description' => 'Client missed appointment',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses/AS-00000002'
payload = {
    "name": "Missed Appointment",
    "color": "#345678",
    "description": "Client missed appointment"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses/AS-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Missed Appointment",
    "color": "#345678",
    "description": "Client missed appointment"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/appointmentstatuses/AS-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"name":"Missed Appointment","color":"#345678","description":"Client missed appointment"}'

Example response (200):

{
    "external_id": "AS-00000002",
    "name": "Missed Appointment",
    "description": "Client missed appointment",
    "color": "#345678",
    "created_at": 1677253402,
    "updated_at": 1677253620
}

HTTP Request

PUT appointmentstatuses/{appointmentStatusId}

URL Parameters

Parameter Status Description
appointmentStatusId required The id of the entity. String, Length 11.

Body Parameters

Parameter Type Status Description
name string required The name of the Appointment Status. String, Max length 45.
color string optional optional The hex code for the color of the Appointment Status. String, Max length 7.
description string optional The description of the Appointment Status. String, Max length 255.

Create.

Create an Appointment Status.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/appointmentstatuses',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Did Not Attend',
            'color' => '#876543',
            'description' => 'Client did not attend',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses'
payload = {
    "name": "Did Not Attend",
    "color": "#876543",
    "description": "Client did not attend"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Did Not Attend",
    "color": "#876543",
    "description": "Client did not attend"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/appointmentstatuses" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"name":"Did Not Attend","color":"#876543","description":"Client did not attend"}'

Example response (200):

{
    "external_id": "AS-00000004",
    "name": "Did Not Attend",
    "description": "Client did not attend",
    "color": "#876543",
    "created_at": 1677253622,
    "updated_at": 1677253622
}

HTTP Request

POST appointmentstatuses

Body Parameters

Parameter Type Status Description
name string required The name of the Appointment Status. String, Max length 45.
color string optional optional The hex code for the color of the Appointment Status. String, Max length 7.
description string optional The description of the Appointment Status. String, Max length 255.

Delete.

Delete an Appointment Status.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/appointmentstatuses/AS-00000004',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/appointmentstatuses/AS-00000004'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/appointmentstatuses/AS-00000004"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/appointmentstatuses/AS-00000004" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE appointmentstatuses/{appointmentStatusId}

URL Parameters

Parameter Status Description
appointmentStatusId required The id of the Appointment Status to delete. String, Length 11.

7. Clients

Endpoints for managing Clients.

Search.

Search Clients by First name, Last name, Email, Mobile, Decription, Address, or Postcode. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/clients/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Lisa',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/clients/search'
params = {
  'searchTerm': 'Lisa',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/clients/search"
);

let params = {
    "searchTerm": "Lisa",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/clients/search?searchTerm=Lisa" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "C-00000427",
        "first_name": "Jade",
        "last_name": "James",
        "description": "Centralized system-worthy utilisation",
        "email": "alexander.lloyd@kennedy.com",
        "mobile": "07105203786",
        "created_at": 1667663007,
        "updated_at": 1677253409,
        "address": null,
        "marketing_options": {
            "external_id": "MOC-00000427",
            "notification_sms_allow": 1,
            "notification_email_allow": 1,
            "marketing_sms_allow": 1,
            "marketing_email_allow": 1,
            "manual_notification_email_optout": 0,
            "manual_marketing_email_optout": 0,
            "manual_notification_sms_optout": 0,
            "manual_marketing_sms_optout": 0,
            "created_at": 1677253414,
            "updated_at": 1677253414
        }
    },
    {
        "external_id": "C-00000098",
        "first_name": "Daniel",
        "last_name": "White",
        "description": "Sharable high-level utilisation",
        "email": "vowen@hunter.info",
        "mobile": "07693283661",
        "created_at": 1674229407,
        "updated_at": 1677253408,
        "address": null,
        "marketing_options": {
            "external_id": "MOC-00000098",
            "notification_sms_allow": 1,
            "notification_email_allow": 1,
            "marketing_sms_allow": 1,
            "marketing_email_allow": 1,
            "manual_notification_email_optout": 0,
            "manual_marketing_email_optout": 0,
            "manual_notification_sms_optout": 0,
            "manual_marketing_sms_optout": 0,
            "created_at": 1677253412,
            "updated_at": 1677253412
        }
    },
    {
        "external_id": "C-00000152",
        "first_name": "Lisa",
        "last_name": "Martin",
        "description": "Grass-roots incremental attitude",
        "email": "connor43@wright.com",
        "mobile": "07281128354",
        "created_at": 1673538207,
        "updated_at": 1677253408,
        "address": null,
        "marketing_options": {
            "external_id": "MOC-00000152",
            "notification_sms_allow": 1,
            "notification_email_allow": 1,
            "marketing_sms_allow": 1,
            "marketing_email_allow": 1,
            "manual_notification_email_optout": 0,
            "manual_marketing_email_optout": 0,
            "manual_notification_sms_optout": 0,
            "manual_marketing_sms_optout": 0,
            "created_at": 1677253413,
            "updated_at": 1677253413
        }
    },
    {
        "external_id": "C-00000002",
        "first_name": "Lisa",
        "last_name": "Wright",
        "description": "Lisa W",
        "email": "lisa@example.com",
        "mobile": "07123123456",
        "created_at": 1671551007,
        "updated_at": 1677253407,
        "address": {
            "external_id": "PA-00000002",
            "house_num_name": "16",
            "address_1": "Carmen Village",
            "address_2": "Lake",
            "address_3": null,
            "town": "South Holly",
            "county": "Derbyshire",
            "postcode": "CW11 5SY",
            "created_at": 1677253407,
            "updated_at": 1677253407
        },
        "marketing_options": {
            "external_id": "MOC-00000002",
            "notification_sms_allow": 1,
            "notification_email_allow": 1,
            "marketing_sms_allow": 1,
            "marketing_email_allow": 1,
            "manual_notification_email_optout": 0,
            "manual_marketing_email_optout": 0,
            "manual_notification_sms_optout": 0,
            "manual_marketing_sms_optout": 0,
            "created_at": 1677253407,
            "updated_at": 1677253407
        }
    }
]

HTTP Request

GET clients/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Paginate All.

Paginate all Clients. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/clients/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/clients/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/clients/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/clients/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "C-00000457",
            "first_name": "Bradley",
            "last_name": "Hughes",
            "description": "Quality-focused reciprocal policy",
            "email": "mdavis@yahoo.co.uk",
            "mobile": "07931162390",
            "created_at": 1669736607,
            "updated_at": 1677253410,
            "address": null,
            "marketing_options": {
                "external_id": "MOC-00000457",
                "notification_sms_allow": 1,
                "notification_email_allow": 1,
                "marketing_sms_allow": 1,
                "marketing_email_allow": 1,
                "manual_notification_email_optout": 0,
                "manual_marketing_email_optout": 0,
                "manual_notification_sms_optout": 0,
                "manual_marketing_sms_optout": 0,
                "created_at": 1677253414,
                "updated_at": 1677253414
            }
        },
        {
            "external_id": "C-00000458",
            "first_name": "Ross",
            "last_name": "Collins",
            "description": "Exclusive stable flexibility",
            "email": "ward.karl@taylor.co.uk",
            "mobile": "07182805466",
            "created_at": 1658587407,
            "updated_at": 1677253410,
            "address": null,
            "marketing_options": {
                "external_id": "MOC-00000458",
                "notification_sms_allow": 1,
                "notification_email_allow": 1,
                "marketing_sms_allow": 1,
                "marketing_email_allow": 1,
                "manual_notification_email_optout": 0,
                "manual_marketing_email_optout": 0,
                "manual_notification_sms_optout": 0,
                "manual_marketing_sms_optout": 0,
                "created_at": 1677253414,
                "updated_at": 1677253414
            }
        }
    ],
    "first_page_url": "https://api.penga.uk/clients/perpage/2?page=1",
    "from": 1,
    "last_page": 256,
    "last_page_url": "https://api.penga.uk/clients/perpage/2?page=256",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=255",
            "label": "255",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=256",
            "label": "256",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/clients/perpage/2?page=2",
    "path": "https://api.penga.uk/clients/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 511
}

HTTP Request

GET clients/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get One.

Get a Client by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/clients/C-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/clients/C-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/clients/C-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/clients/C-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "C-00000002",
    "first_name": "Lisa",
    "last_name": "Wright",
    "description": "Lisa W",
    "email": "lisa@example.com",
    "mobile": "07123123456",
    "created_at": 1671551007,
    "updated_at": 1677253407,
    "address": {
        "external_id": "PA-00000002",
        "house_num_name": "16",
        "address_1": "Carmen Village",
        "address_2": "Lake",
        "address_3": null,
        "town": "South Holly",
        "county": "Derbyshire",
        "postcode": "CW11 5SY",
        "created_at": 1677253407,
        "updated_at": 1677253407
    },
    "marketing_options": {
        "external_id": "MOC-00000002",
        "notification_sms_allow": 1,
        "notification_email_allow": 1,
        "marketing_sms_allow": 1,
        "marketing_email_allow": 1,
        "manual_notification_email_optout": 0,
        "manual_marketing_email_optout": 0,
        "manual_notification_sms_optout": 0,
        "manual_marketing_sms_optout": 0,
        "created_at": 1677253407,
        "updated_at": 1677253407
    }
}

HTTP Request

GET clients/{clientId}

URL Parameters

Parameter Status Description
clientId required The id of the Client. String, Length 10.

Update.

Update a Client.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/clients/C-00000022',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'first_name' => 'Jane',
            'last_name' => 'Smith',
            'description' => 'An example client description',
            'address_id' => 'PA-00000002',
            'email' => 'client@example.com',
            'mobile' => '07712012345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/clients/C-00000022'
payload = {
    "first_name": "Jane",
    "last_name": "Smith",
    "description": "An example client description",
    "address_id": "PA-00000002",
    "email": "client@example.com",
    "mobile": "07712012345"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/clients/C-00000022"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "first_name": "Jane",
    "last_name": "Smith",
    "description": "An example client description",
    "address_id": "PA-00000002",
    "email": "client@example.com",
    "mobile": "07712012345"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/clients/C-00000022" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"first_name":"Jane","last_name":"Smith","description":"An example client description","address_id":"PA-00000002","email":"client@example.com","mobile":"07712012345"}'

Example response (200):

{
    "external_id": "C-00000022",
    "first_name": "Jane",
    "last_name": "Smith",
    "description": "An example client description",
    "email": "client@example.com",
    "mobile": "07712012345",
    "created_at": 1652193807,
    "updated_at": 1677253648,
    "address": {
        "external_id": "PA-00000002",
        "house_num_name": "16",
        "address_1": "Carmen Village",
        "address_2": "Lake",
        "address_3": null,
        "town": "South Holly",
        "county": "Derbyshire",
        "postcode": "CW11 5SY",
        "created_at": 1677253407,
        "updated_at": 1677253407
    },
    "marketing_options": {
        "external_id": "MOC-00000022",
        "notification_sms_allow": 1,
        "notification_email_allow": 1,
        "marketing_sms_allow": 1,
        "marketing_email_allow": 1,
        "manual_notification_email_optout": 0,
        "manual_marketing_email_optout": 0,
        "manual_notification_sms_optout": 0,
        "manual_marketing_sms_optout": 0,
        "created_at": 1677253412,
        "updated_at": 1677253412
    }
}

HTTP Request

PUT clients/{clientId}

URL Parameters

Parameter Status Description
clientId required The id of the Client. String, Length 10.

Body Parameters

Parameter Type Status Description
first_name string required The first name of the Client. String, Max length 45.
last_name string required The last name of the Client. String, Max length 45.
description string optional optional The description of the Client. String, Max length 100.
address_id string optional optional The id of the Postal Address of The Client. String, Length 11.
email optional optional The email address of the Client. String, Max length 255.
mobile string optional optional The mobile phone number of the User. String, Length 11.

Create.

Create a Client.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/clients',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'first_name' => 'Jane',
            'last_name' => 'Smith',
            'description' => 'An example client description',
            'address_id' => 'PA-00000002',
            'email' => 'client@example.com',
            'mobile' => '07712012345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/clients'
payload = {
    "first_name": "Jane",
    "last_name": "Smith",
    "description": "An example client description",
    "address_id": "PA-00000002",
    "email": "client@example.com",
    "mobile": "07712012345"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/clients"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "first_name": "Jane",
    "last_name": "Smith",
    "description": "An example client description",
    "address_id": "PA-00000002",
    "email": "client@example.com",
    "mobile": "07712012345"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/clients" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"first_name":"Jane","last_name":"Smith","description":"An example client description","address_id":"PA-00000002","email":"client@example.com","mobile":"07712012345"}'

Example response (200):

{
    "first_name": "Jane",
    "last_name": "Smith",
    "description": "An example client description",
    "email": "client@example.com",
    "mobile": "07712012345",
    "external_id": "C-00000522",
    "updated_at": 1677253649,
    "created_at": 1677253649,
    "address": {
        "external_id": "PA-00000002",
        "house_num_name": "16",
        "address_1": "Carmen Village",
        "address_2": "Lake",
        "address_3": null,
        "town": "South Holly",
        "county": "Derbyshire",
        "postcode": "CW11 5SY",
        "created_at": 1677253407,
        "updated_at": 1677253407
    },
    "marketing_options": {
        "external_id": "MOC-00000522",
        "notification_sms_allow": 1,
        "notification_email_allow": 1,
        "marketing_sms_allow": 1,
        "marketing_email_allow": 1,
        "manual_notification_email_optout": 0,
        "manual_marketing_email_optout": 0,
        "manual_notification_sms_optout": 0,
        "manual_marketing_sms_optout": 0,
        "created_at": 1677253649,
        "updated_at": 1677253649
    }
}

HTTP Request

POST clients

Body Parameters

Parameter Type Status Description
first_name string required The first name of the Client. String, Max length 45.
last_name string required The last name of the Client. String, Max length 45.
description string optional optional The description of the Client. String, Max length 100.
address_id string optional optional The id of the Postal Address of The Client. String, Length 11.
email optional optional The email address of the Client. String, Max length 255.
mobile string optional optional The mobile phone number of the User. String, Length 11.

Paginated Search.

Paginated Search Clients by First name, Last name, Email, Mobile, Decription, Address, or Postcode. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/clients/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Lisa',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/clients/search/perpage/2'
params = {
  'searchTerm': 'Lisa',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/clients/search/perpage/2"
);

let params = {
    "searchTerm": "Lisa",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/clients/search/perpage/2?searchTerm=Lisa&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "C-00000427",
            "first_name": "Jade",
            "last_name": "James",
            "description": "Centralized system-worthy utilisation",
            "email": "alexander.lloyd@kennedy.com",
            "mobile": "07105203786",
            "created_at": 1667663007,
            "updated_at": 1677253409,
            "address": null,
            "marketing_options": {
                "external_id": "MOC-00000427",
                "notification_sms_allow": 1,
                "notification_email_allow": 1,
                "marketing_sms_allow": 1,
                "marketing_email_allow": 1,
                "manual_notification_email_optout": 0,
                "manual_marketing_email_optout": 0,
                "manual_notification_sms_optout": 0,
                "manual_marketing_sms_optout": 0,
                "created_at": 1677253414,
                "updated_at": 1677253414
            }
        },
        {
            "external_id": "C-00000098",
            "first_name": "Daniel",
            "last_name": "White",
            "description": "Sharable high-level utilisation",
            "email": "vowen@hunter.info",
            "mobile": "07693283661",
            "created_at": 1674229407,
            "updated_at": 1677253408,
            "address": null,
            "marketing_options": {
                "external_id": "MOC-00000098",
                "notification_sms_allow": 1,
                "notification_email_allow": 1,
                "marketing_sms_allow": 1,
                "marketing_email_allow": 1,
                "manual_notification_email_optout": 0,
                "manual_marketing_email_optout": 0,
                "manual_notification_sms_optout": 0,
                "manual_marketing_sms_optout": 0,
                "created_at": 1677253412,
                "updated_at": 1677253412
            }
        }
    ],
    "first_page_url": "https://api.penga.uk/clients/search/perpage/2?searchTerm=Lisa&page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "https://api.penga.uk/clients/search/perpage/2?searchTerm=Lisa&page=2",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/search/perpage/2?searchTerm=Lisa&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/clients/search/perpage/2?searchTerm=Lisa&page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/clients/search/perpage/2?searchTerm=Lisa&page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/clients/search/perpage/2?searchTerm=Lisa&page=2",
    "path": "https://api.penga.uk/clients/search/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 4
}

HTTP Request

GET clients/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Delete.

Delete a Client.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/clients/C-00000222',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/clients/C-00000222'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/clients/C-00000222"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/clients/C-00000222" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE clients/{clientId}

URL Parameters

Parameter Status Description
clientId required The id of the Client to delete. String, Length 10.

8. Marketing Options

Endpoints for managing Marketing Options.

Get One.

Get Marketing Options by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/marketing-options-client/MOC-00000022',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/marketing-options-client/MOC-00000022'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/marketing-options-client/MOC-00000022"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/marketing-options-client/MOC-00000022" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "MOC-00000022",
    "notification_sms_allow": 1,
    "notification_email_allow": 1,
    "marketing_sms_allow": 1,
    "marketing_email_allow": 1,
    "manual_notification_email_optout": 0,
    "manual_marketing_email_optout": 0,
    "manual_notification_sms_optout": 0,
    "manual_marketing_sms_optout": 0,
    "created_at": 1677253412,
    "updated_at": 1677253412
}

HTTP Request

GET marketing-options-client/{marketingOptionsId}

URL Parameters

Parameter Status Description
marketingOptionsId required The id of the Marketing Options. String, Length 12.

Update.

Update Marketing Options.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/marketing-options-client/MOC-00000022',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'notification_sms_allow' => '1',
            'notification_email_allow' => '1',
            'marketing_sms_allow' => '1',
            'marketing_email_allow' => '1',
            'manual_notification_sms_optout' => '0',
            'manual_notification_email_optout' => '0',
            'manual_marketing_sms_optout' => '0',
            'manual_marketing_email_optout' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/marketing-options-client/MOC-00000022'
payload = {
    "notification_sms_allow": "1",
    "notification_email_allow": "1",
    "marketing_sms_allow": "1",
    "marketing_email_allow": "1",
    "manual_notification_sms_optout": "0",
    "manual_notification_email_optout": "0",
    "manual_marketing_sms_optout": "0",
    "manual_marketing_email_optout": "0"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/marketing-options-client/MOC-00000022"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "notification_sms_allow": "1",
    "notification_email_allow": "1",
    "marketing_sms_allow": "1",
    "marketing_email_allow": "1",
    "manual_notification_sms_optout": "0",
    "manual_notification_email_optout": "0",
    "manual_marketing_sms_optout": "0",
    "manual_marketing_email_optout": "0"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/marketing-options-client/MOC-00000022" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"notification_sms_allow":"1","notification_email_allow":"1","marketing_sms_allow":"1","marketing_email_allow":"1","manual_notification_sms_optout":"0","manual_notification_email_optout":"0","manual_marketing_sms_optout":"0","manual_marketing_email_optout":"0"}'

Example response (200):

{
    "external_id": "MOC-00000022",
    "notification_sms_allow": 1,
    "notification_email_allow": 1,
    "marketing_sms_allow": 1,
    "marketing_email_allow": 1,
    "manual_notification_email_optout": 0,
    "manual_marketing_email_optout": 0,
    "manual_notification_sms_optout": 0,
    "manual_marketing_sms_optout": 0,
    "created_at": 1677253412,
    "updated_at": 1677253412
}

HTTP Request

PUT marketing-options-client/{marketingOptionsId}

URL Parameters

Parameter Status Description
marketingOptionsId required The id of the Marketing Options. String, Length 12.

Body Parameters

Parameter Type Status Description
notification_sms_allow required optional Are SMS Notifications allowed to this client
notification_email_allow required optional Are Email Notifications allowed to this client
marketing_sms_allow required optional Are SMS Marketing Messages allowed to this client
marketing_email_allow required optional Are Email Marketing Messages allowed to this client
manual_notification_sms_optout required optional Has the client manually opted out of SMS Notifications
manual_notification_email_optout required optional Has the client manually opted out of Email Notifications
manual_marketing_sms_optout required optional Has the client manually opted out of SMS Marketing Messages
manual_marketing_email_optout required optional Has the client manually opted out of Email Marketing Messages

9. Notes

Endpoints for managing Notes.

Search.

Search Notes. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Please',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/search'
params = {
  'searchTerm': 'Please',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/search"
);

let params = {
    "searchTerm": "Please",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/search?searchTerm=Please" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[]

HTTP Request

GET notes/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get One.

Get a Note by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/N-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/N-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/N-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/N-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "N-00000002",
    "note": "Reiciendis dolor veniam magni quod. Quasi quae nihil voluptas. Veniam libero quaerat quaerat at quia.",
    "created_at": 1677253415,
    "updated_at": 1677253415,
    "deleted_at": null,
    "user": {
        "external_id": "U-00000011",
        "name": "Dentists RO Employee",
        "first_name": "Dentists",
        "last_name": "Read Only",
        "email": "readonly@eg-dentists.co.uk",
        "mobile": "07567890123",
        "description": "Accounting Department Read Only User",
        "created_at": 1677253403,
        "updated_at": 1677253403
    },
    "appointment": {
        "external_id": "APT-00000002",
        "start_time": 1667661300,
        "end_time": 1667663100,
        "description": "Operative multi-state leverage",
        "created_at": 1677253415,
        "updated_at": 1677253415,
        "appointmentstatus": {
            "external_id": "AS-00000001",
            "name": "Pending",
            "description": "Appointment Pending",
            "color": "#00d422",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        "appointmenttype": {
            "external_id": "AT-00000001",
            "name": "General",
            "description": "General Dental Appointments",
            "color": "#c1fffb",
            "created_at": 1677253402,
            "updated_at": 1677253402
        },
        "client": {
            "external_id": "C-00000001",
            "first_name": "David",
            "last_name": "Best",
            "description": "David B",
            "email": "david@example.com",
            "mobile": "07717443339",
            "created_at": 1652971407,
            "updated_at": 1677253407,
            "address": {
                "external_id": "PA-00000001",
                "house_num_name": "10",
                "address_1": "Downing Street",
                "address_2": "City of Westminster",
                "address_3": "",
                "town": "London",
                "county": "Greater London",
                "postcode": "SW1A 2AA",
                "created_at": 1677253398,
                "updated_at": 1677253398
            },
            "marketing_options": {
                "external_id": "MOC-00000001",
                "notification_sms_allow": 1,
                "notification_email_allow": 1,
                "marketing_sms_allow": 1,
                "marketing_email_allow": 1,
                "manual_notification_email_optout": 0,
                "manual_marketing_email_optout": 0,
                "manual_notification_sms_optout": 0,
                "manual_marketing_sms_optout": 0,
                "created_at": 1677253407,
                "updated_at": 1677253407
            }
        },
        "user": {
            "external_id": "U-00000011",
            "name": "Dentists RO Employee",
            "first_name": "Dentists",
            "last_name": "Read Only",
            "email": "readonly@eg-dentists.co.uk",
            "mobile": "07567890123",
            "description": "Accounting Department Read Only User",
            "created_at": 1677253403,
            "updated_at": 1677253403
        },
        "createdbyuser": {
            "external_id": "U-00000007",
            "name": "Dentists Owner",
            "first_name": "Dentists",
            "last_name": "Owner",
            "email": "admin@eg-dentists.co.uk",
            "mobile": "07123456789",
            "description": "The Boss of Our Company",
            "created_at": 1677253403,
            "updated_at": 1677253661
        },
        "departments": [
            {
                "external_id": "D-00000003",
                "name": "Admin",
                "description": "Calendar Administrators",
                "color": "#88B04B",
                "created_at": 1677253401,
                "updated_at": 1677253401
            }
        ]
    },
    "client": null,
    "history": [
        {
            "external_id": "N-00000044",
            "note": "Dolorum inventore voluptate aut ipsa facilis. Ut commodi doloribus voluptas qui voluptate eum molestiae. Quas voluptas ut facere at veritatis. Nesciunt eaque necessitatibus dolor.",
            "created_at": 1677253416,
            "updated_at": 1677253416,
            "deleted_at": null,
            "user": {
                "external_id": "U-00000009",
                "name": "Dentists RW Employee",
                "first_name": "Dentists",
                "last_name": "Read Write",
                "email": "readwrite@eg-dentists.co.uk",
                "mobile": "07345678901",
                "description": "Dental Hygienist",
                "created_at": 1677253403,
                "updated_at": 1677253403
            }
        }
    ]
}

HTTP Request

GET notes/{noteId}

URL Parameters

Parameter Status Description
noteId required The id of the Note. String, Length 10.

Paginated Search.

Paginated Search Notes. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Please',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/search/perpage/2'
params = {
  'searchTerm': 'Please',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/search/perpage/2"
);

let params = {
    "searchTerm": "Please",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/search/perpage/2?searchTerm=Please&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [],
    "first_page_url": "https://api.penga.uk/notes/search/perpage/2?searchTerm=Please&page=1",
    "from": null,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/notes/search/perpage/2?searchTerm=Please&page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/search/perpage/2?searchTerm=Please&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/notes/search/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": null,
    "total": 0
}

HTTP Request

GET notes/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Delete.

Delete a Note.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/notes/N-00000001',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/N-00000001'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/N-00000001"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/notes/N-00000001" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE notes/{noteId}

URL Parameters

Parameter Status Description
noteId required The id of the Note. String, Length 10.

Permanently Delete.

Permanently Delete a Note.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/notes/force/N-00000001',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/force/N-00000001'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/force/N-00000001"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/notes/force/N-00000001" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": false
}

HTTP Request

DELETE notes/force/{noteId}

URL Parameters

Parameter Status Description
noteId required The id of the Note. String, Length 10.

Paginate Appointment Notes.

Paginate all by Appointment id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/appointment/APT-00000007/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/appointment/APT-00000007/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/appointment/APT-00000007/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/appointment/APT-00000007/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "N-00000007",
            "note": "Delectus dolor quaerat temporibus incidunt. Possimus qui quam optio blanditiis repellendus ipsum eum autem. Ut quam culpa quibusdam repellat possimus.",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "user": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "appointment": {
                "external_id": "APT-00000007"
            },
            "client": null,
            "history": []
        }
    ],
    "first_page_url": "https://api.penga.uk/notes/appointment/APT-00000007/perpage/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/notes/appointment/APT-00000007/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/appointment/APT-00000007/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/notes/appointment/APT-00000007/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET notes/appointment/{appointmentId}/perpage/{perPage}

URL Parameters

Parameter Status Description
appointmentId required The id of the Appointment. String, Length 12.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate Client Notes.

Paginate all by Appointment id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/client/C-00000007/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/client/C-00000007/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/client/C-00000007/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/client/C-00000007/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [],
    "first_page_url": "https://api.penga.uk/notes/client/C-00000007/perpage/2?page=1",
    "from": null,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/notes/client/C-00000007/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/client/C-00000007/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/notes/client/C-00000007/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": null,
    "total": 0
}

HTTP Request

GET notes/client/{clientId}/perpage/{perPage}

URL Parameters

Parameter Status Description
clientId required The id of the Client. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Create.

Create a Note.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/notes',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'note' => 'Please ensure client is given loyalty discount of 10%',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes'
payload = {
    "note": "Please ensure client is given loyalty discount of 10%"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/notes"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "note": "Please ensure client is given loyalty discount of 10%"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/notes" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"note":"Please ensure client is given loyalty discount of 10%"}'

Example response (200):

{
    "note": "Please ensure client is given loyalty discount of 10%",
    "external_id": "N-00001166",
    "updated_at": 1677253675,
    "created_at": 1677253675,
    "user": {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner",
        "email": "admin@eg-dentists.co.uk",
        "mobile": "07123456789",
        "description": "The Boss of Our Company",
        "created_at": 1677253403,
        "updated_at": 1677253673
    },
    "appointment": null,
    "client": null,
    "history": []
}

HTTP Request

POST notes

Body Parameters

Parameter Type Status Description
note string required The note. String, Max length 255.

Paginate User Notes.

Paginate all by User id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/user/U-00000007/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/user/U-00000007/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/user/U-00000007/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "N-00001166",
            "note": "Please ensure client is given loyalty discount of 10%",
            "created_at": 1677253675,
            "updated_at": 1677253675,
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "appointment": null,
            "client": null,
            "history": []
        },
        {
            "external_id": "N-00001122",
            "note": "Tenetur vero nobis praesentium odio reiciendis ut iste. Et vero voluptas et eum totam aperiam. Ea dolorum voluptatem atque quia velit cupiditate porro. Et aut natus aut ut ipsum nihil.",
            "created_at": 1677253455,
            "updated_at": 1677253455,
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "appointment": {
                "external_id": "APT-00001122"
            },
            "client": null,
            "history": []
        }
    ],
    "first_page_url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=1",
    "from": 1,
    "last_page": 111,
    "last_page_url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=111",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=110",
            "label": "110",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=111",
            "label": "111",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/notes/user/U-00000007/perpage/2?page=2",
    "path": "https://api.penga.uk/notes/user/U-00000007/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 221
}

HTTP Request

GET notes/user/{userId}/perpage/{perPage}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate Notes by Parent.

Paginate all by Parent Note id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/parent/N-00000007/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/parent/N-00000007/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/parent/N-00000007/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/parent/N-00000007/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "N-00000007",
            "note": "Delectus dolor quaerat temporibus incidunt. Possimus qui quam optio blanditiis repellendus ipsum eum autem. Ut quam culpa quibusdam repellat possimus.",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "user": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "appointment": {
                "external_id": "APT-00000007"
            },
            "client": null,
            "history": []
        }
    ],
    "first_page_url": "https://api.penga.uk/notes/parent/N-00000007/perpage/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/notes/parent/N-00000007/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/notes/parent/N-00000007/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/notes/parent/N-00000007/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET notes/parent/{parentNoteId}/perpage/{perPage}

URL Parameters

Parameter Status Description
parentNoteId required The id of parent Note. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get a Deleted Note.

Get a Deleted Note by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/notes/deleted/N-00000001',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/notes/deleted/N-00000001'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/notes/deleted/N-00000001"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/notes/deleted/N-00000001" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "N-00000001",
    "note": "Animi nobis doloremque quas odit pariatur molestiae illum. Nulla aperiam aut magni nostrum voluptas distinctio asperiores. Maxime quisquam dolorem commodi ullam et rem quam. Est reiciendis velit quam.",
    "created_at": 1677253415,
    "updated_at": 1677253667,
    "user": {
        "external_id": "U-00000007",
        "name": "Dentists Owner",
        "first_name": "Dentists",
        "last_name": "Owner"
    },
    "appointment": {
        "external_id": "APT-00000001"
    },
    "client": null,
    "history": []
}

HTTP Request

GET notes/deleted/{noteId}

URL Parameters

Parameter Status Description
noteId required The id of the Note. String, Length 10.

10. Postal Addresses

Endpoints for managing Postal Addresses.

Get One.

Get a Postal Address by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/postaladdress/PA-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/postaladdress/PA-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/postaladdress/PA-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/postaladdress/PA-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "PA-00000002",
    "house_num_name": "16",
    "address_1": "Carmen Village",
    "address_2": "Lake",
    "address_3": null,
    "town": "South Holly",
    "county": "Derbyshire",
    "postcode": "CW11 5SY",
    "created_at": 1677253407,
    "updated_at": 1677253407
}

HTTP Request

GET postaladdress/{postalAddressId}

URL Parameters

Parameter Status Description
postalAddressId required The id of the Postal Address. String, Length 11.

Create.

Create a Postal Address.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/postaladdress',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'house_num_name' => '10',
            'address_1' => 'Downing Street',
            'address_2' => 'City of Westminster',
            'address_3' => 'iusto',
            'town' => 'London',
            'county' => 'Greater London',
            'postcode' => 'SW1A 2AA',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/postaladdress'
payload = {
    "house_num_name": "10",
    "address_1": "Downing Street",
    "address_2": "City of Westminster",
    "address_3": "iusto",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AA"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/postaladdress"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "house_num_name": "10",
    "address_1": "Downing Street",
    "address_2": "City of Westminster",
    "address_3": "iusto",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AA"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/postaladdress" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"house_num_name":"10","address_1":"Downing Street","address_2":"City of Westminster","address_3":"iusto","town":"London","county":"Greater London","postcode":"SW1A 2AA"}'

Example response (200):

{
    "house_num_name": "10",
    "address_1": "Downing Street",
    "address_2": "City of Westminster",
    "address_3": "iusto",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AA",
    "external_id": "PA-00000012",
    "updated_at": 1677253737,
    "created_at": 1677253737
}

HTTP Request

POST postaladdress

Body Parameters

Parameter Type Status Description
house_num_name required optional The house name or number. String, Max length 45.
address_1 optional optional The house name or number of the postal address. String, Max length 45.
address_2 optional optional The first line of the postal address. String, Max length 45.
address_3 optional optional The first line of the postal address. String, Max length 45.
town optional optional The town the postal address is situated in. String, Max length 45.
county optional optional The county the postal address is situated in. String, Max length 45.
postcode optional optional The postcode of the postal address. String, Max length 10.

Update.

Update a Postal Address.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/postaladdress/PA-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'house_num_name' => '10',
            'address_1' => 'Downing Street',
            'address_2' => 'City of Westminster',
            'address_3' => 'dignissimos',
            'town' => 'London',
            'county' => 'Greater London',
            'postcode' => 'SW1A 2AA',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/postaladdress/PA-00000002'
payload = {
    "house_num_name": "10",
    "address_1": "Downing Street",
    "address_2": "City of Westminster",
    "address_3": "dignissimos",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AA"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/postaladdress/PA-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "house_num_name": "10",
    "address_1": "Downing Street",
    "address_2": "City of Westminster",
    "address_3": "dignissimos",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AA"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/postaladdress/PA-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"house_num_name":"10","address_1":"Downing Street","address_2":"City of Westminster","address_3":"dignissimos","town":"London","county":"Greater London","postcode":"SW1A 2AA"}'

Example response (200):

{
    "external_id": "PA-00000002",
    "house_num_name": "10",
    "address_1": "Downing Street",
    "address_2": "City of Westminster",
    "address_3": "dignissimos",
    "town": "London",
    "county": "Greater London",
    "postcode": "SW1A 2AA",
    "created_at": 1677253407,
    "updated_at": 1677253739
}

HTTP Request

PUT postaladdress/{postalAddressId}

URL Parameters

Parameter Status Description
postalAddressId required The id of the Postal Address. String, Length 11.

Body Parameters

Parameter Type Status Description
house_num_name required optional The house name or number. String, Max length 45.
address_1 optional optional The house name or number of the postal address. String, Max length 45.
address_2 optional optional The first line of the postal address. String, Max length 45.
address_3 optional optional The first line of the postal address. String, Max length 45.
town optional optional The town the postal address is situated in. String, Max length 45.
county optional optional The county the postal address is situated in. String, Max length 45.
postcode optional optional The postcode of the postal address. String, Max length 10.

11. SMS Message Templates

Endpoints for managing SMS Message Templates.

Search.

Search SMS Templates. Maximum results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-templates/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Appointment',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates/search'
params = {
  'searchTerm': 'Appointment',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates/search"
);

let params = {
    "searchTerm": "Appointment",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-templates/search?searchTerm=Appointment" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "SMST-00000001",
        "template_id": 1,
        "template_type_id": 1,
        "template_name": "New Appointment",
        "template_body": "Dear { CLIENT_FIRST_NAME }\n\nYou have an { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
        "organisation_id": 2,
        "created_at": null,
        "updated_at": 1677253407
    },
    {
        "external_id": "SMST-00000002",
        "template_id": 2,
        "template_type_id": 1,
        "template_name": "Appointment Reminder",
        "template_body": "Dont forget your { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
        "organisation_id": 2,
        "created_at": null,
        "updated_at": 1677253407
    },
    {
        "external_id": "SMST-00000003",
        "template_id": 3,
        "template_type_id": 1,
        "template_name": "Appointment Time Change",
        "template_body": "Your { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } is now from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
        "organisation_id": 2,
        "created_at": null,
        "updated_at": 1677253407
    }
]

HTTP Request

GET sms-templates/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get All.

Get all SMS Templates.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-templates',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-templates" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "template_id": 5,
        "template_type_id": 2,
        "external_id": "SMST-00000005",
        "template_name": "Party Invitation",
        "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ...",
        "organisation_id": "2",
        "created_at": 1677253407,
        "updated_at": 1677253407
    },
    {
        "template_id": 4,
        "template_type_id": 2,
        "external_id": "SMST-00000004",
        "template_name": "Special Offer",
        "template_body": "Dear { CLIENT_FULL_NAME }, We'd like to offer you an exclusive deal ...",
        "organisation_id": "2",
        "created_at": 1677253407,
        "updated_at": 1677253407
    },
    {
        "template_id": 3,
        "template_type_id": 1,
        "external_id": "SMST-00000003",
        "template_name": "Appointment Time Change",
        "template_body": "Your { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } is now from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
        "organisation_id": "2",
        "created_at": null,
        "updated_at": 1677253407
    },
    {
        "template_id": 2,
        "template_type_id": 1,
        "external_id": "SMST-00000002",
        "template_name": "Appointment Reminder",
        "template_body": "Dont forget your { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
        "organisation_id": "2",
        "created_at": null,
        "updated_at": 1677253407
    },
    {
        "template_id": 1,
        "template_type_id": 1,
        "external_id": "SMST-00000001",
        "template_name": "New Appointment",
        "template_body": "Dear { CLIENT_FIRST_NAME }\n\nYou have an { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
        "organisation_id": "2",
        "created_at": null,
        "updated_at": 1677253407
    }
]

HTTP Request

GET sms-templates

Paginate All.

Paginate all SMS Templates.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-templates/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-templates/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "template_id": 1,
            "template_type_id": 1,
            "external_id": "SMST-00000001",
            "template_name": "New Appointment",
            "template_body": "Dear { CLIENT_FIRST_NAME }\n\nYou have an { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
            "organisation_id": 2,
            "created_at": null,
            "updated_at": 1677253407
        },
        {
            "template_id": 2,
            "template_type_id": 1,
            "external_id": "SMST-00000002",
            "template_name": "Appointment Reminder",
            "template_body": "Dont forget your { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
            "organisation_id": 2,
            "created_at": null,
            "updated_at": 1677253407
        }
    ],
    "first_page_url": "/?page=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "/?page=3",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "/?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "/?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "/?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "/?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "/?page=2",
    "path": "/",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 5
}

HTTP Request

GET sms-templates/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Get One.

Get an SMS Template by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-templates/SMST-00000005',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates/SMST-00000005'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates/SMST-00000005"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-templates/SMST-00000005" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "template_id": 5,
    "template_type_id": 2,
    "external_id": "SMST-00000005",
    "template_name": "Party Invitation",
    "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ...",
    "organisation_id": "2",
    "created_at": 1677253407,
    "updated_at": 1677253407
}

HTTP Request

GET sms-templates/{smsTemplateId}

URL Parameters

Parameter Status Description
smsTemplateId required The id of the SMS Template. String, Length 13.

Create.

Create an SMS Template.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/sms-templates',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'template_name' => 'Feb Party Invite',
            'template_body' => '{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ...',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates'
payload = {
    "template_name": "Feb Party Invite",
    "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ..."
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "template_name": "Feb Party Invite",
    "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ..."
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/sms-templates" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"template_name":"Feb Party Invite","template_body":"{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ..."}'

Example response (200):

{
    "external_id": "SMST-00000006",
    "organisation_id": 2,
    "template_id": 6,
    "template_type_id": 2,
    "template_name": "Feb Party Invite",
    "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ...",
    "created_at": 1677253634,
    "updated_at": 1677253634
}

HTTP Request

POST sms-templates

Body Parameters

Parameter Type Status Description
template_name string required The name of the SMS Template. String, Max length 45.
template_body string optional The body of the SMS Template which may include placeholders String, Max length 180.

Update.

Update an SMS Template.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/sms-templates/SMST-00000005',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'template_name' => 'Feb Party Invite',
            'template_body' => '{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ...',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates/SMST-00000005'
payload = {
    "template_name": "Feb Party Invite",
    "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ..."
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates/SMST-00000005"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "template_name": "Feb Party Invite",
    "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ..."
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/sms-templates/SMST-00000005" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"template_name":"Feb Party Invite","template_body":"{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ..."}'

Example response (200):

{
    "external_id": "SMST-00000005",
    "organisation_id": 2,
    "template_id": 5,
    "template_type_id": 2,
    "template_name": "Feb Party Invite",
    "template_body": "{ CLIENT_FIRST_NAME }, Come join the party on Feb 25th ...",
    "created_at": 1677253407,
    "updated_at": 1677253636
}

HTTP Request

PUT sms-templates/{smsTemplateId}

URL Parameters

Parameter Status Description
smsTemplateId required The id of the SMS Template. String, Length 13.

Body Parameters

Parameter Type Status Description
template_name string required The name of the SMS Template. String, Max length 45.
template_body string optional The body of the SMS Template which may include placeholders String, Max length 180.

Paginated Search.

Paginated Search SMS Templates.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-templates/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Appointment',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates/search/perpage/2'
params = {
  'searchTerm': 'Appointment',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates/search/perpage/2"
);

let params = {
    "searchTerm": "Appointment",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "SMST-00000001",
            "template_id": 1,
            "template_name": "New Appointment",
            "template_body": "Dear { CLIENT_FIRST_NAME }\n\nYou have an { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
            "organisation_id": 2,
            "created_at": null,
            "updated_at": 1677253407
        },
        {
            "external_id": "SMST-00000002",
            "template_id": 2,
            "template_name": "Appointment Reminder",
            "template_body": "Dont forget your { APPOINTMENT_TYPE } appointment with { USER_FULL_NAME } from { APPOINTMENT_START } to { APPOINTMENT_END }\n\nthanks { ORGANISATION_NAME }",
            "organisation_id": 2,
            "created_at": null,
            "updated_at": 1677253407
        }
    ],
    "first_page_url": "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment&page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment&page=2",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment&page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment&page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment&page=2",
    "path": "https://api.penga.uk/sms-templates/search/perpage/2?searchTerm=Appointment",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 3
}

HTTP Request

GET sms-templates/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Delete.

Delete an Appointment Type.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/sms-templates/SMST-00000005',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-templates/SMST-00000005'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-templates/SMST-00000005"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/sms-templates/SMST-00000005" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE sms-templates/{smsTemplateId}

URL Parameters

Parameter Status Description
smsTemplateId required The id of the SMS Template. String, Length 13.

12. SMS Messages

Endpoints for managing SMS Messages.

Paginate by Appointment.

Paginate all SMS Message by Appointment id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "SMS-00000013",
            "send_time": 1677257015,
            "template_name": "New Appointment",
            "message_body": "Et quia modi illo natus eum vero eum. Illum ipsa commodi non laudantium.",
            "recipient_number": "07717443339",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "user": {
                "external_id": "U-00000011",
                "name": "Dentists RO Employee",
                "first_name": "Dentists",
                "last_name": "Read Only"
            },
            "client": {
                "external_id": "C-00000001",
                "first_name": "David",
                "last_name": "Best"
            },
            "appointment": {
                "external_id": "APT-00000003"
            },
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        }
    ],
    "first_page_url": "https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2?page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/sms-messages/appointment/APT-00000003/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET sms-messages/appointment/{appointmentId}/perpage/{perPage}

URL Parameters

Parameter Status Description
appointmentId required The id of the Appointment. String, Length 12.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by Client.

Paginate all by Client id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-messages/client/C-00000002/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/client/C-00000002/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "SMS-00000021",
            "send_time": 1677257015,
            "template_name": "New Appointment",
            "message_body": "Ex illo possimus ut unde ea. Officia ut sit dolorum saepe aspernatur. Nihil totam sit aut.",
            "recipient_number": "07123123456",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "user": {
                "external_id": "U-00000008",
                "name": "Dentists Admin",
                "first_name": "Dentists",
                "last_name": "Admin"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "appointment": {
                "external_id": "APT-00000011"
            },
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        },
        {
            "external_id": "SMS-00000022",
            "send_time": 1677257015,
            "template_name": "New Appointment",
            "message_body": "In amet at mollitia rem voluptates. Illo et sit rerum quia ad. Optio necessitatibus enim nam.",
            "recipient_number": "07123123456",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "user": {
                "external_id": "U-00000012",
                "name": "Dentists Bookings Only",
                "first_name": "Dentists",
                "last_name": "Bookings Only"
            },
            "client": {
                "external_id": "C-00000002",
                "first_name": "Lisa",
                "last_name": "Wright"
            },
            "appointment": {
                "external_id": "APT-00000012"
            },
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        }
    ],
    "first_page_url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=1",
    "from": 1,
    "last_page": 5,
    "last_page_url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=5",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2?page=2",
    "path": "https://api.penga.uk/sms-messages/client/C-00000002/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 10
}

HTTP Request

GET sms-messages/client/{clientId}/perpage/{perPage}

URL Parameters

Parameter Status Description
clientId required The id of the Client. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate All.

Paginate all SMS Messages. Ordered by Send Time in Ascending Order. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-messages/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-messages/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "SMS-00000011",
            "send_time": 1677257015,
            "template_name": "New Appointment",
            "message_body": "Vel ea minus sit quasi. Odit est iusto itaque magni.",
            "recipient_number": "07717443339",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "client": {
                "external_id": "C-00000001",
                "first_name": "David",
                "last_name": "Best"
            },
            "appointment": {
                "external_id": "APT-00000001"
            },
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        },
        {
            "external_id": "SMS-00000012",
            "send_time": 1677257015,
            "template_name": "New Appointment",
            "message_body": "Animi assumenda sapiente quia magni ad sint sunt cum. Ipsum qui ullam eum vitae enim.",
            "recipient_number": "07717443339",
            "created_at": 1677253415,
            "updated_at": 1677253415,
            "user": {
                "external_id": "U-00000011",
                "name": "Dentists RO Employee",
                "first_name": "Dentists",
                "last_name": "Read Only"
            },
            "client": {
                "external_id": "C-00000001",
                "first_name": "David",
                "last_name": "Best"
            },
            "appointment": {
                "external_id": "APT-00000002"
            },
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        }
    ],
    "first_page_url": "https://api.penga.uk/sms-messages/perpage/2?page=1",
    "from": 1,
    "last_page": 577,
    "last_page_url": "https://api.penga.uk/sms-messages/perpage/2?page=577",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=576",
            "label": "576",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=577",
            "label": "577",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/sms-messages/perpage/2?page=2",
    "path": "https://api.penga.uk/sms-messages/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 1154
}

HTTP Request

GET sms-messages/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Paginate by User.

Paginate all SMS Messages sent by the given User id. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-messages/user/U-00000007/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/user/U-00000007/perpage/2'
params = {
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2"
);

let params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "SMS-00001132",
            "send_time": 1677257055,
            "template_name": "New Appointment",
            "message_body": "Reiciendis eius non cum doloribus in. Quia commodi sit est et est. Sit molestiae nihil vel sint.",
            "recipient_number": "07996903551",
            "created_at": 1677253455,
            "updated_at": 1677253455,
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "client": {
                "external_id": "C-00000133",
                "first_name": "Matthew",
                "last_name": "Turner"
            },
            "appointment": {
                "external_id": "APT-00001122"
            },
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        },
        {
            "external_id": "SMS-00001133",
            "send_time": 1677257055,
            "template_name": "New Appointment",
            "message_body": "Repudiandae doloribus quas sint. Porro velit dignissimos officia temporibus ut dolore ex.",
            "recipient_number": "07600578298",
            "created_at": 1677253455,
            "updated_at": 1677253455,
            "user": {
                "external_id": "U-00000007",
                "name": "Dentists Owner",
                "first_name": "Dentists",
                "last_name": "Owner"
            },
            "client": {
                "external_id": "C-00000105",
                "first_name": "Lucy",
                "last_name": "White"
            },
            "appointment": {
                "external_id": "APT-00001123"
            },
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        }
    ],
    "first_page_url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=1",
    "from": 1,
    "last_page": 111,
    "last_page_url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=111",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=2",
            "label": "2",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=3",
            "label": "3",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=4",
            "label": "4",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=5",
            "label": "5",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=6",
            "label": "6",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=7",
            "label": "7",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=8",
            "label": "8",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=9",
            "label": "9",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=10",
            "label": "10",
            "active": false
        },
        {
            "url": null,
            "label": "...",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=110",
            "label": "110",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=111",
            "label": "111",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=2",
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2?page=2",
    "path": "https://api.penga.uk/sms-messages/user/U-00000007/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 221
}

HTTP Request

GET sms-messages/user/{userId}/perpage/{perPage}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
page optional The page number to return. Integer.

Create.

Create and send an SMS Message.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/sms-messages',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'message_type_id' => 1,
            'recipient_number' => '07789012345',
            'message_body' => 'Sarah, Come join the party on Feb 25th ...',
            'send_time' => '1577836800',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages'
payload = {
    "message_type_id": 1,
    "recipient_number": "07789012345",
    "message_body": "Sarah, Come join the party on Feb 25th ...",
    "send_time": "1577836800"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "message_type_id": 1,
    "recipient_number": "07789012345",
    "message_body": "Sarah, Come join the party on Feb 25th ...",
    "send_time": "1577836800"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/sms-messages" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"message_type_id":1,"recipient_number":"07789012345","message_body":"Sarah, Come join the party on Feb 25th ...","send_time":"1577836800"}'

Example response (200):

{
    "recipient_number": "07789012345",
    "message_body": "Sarah, Come join the party on Feb 25th ...",
    "send_time": 1677253545,
    "template_name": "None",
    "external_id": "SMS-00001175",
    "updated_at": 1677253545,
    "created_at": 1677253545,
    "user": null
}

HTTP Request

POST sms-messages

Body Parameters

Parameter Type Status Description
message_type_id integer optional optional The type of message (notification or marketing). Integer, Max length 1.
recipient_number string optional optional The mobile phone number to send the message to. String, Length 11.
message_body string optional The body of the SMS Template which may include placeholders. String, Max length 180.
send_time required optional The time to send the message. Unix Timestamp.

Paginated Search.

Paginated Search SMS Messages. Maximum page size 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-messages/search/perpage/2',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Party',
            'page'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/search/perpage/2'
params = {
  'searchTerm': 'Party',
  'page': '1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/search/perpage/2"
);

let params = {
    "searchTerm": "Party",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-messages/search/perpage/2?searchTerm=Party&page=1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "current_page": 1,
    "data": [
        {
            "external_id": "SMS-00001175",
            "send_time": 1677253545,
            "template_name": "None",
            "message_body": "Sarah, Come join the party on Feb 25th ...",
            "recipient_number": "07789012345",
            "created_at": 1677253545,
            "updated_at": 1677253545,
            "user": null,
            "client": null,
            "appointment": null,
            "status": {
                "id": 4,
                "name": "Sent"
            },
            "type": {
                "id": 1,
                "name": "Notification"
            }
        }
    ],
    "first_page_url": "https://api.penga.uk/sms-messages/search/perpage/2?searchTerm=Party&page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.penga.uk/sms-messages/search/perpage/2?searchTerm=Party&page=1",
    "links": [
        {
            "url": null,
            "label": "pagination.previous",
            "active": false
        },
        {
            "url": "https://api.penga.uk/sms-messages/search/perpage/2?searchTerm=Party&page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "pagination.next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "https://api.penga.uk/sms-messages/search/perpage/2",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

HTTP Request

GET sms-messages/search/perpage/{perPage}

URL Parameters

Parameter Status Description
perPage required The number of items to return per page. Integer.

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.
page optional The page number to return. Integer.

Search.

Search SMS Messages. Maximum number of results returned 10.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-messages/search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'searchTerm'=> 'Party',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/search'
params = {
  'searchTerm': 'Party',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/search"
);

let params = {
    "searchTerm": "Party",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-messages/search?searchTerm=Party" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[
    {
        "external_id": "SMS-00001175",
        "send_time": 1677253545,
        "template_name": "None",
        "message_body": "Sarah, Come join the party on Feb 25th ...",
        "recipient_number": "07789012345",
        "created_at": 1677253545,
        "updated_at": 1677253545,
        "user": null,
        "client": null,
        "appointment": null,
        "status": {
            "id": 4,
            "name": "Sent"
        },
        "type": {
            "id": 1,
            "name": "Notification"
        }
    }
]

HTTP Request

GET sms-messages/search

Query Parameters

Parameter Status Description
searchTerm optional The term to search for. String, Max length 25.

Get One.

Get an SMS Message by id.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/sms-messages/SMS-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/SMS-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/SMS-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/sms-messages/SMS-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "external_id": "SMS-00000002",
    "send_time": 1677257015,
    "template_name": "New Appointment",
    "notification_method_id": 2,
    "message_body": "Sunt impedit dolorem enim ratione sit in mollitia. Blanditiis iste iste earum illo ut.",
    "recipient_number": "07717443339",
    "created_at": 1677253415,
    "updated_at": 1677253415,
    "deleted_at": null,
    "user": null,
    "client": null,
    "appointment": null,
    "status": {
        "id": 4,
        "name": "Sent"
    },
    "type": {
        "id": 1,
        "name": "Notification"
    }
}

HTTP Request

GET sms-messages/{smsMessageId}

URL Parameters

Parameter Status Description
smsMessageId required The id of the SMS Message. String, Length 12.

Update.

Update an SMS Message - only use is to change the send time


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.penga.uk/sms-messages/SMS-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'send_time' => '1577836800',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/SMS-00000002'
payload = {
    "send_time": "1577836800"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/SMS-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "send_time": "1577836800"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.penga.uk/sms-messages/SMS-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"send_time":"1577836800"}'

Example response (200):

{
    "external_id": "SMS-00000002",
    "send_time": 1577836800,
    "template_name": "New Appointment",
    "notification_method_id": 2,
    "message_body": "Sunt impedit dolorem enim ratione sit in mollitia. Blanditiis iste iste earum illo ut.",
    "recipient_number": "07717443339",
    "created_at": 1677253415,
    "updated_at": 1677253552,
    "deleted_at": null,
    "user": null,
    "client": null,
    "appointment": null,
    "status": {
        "id": 4,
        "name": "Sent"
    },
    "type": {
        "id": 1,
        "name": "Notification"
    }
}

HTTP Request

PUT sms-messages/{smsMessageId}

URL Parameters

Parameter Status Description
smsMessageId required The id of the SMS Message. String, Length 12.

Body Parameters

Parameter Type Status Description
send_time required optional The time to send the message. Unix Timestamp.

Delete.

Delete an SMS Message.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.penga.uk/sms-messages/SMS-00000002',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/sms-messages/SMS-00000002'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/sms-messages/SMS-00000002"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.penga.uk/sms-messages/SMS-00000002" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

{
    "success": true
}

HTTP Request

DELETE sms-messages/{smsMessageId}

URL Parameters

Parameter Status Description
smsMessageId required The id of the SMS Message. String, Length 12.

14. Calendar

Endpoints for retrieving Calendar Appointments.

Get by User and Time Period.

Get all Calendar Appointments by User id within the given Time Period. Maximum number of results returned 1000.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/calendar/user/U-00000007/starttime/1577836800/endtime/1588377600',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/calendar/user/U-00000007/starttime/1577836800/endtime/1588377600'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/calendar/user/U-00000007/starttime/1577836800/endtime/1588377600"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/calendar/user/U-00000007/starttime/1577836800/endtime/1588377600" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[]

HTTP Request

GET calendar/user/{userId}/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
userId required The id of the User. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

Get by Department and Time Period.

Get all Calendar Appointments by Department id within the given Time Period. Maximum number of results returned 1000.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/calendar/department/D-00000002/starttime/1577836800/endtime/1588377600',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/calendar/department/D-00000002/starttime/1577836800/endtime/1588377600'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/calendar/department/D-00000002/starttime/1577836800/endtime/1588377600"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/calendar/department/D-00000002/starttime/1577836800/endtime/1588377600" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[]

HTTP Request

GET calendar/department/{departmentId}/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
departmentId required The id of the Department. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

Get by Time Period.

Get all Calendar Appointments within the given Time Period. Maximum number of results returned 1000.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/calendar/starttime/1577836800/endtime/1588377600',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/calendar/starttime/1577836800/endtime/1588377600'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/calendar/starttime/1577836800/endtime/1588377600"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/calendar/starttime/1577836800/endtime/1588377600" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[]

HTTP Request

GET calendar/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

Get by Client and Time Period.

Get all Calendar Appointments by Client id within the given Time Period. Maximum number of results returned 1000.


Requires authentication

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.penga.uk/calendar/client/C-00000002/starttime/1577836800/endtime/1588377600',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/calendar/client/C-00000002/starttime/1577836800/endtime/1588377600'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
const url = new URL(
    "https://api.penga.uk/calendar/client/C-00000002/starttime/1577836800/endtime/1588377600"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.penga.uk/calendar/client/C-00000002/starttime/1577836800/endtime/1588377600" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"

Example response (200):

[]

HTTP Request

GET calendar/client/{clientId}/starttime/{startTime}/endtime/{endTime}

URL Parameters

Parameter Status Description
clientId required The id of the Client. String, Length 10.
startTime required The start time of the period. Unix Timestamp.
endTime required The end time of the period. Unix Timestamp.

15. Auth

Endpoints for Authentication.

Authenticate.

Authenticate a user and return the token if the provided credentials are correct.

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.penga.uk/auth/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'email' => 'admin@eg-dentists.co.uk',
            'password' => 'password',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.penga.uk/auth/login'
payload = {
    "email": "admin@eg-dentists.co.uk",
    "password": "password"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
const url = new URL(
    "https://api.penga.uk/auth/login"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "email": "admin@eg-dentists.co.uk",
    "password": "password"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.penga.uk/auth/login" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}" \
    -d '{"email":"admin@eg-dentists.co.uk","password":"password"}'

Example response (200):

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwZW5nYS11ayIsInN1YiI6NywiaWF0IjoxNjc3MjUzNTM0LCJleHAiOjE2NzcyNTcxMzR9.AdSg6iOoHZmmvOW1-BV7ibzAUv6ec22DFES-cvUtJD4"
}

HTTP Request

POST auth/login

Body Parameters

Parameter Type Status Description
email required optional The email of the account to authenticate. String, Max length 255.
password required optional The password of the account to authenticate. String, Max length 20.