REST APIs with JSON
Introduction
Wired Client APIs (Application Programming Interfaces) can be used by third-party CRM systems to transfer and manage staff or client records, or to send messages to staff or clients through 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 four separate REST APIs for programmatically adding staff or clients into the system, updating existing staff or clients, sending messages to staff or clients through 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 account or password
- ‘2002’ – Invalid next appointment staff ID
- ‘2003’ – Invalid client ID
- ‘5000’ – Internal server error
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)
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.
}
3. SMS to Staff
URI: https://app.thewiredclient.com/api/v1/staffsms
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 an existing staff. (mandatory)
message: It is a text field which contains the actual sms message content. The message should be limited to 320 characters and anything over this limit will be trimmed. (mandatory)
}
Response with status 200:
{
smsid: new sms message ID when success, or ‘0’ when failed,
status: Refer to the section ‘Status and Error Codes’,
message: Provide help information such as ‘Sent one message’ or various error messages such as ‘Message body is required’ and etc. for troubleshooting.
}
4. SMS to Client
URI: https://app.thewiredclient.com/api/v1/clientsms
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 an existing client. (mandatory)
message: It is a text field which contains the actual sms message content. The message should be limited to 320 characters and anything over this limit will be trimmed. (mandatory)
}
Response with status 200:
{
smsid: new sms message ID when success, or ‘0’ when failed,
status: Refer to the section ‘Status and Error Codes’,
message: Provide help information such as ‘Sent one message’ or various error messages such as ‘No matched client’ and etc. for troubleshooting.
}
5. Single Sign-On to Contact List
URI: https://app.thewiredclient.com/api/v1/clientsms
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)
business_account_number: It is used to identify different business accounts. It has UUID attribute and will be created and provided by Practice Perfect (mandatory)
account_name: It is used to identify the target contact in the Wired Client system to log in as. It corresponds to the contact’s login Account Name. (mandatory)
account_password: It is used to authenticate the account. (mandatory)
staff_id: It is used as a validation field to verify the login account. If specified, it must match the Staff ID corresponding to the account_name. If it does not match, the system will return an error message. (optional)
contact_id: It is used to identify a specific contact in the Wired Client system. The system will automatically detect whether the provided ID belongs to a staff
member or a client. When specified, the generated login session will navigate to
the Contact List and filter to show only this specific staff or client. When omitted or null, it will navigate to the Contact List and default to displaying all clients. (optional)
}
Response with status 200:
{
token: short-lived JWT token (expires in 3 minutes) generated for the specific account when success, or null when failed,
login_url: The magic link URL constructed with the token for the third-party system to launch in a web browser directly (e.g., https://app.thewiredclient.com/#/user/auto-login?token=xxx&redirect=/messages/list or appended with ?contactId={contact_id}&contactType={contact_type} when the contact_id is provided. Note: The actual value of the redirect parameter in the returned URL is URL-encoded.), status: Refer to the section ‘Status and Error Codes’. ‘0’ for success, ‘2000’ for invalid API credentials, ‘2001’ for invalid account or password, or ‘2003’ for invalid contact ID,
message: Provide help information such as ‘Success’ or various error messages such as ‘Target contact account not found or invalid password’, ‘Target contact not found’ and etc. for troubleshooting.
}
6. Single Sign-On to Unread Contact List
URI: https://app.thewiredclient.com/api/v1/clientsms
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)
business_account_number: It is used to identify different business accounts. It has UUID attribute and will be created and provided by Practice Perfect. (mandatory)
account_name: It is used to identify the target contact in the Wired Client system to log in as. It corresponds to the contact’s login Account Name. (mandatory)
account_password: It is used to authenticate the account. (mandatory)
staff_id: It is used as a validation field to verify the login account. If specified, it must match the Staff ID corresponding to the account_name. If it does not match, the system will return an error message. (optional)
}
Response with status 200:
{
token: short-lived JWT token (expires in 3 minutes) generated for the specific contact when success, or null when failed,
login_url: The magic link URL constructed with the token for the third-party system to launch in a web browser directly (e.g., https://app.thewiredclient.com/#/user/auto-login?token=xxx&redirect=/messages/list?filter=unread. Note: The actual value of the redirect parameter in the returned URL is URL-encoded.),
status: Refer to the section ‘Status and Error Codes’. ‘0’ for success, ‘2000’ for invalid API credentials, or ‘2001’ for invalid account or password,
message: Provide help information such as ‘Success’ or various error messages such as ‘Target contact account not found or invalid password’ and etc. for troubleshooting.
}
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.
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
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,
}
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.
}