Customer Emergency Contacts API Documentation

Overview

This sub-collection contains a customer account's emergency contacts.

Fields

Name Type Restrictions Required? Description
id integer Automatic Automatic The unique identifier of the emergency contact. This is placed in the URL when making API calls for the emergency contact.
url string Automatic Automatic The unique API URL of the emergency contact.
first_name string Must not be blank. Yes The emergency contact's first name.
last_name string Must not be blank. Yes The emergency contact's last name.
telephone string Must not be blank. Yes The emergency contact's telephone number.
email string None No The emergency contact's email address.
relation string None No The emergency contact's relation to the customer.
created_at string (ISO-8601 datetime) Automatic Automatic When the emergency contact was added to the Capitan database.
updated_at string (ISO-8601 datetime) Automatic Automatic When the emergency contact's record in the Capitan database was last updated.

Operations

List

Request
GET /api/customers/35/emergency-contacts/

Response
200 OK
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 421,
            "url": "https://api.hellocapitan.com/api/customers/35/emergency-contacts/421/",
            "first_name": "Dave",
            "last_name": "Johnson",
            "telephone": "+1 (555) 555-5555",
            ...
        },
        ...
    ]
}

Read

Request
GET /api/customers/35/emergency-contacts/421/

Response
200 OK
{
    "id": 35,
    "url": "https://api.hellocapitan.com/api/customers/35/emergency-contacts/421/",
    "first_name": "Dave",
    "last_name": "Johnson",
    "telephone": "+1 (555) 555-5555",
    ...
}

Create

Request
POST /api/customers/35/emergency-contacts/
{
    "first_name": "Sam",
    "last_name": "Johnson",
    "telephone": "+1 (555) 555-5555"
}

Response
201 Created
{
    "id": 713,
    "url": "https://api.hellocapitan.com/api/customers/35/emergency-contacts/713/",
    "first_name": "Sam",
    "last_name": "Johnson",
    "telephone": "+1 (555) 555-5555",
    ...
}

Replace

Request
PUT /api/customers/35/emergency-contacts/713/
{
    "first_name": "Samuel",
    "last_name": "Johnson",
    "telephone": "+1 (555) 555-5555"
}

Response
200 OK
{
    "id": 713,
    "url": "https://api.hellocapitan.com/api/customers/35/emergency-contacts/713/",
    "first_name": "Samuel",
    "last_name": "Johnson",
    "telephone": "+1 (555) 555-5555",
    ...
}

Update

Request
PATCH /api/customers/35/emergency-contacts/713/
{
    "first_name": "Samantha"
}

Response
200 OK
{
    "id": 713,
    "url": "https://api.hellocapitan.com/api/customers/35/emergency-contacts/713/",
    "first_name": "Samantha",
    "last_name": "Johnson",
    "telephone": "+1 (555) 555-5555",
    ...
}