REST APIs with JSON

  • Introduction

  • Overview

  • Authentication

  • Status and Error Codes

  • Exploring the APIs

Introduction

Wired Client APIs (Application Programming Interfaces) can be used by third-party CRM systems to transfer and manage staff or client records in the Wired Client system.

Overview

REST stands for Representational State Transfer. It is an architectural style for developing web services. The term REST API is used here to refer to an API accessed via HTTP protocol at a predefined set of system URLs.

Wired Client provides two separate REST APIs for programmatically adding staff or clients into the system, or updating existing staff or clients in the system.

JSON stands for JavaScript Object Notation which is an open standard file format. As a language-independent data format, JSON is used to return any information or content here.

Authentication

Both an API key and corresponding API password are required when calling Wired Client APIs. Please contact Practice Perfect for getting your API key and API password.

Status and Error Codes

The HTTP status code 200 will be returned to confirm communication works normally. Any status or error codes will be pushed down into the HTTP response.

One of the following status codes will be returned in a JSON payload,

  • ‘0’ - Success

  • ‘1001’ - Invalid business account number

  • ‘1002’ - Invalid branch account number

  • ‘1003’ - Deleted staff ID

  • ‘1004’ - Deleted next appointment staff ID

  • ‘1005’ – Existing mobile number

  • ‘2000’ – Failed for any other reason

  • ‘2001’ - Invalid staff ID

  • ‘2002’ - Invalid next appointment staff ID

Exploring the APIs

  1. Add or Update Staff

    URI: https://app.thewiredclient.com/api/v1/staff

    Protocol: Post

    Header: Content-Type application/json

    Request body:

    {

    api_key: It is used to identify different third-party systems or different developers. It has UUID (Universally Unique Identifier) attribute and will be provided by Practice Perfect. (mandatory)

    api_password: It is used for authentication to gain access to API resource. It has UUID attribute and will be provided by Practice Perfect. (mandatory)

    account_number: It is used to identify different business accounts. It has UUID attribute and will be created and provided by Practice Perfect. (mandatory)

    id: It is used to identify and update an existing staff, or create a new staff when this is specified as 0 or null. (mandatory)

    staff_type: The default type is “User” when no value is specified. The value can be set to 2 for Power User, 3 for User, or 4 for Coordinator (optional)

    job_title: (optional)

    job_description: (optional)

    first_name: (mandatory)

    last_name: (mandatory)

    main_phone: (optional)

    mobile_phone1: SMS number (optional)

    email_address1: (mandatory)

    street: (optional)

    city: (optional)

    region: Region, State, or Province (optional)

    Page 3 of 5

    postal_code: (optional)

    country: (optional)

    }

    Response with status 200:

    {

    id: New or existing staff ID when success, or ‘0’ when failed,

    status: Refer to the section ‘Status and Error Codes’,

    message: Provide help information such as ‘Inserted one staff’ or so,

    }

  2. Add or Update Client

    URI: https://app.thewiredclient.com/api/v1/client

    Protocol: Post

    Header: Content-Type application/json

    Request body:

    {

    api_key: It is used to identify different third-party systems or different developers. It has UUID attribute and will be provided by Practice Perfect. (mandatory)

    api_password: It is used for authentication to gain access to API resource. It has UUID attribute and will be provided by Practice Perfect. (mandatory)

    account_number: It is used to identify different branches. It has UUID attribute and will be created and provided by Practice Perfect. (mandatory)

    id: It is used to identify and update an existing client, or create a new client when this is specified as 0 or null. (mandatory)

    first_name: (mandatory)

    last_name: (mandatory)

    preferred_language: The two-letter language codes are used as the value, and the default language is “English” when no value is specified. The code can be set to EN for English, FR for Français/French, or ES for Español/Spanish (optional)

    staff_id #: It is used to identify the associated staff. It is created and retrieved when adding new staff via API. (optional)

    staff_name: It is used to name the associated staff. (optional)

    client_type: The default type is “Active Client” when no value is specified. It can be set to 1 for Lead type, 2 for Active Client type, or 3 for Inactive Client type (mandatory)

    gender: The default type is “Rather not say” when no value is specified. It can be set to 1 as Female, 2 as Male, 3 as Other, or 4 as Rather not say (mandatory)

    birthday: Use the format "YYYY-MM-DD” (optional)

    guardian: The default type is False, and it can be set to True or False (optional)

    guardian_first_name: (optional)

    guardian_last_name: (optional)

    mobile_phone1: SMS number (mandatory)

    email_address1: (optional)

    street: (optional)

    city: (optional)

    region: Region, State, or Province (optional)

    postal_code: (optional)

    country: (optional)

    reason: (optional)

    start_date: Use the format "YYYY-MM-DD” (optional or mandatory for Active and Inactive Clients)

    end_date: Use the format "YYYY-MM-DD” (optional)

    last_visit_date: Use the format "YYYY-MM-DD” (optional)

    opted_in_date: Use the format "YYYY-MM-DD” (optional)

    contact_method: The default method is “No Contact” when no value is specified. It can be set to 1 as SMS, 3 as Phone Call, or 0 as No Contact (mandatory)

    next_appointment_staff_id #: It is used to identify the staff in charge for next appointment. It is created and retrieved when adding new staff via API. (optional)

    next_appointment_staff_name: It is used to name the staff in charge for next appointment. (optional)

    next_appointment_date: Use the format "YYYY-MM-DD” (optional)

    next_appointment_time: Use the format "YYYY-MM-DDTHH:mm:ss” (optional)

    pending_appointments: [

    {appointment_date: Use the format "YYYY-MM-DD” (optional)

    appointment_time: Use the format "YYYY-MM-DDTHH:mm:ss” (optional)

    appointment_account_number: It is used to identify the associated branch for the appointment. The account number is provided by Practice Perfect. (optional)

    appointment_staff_id: It is used to identify the associated staff in charge for the appointment. It is created and retrieved when adding new staff via API. (optional)

    appointment_staff_name: It is used to name the associated staff in charge for the appointment. (optional)

    appointment_virtual: It is used to identify that this is a virtual appointment. It can be set to 0 for No, or 1 for Yes. (optional)

    },

    {appointment_date: Use the format "YYYY-MM-DD” (optional)

    appointment_time: Use the format "YYYY-MM-DDTHH:mm:ss” (optional)

    appointment_account_number: It is used to identify the associated branch for the appointment. The account number is provided by Practice Perfect. (optional)

    appointment_staff_id: It is used to identify the associated staff in charge for the appointment. It is created and retrieved when adding new staff via API. (optional)

    appointment_staff_name: It is used to name the associated staff in charge for the appointment. (optional)

    appointment_virtual: It is used to identify that this is a virtual appointment. It can be set to 0 for No, or 1 for Yes. (optional)

    }

    ] (Note: the field next_appointment_date, next_appointment_time, next_appointment_staff_id and next_appointment_staff_name will be ignored when pending_appointments is recognized.

    last_cancelled_date: Use the format "YYYY-MM-DD” (optional)

    number_of_visits: (optional)

    }

    Response with status 200:

    {

    id: New or existing client ID when success, or ‘0’ when failed,

    status: Refer to the section ‘Status and Error Codes’,

    message: Provide help information such as ‘Inserted one client’ or so. Note: When the returned status code is “1003’, ‘1004’, ‘2001’, or ‘2002’, this field will be filled with the associated staff name.

    }

Wired Client APIs (Application Programming Interfaces) can be used by third-party CRM systems to transfer and manage staff or client records in the Wired Client system.

REST stands for Representational State Transfer. It is an architectural style for developing web services. The term REST API is used here to refer to an API accessed via HTTP protocol at a predefined set of system URLs.

Wired Client provides two separate REST APIs for programmatically adding staff or clients into the system, or updating existing staff or clients in the system.

JSON stands for JavaScript Object Notation which is an open standard file format. As a language-independent data format, JSON is used to return any information or content here.

Both an API key and corresponding API password are required when calling Wired Client APIs. Please contact Practice Perfect for getting your API key and API password.

The HTTP status code 200 will be returned to confirm communication works normally. Any status or error codes will be pushed down into the HTTP response.

One of the following status codes will be returned in a JSON payload,

  • ‘0’ - Success

  • ‘1001’ - Invalid business account number

  • ‘1002’ - Invalid branch account number

  • ‘1003’ - Deleted staff ID

  • ‘1004’ - Deleted next appointment staff ID

  • ‘1005’ – Existing mobile number

  • ‘2000’ – Failed for any other reason

  • ‘2001’ - Invalid staff ID

  • ‘2002’ - Invalid next appointment staff ID

  1. Add or Update Staff

    URI: https://app.thewiredclient.com/api/v1/staff

    Protocol: Post

    Header: Content-Type application/json

    Request body:

    {

    api_key: It is used to identify different third-party systems or different developers. It has UUID (Universally Unique Identifier) attribute and will be provided by Practice Perfect. (mandatory)

    api_password: It is used for authentication to gain access to API resource. It has UUID attribute and will be provided by Practice Perfect. (mandatory)

    account_number: It is used to identify different business accounts. It has UUID attribute and will be created and provided by Practice Perfect. (mandatory)

    id: It is used to identify and update an existing staff, or create a new staff when this is specified as 0 or null. (mandatory)

    staff_type: The default type is “User” when no value is specified. The value can be set to 2 for Power User, 3 for User, or 4 for Coordinator (optional)

    job_title: (optional)

    job_description: (optional)

    first_name: (mandatory)

    last_name: (mandatory)

    main_phone: (optional)

    mobile_phone1: SMS number (optional)

    email_address1: (mandatory)

    street: (optional)

    city: (optional)

    region: Region, State, or Province (optional)

    postal_code: (optional)

    country: (optional)

    }

    Response with status 200:

    {

    id: New or existing staff ID when success, or ‘0’ when failed,

    status: Refer to the section ‘Status and Error Codes’,

    message: Provide help information such as ‘Inserted one staff’ or so,

    }

  2. Add or Update Client

    URI: https://app.thewiredclient.com/api/v1/client

    Protocol:Post

    Header: Content-Type application/json

    Request body:

    {

    api_password: It is used for authentication to gain access to API resource. It has UUID attribute and will be provided by Practice Perfect. (mandatory)

    account_number: It is used to identify different branches. It has UUID attribute and will be created and provided by Practice Perfect. (mandatory)

    id: It is used to identify and update an existing client, or create a new client when this is specified as 0 or null. (mandatory)

    first_name: (mandatory)

    last_name: (mandatory)

    preferred_language: The two-letter language codes are used as the value, and the default language is “English” when no value is specified. The code can be set to EN for English, FR for Français/French, or ES for Español/Spanish (optional)

    staff_id #: It is used to identify the associated staff. It is created and retrieved when adding new staff via API. (optional)

    staff_name: It is used to name the associated staff. (optional)

    client_type: The default type is “Active Client” when no value is specified. It can be set to 1 for Lead type, 2 for Active Client type, or 3 for Inactive Client type (mandatory)

    gender: The default type is “Rather not say” when no value is specified. It can be set to 1 as Female, 2 as Male, 3 as Other, or 4 as Rather not say (mandatory)

    birthday: Use the format "YYYY-MM-DD” (optional)

    guardian: The default type is False, and it can be set to True or False (optional)

    guardian_first_name: (optional)

    guardian_last_name: (optional)

    mobile_phone1: SMS number (mandatory)

    email_address1: (optional)

    street: (optional)

    city: (optional)

    region: Region, State, or Province (optional)

    postal_code: (optional)

    country: (optional)

    reason: (optional)

    start_date: Use the format "YYYY-MM-DD” (optional or mandatory for Active and Inactive Clients)

    end_date: Use the format "YYYY-MM-DD” (optional)

    last_visit_date: Use the format "YYYY-MM-DD” (optional)

    opted_in_date: Use the format "YYYY-MM-DD” (optional)

    contact_method: The default method is “No Contact” when no value is specified. It can be set to 1 as SMS, 3 as Phone Call, or 0 as No Contact (mandatory)

    next_appointment_staff_id #: It is used to identify the staff in charge for next appointment. It is created and retrieved when adding new staff via API. (optional)

    next_appointment_staff_name: It is used to name the staff in charge for next appointment. (optional)

    next_appointment_date: Use the format "YYYY-MM-DD” (optional)

    next_appointment_time: Use the format "YYYY-MM-DDTHH:mm:ss” (optional)

    pending_appointments: [

    {appointment_date: Use the format "YYYY-MM-DD” (optional)

    appointment_time: Use the format "YYYY-MM-DDTHH:mm:ss” (optional)

    appointment_account_number: It is used to identify the associated branch for the appointment. The account number is provided by Practice Perfect. (optional)

    appointment_staff_id: It is used to identify the associated staff in charge for the appointment. It is created and retrieved when adding new staff via API. (optional)

    appointment_staff_name: It is used to name the associated staff in charge for the appointment. (optional)

    appointment_virtual: It is used to identify that this is a virtual appointment. It can be set to 0 for No, or 1 for Yes. (optional)

    },

    {appointment_date: Use the format "YYYY-MM-DD” (optional)

    appointment_time: Use the format "YYYY-MM-DDTHH:mm:ss” (optional)

    appointment_account_number: It is used to identify the associated branch for the appointment. The account number is provided by Practice Perfect. (optional)

    appointment_staff_id: It is used to identify the associated staff in charge for the appointment. It is created and retrieved when adding new staff via API. (optional)

    appointment_staff_name: It is used to name the associated staff in charge for the appointment. (optional)

    appointment_virtual: It is used to identify that this is a virtual appointment. It can be set to 0 for No, or 1 for Yes. (optional)

    }

    ] (Note: the field next_appointment_date, next_appointment_time, next_appointment_staff_id and next_appointment_staff_name will be ignored when pending_appointments is recognized.

    last_cancelled_date: Use the format "YYYY-MM-DD” (optional)

    number_of_visits: (optional)

    }

    Response with status 200:

    {

    id: New or existing client ID when success, or ‘0’ when failed,

    status: Refer to the section ‘Status and Error Codes’,

    message: Provide help information such as ‘Inserted one client’ or so. Note: When the returned status code is “1003’, ‘1004’, ‘2001’, or ‘2002’, this field will be filled with the associated staff name.

    }

Contact Us

Need a hand with Wired Client?

Please fill out the form to get in touch with our helpdesk.

Book a demo?

Would you like to see Wired Client in action? Please fill out the form to schedule a live one-on-one demo with a representative.

CA