Info
Welcome to the generated API reference. Get Postman Collection
This API is being developed constantly with more endpoints being added regularly.
Authentication
All endpoints require authentication via the Authorization: Bearer {token}
header. There are 2 ways to get the token:
Personal Access Tokens
- Log in to your EasyPractice account (or create a new account)
- Go to the Apps page and activate the API app.
- Go to the API Settings page
- In the Personal Access Tokens section click on the Create New Token button to generate a new token.
- Copy the new generated token. You will NOT be able to view it again, so keep it safe. In case you lose it, you can generate as many new tokens as you'd like.
- Add an
Authorization
header to your requests with the value ofBearer {token}
where {token} is your token you copied earlier.
OAuth2 flow
We also support the standard OAuth2 flow for authenticating requests. Your app will be able to "Request access to EasyPractice", where the user will be able to either Authorize or Deny the request. This is a much more user-friendly approach, but requires more set up in advance.
If you would like to set up OAuth2 flow with our API, please get in touch with us at support@easypractice.net.
Bookings
List bookings
Requires authentication
Returns all of user's bookings. Use the filter options provided to narrow down the results. For example: GET api/v1/bookings?start=2019-06-15&order_by_date=asc
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/bookings", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"start" => "2019-03-25",
"end" => "2019-03-25",
"client_id" => "54347",
"calendar_id" => "54347",
"product_id" => "54347",
"employee_id" => "23",
"status" => "absent",
"order_by_date" => "asc",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/bookings" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/bookings");
let params = {
"start": "2019-03-25",
"end": "2019-03-25",
"client_id": "54347",
"calendar_id": "54347",
"product_id": "54347",
"employee_id": "23",
"status": "absent",
"order_by_date": "asc",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"start": "2019-06-15T16:25:00+02:00",
"start_formatted": "Saturday 15 June 2019, 16:25",
"end": "2019-06-15T17:15:00+02:00",
"end_formatted": "Saturday 15 June 2019, 17:15",
"calendar_id": 167,
"calendar_name": "Main calendar",
"employee_id": 23,
"employee_name": "John Doe",
"type": "client_booking",
"status": "finished",
"heading": "",
"recurring": null,
"until": null,
"client_id": 1348,
"client_name": "John Smith",
"notify_email": 0,
"notify_phone": 0,
"products": [
{
"id": 125,
"name": "Main service"
}
]
},
{
"id": 2,
"start": "2019-09-30T17:55:00+02:00",
"start_formatted": "Monday 30 September 2019, 17:55",
"end": "2019-09-30T21:30:00+02:00",
"end_formatted": "Monday 30 September 2019, 21:30",
"calendar_id": 173,
"calendar_name": "201",
"employee_id": 23,
"employee_name": "John Doe",
"type": "Client appointment",
"status": "finished",
"heading": "",
"recurring": null,
"until": null,
"client_id": 648,
"client_name": "Mary Williams",
"notify_email": 1,
"notify_phone": 0,
"products": [
{
"id": 125,
"name": "Main service",
"addons": [
{
"id": 434,
"name": "Extra time"
}
]
},
{
"id": 264,
"name": "Other service"
}
]
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/bookings
Query Parameters
Parameter | Status | Description |
---|---|---|
start | optional | Return only the bookings scheduled on or after the given date. |
end | optional | Return only the bookings scheduled on or before the given date. |
client_id | optional | Return only bookings belonging to this client ID. |
calendar_id | optional | Return only bookings belonging to this calendar ID. |
product_id | optional | Return only bookings belonging to this product ID. |
employee_id | optional | Return only bookings belonging to this employee ID. |
status | optional | Return only booking with the given status (must have "Appointment Status" app active). |
order_by_date | optional | =[asc|desc] Order results by date. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Create booking
Requires authentication
Creates a new booking with the given data.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post("api/v1/bookings", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"start" => "2019-03-25T10:00:00+02:00",
"end" => "2019-03-25T10:00:00+02:00",
"calendar_id" => 54347,
"employee_id" => 23,
"type" => "client_booking",
"status" => "not_started",
"heading" => "New skill course",
"notes" => "First time for this client",
"recurring" => "daily",
"until" => "2019-03-28",
"client_id" => 1594,
"send_receipt" => true,
"send_phone_receipt" => false,
"notify_email" => true,
"notify_phone" => false,
"products" => [
[
"id" => 1574,
],
[
"id" => 2164,
"addons" => [
[
"id" => 434,
],
],
],
],
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X POST "https://system.easypractice.net/api/v1/bookings" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"start":"2019-03-25T10:00:00+02:00","end":"2019-03-25T10:00:00+02:00","calendar_id":54347,"employee_id":23,"type":"client_booking","status":"not_started","heading":"New skill course","notes":"First time for this client","recurring":"daily","until":"2019-03-28","client_id":1594,"send_receipt":1,"send_phone_receipt":false,"notify_email":1,"notify_phone":false,"products":[{"id":1574},{"id":2164,"addons":[{"id":434}]}]}'
const url = new URL("https://system.easypractice.net/api/v1/bookings");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"start": "2019-03-25T10:00:00+02:00",
"end": "2019-03-25T10:00:00+02:00",
"calendar_id": 54347,
"employee_id": 23,
"type": "client_booking",
"status": "not_started",
"heading": "New skill course",
"notes": "First time for this client",
"recurring": "daily",
"until": "2019-03-28",
"client_id": 1594,
"send_receipt": 1,
"send_phone_receipt": false,
"notify_email": 1,
"notify_phone": false,
"products": [
{
"id": 1574
},
{
"id": 2164,
"addons": [
{
"id": 434
}
]
}
]
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (201):
{
"message": "Created",
"data": {
"id": 1,
"start": "2019-06-15T16:25:00+02:00",
"start_formatted": "Saturday 15 June 2019, 16:25",
"end": "2019-06-15T17:15:00+02:00",
"end_formatted": "Saturday 15 June 2019, 17:15",
"calendar_id": 167,
"calendar_name": "Main calendar",
"employee_id": 23,
"employee_name": "John Doe",
"type": "client_booking",
"status": "finished",
"heading": "",
"recurring": null,
"until": null,
"client_id": 1348,
"client_name": "John Smith",
"notify_email": 0,
"notify_phone": 0,
"products": [
{
"id": 125,
"name": "Main service",
"addons": [
{
"id": 434,
"name": "Extra time"
}
]
}
]
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"name": [
"The Name field is required."
]
}
}
HTTP Request
POST api/v1/bookings
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
start | date_format:Y-m-d\TH:i:sP | required | The start date for the appointment in the full ISO 8601 format (e.g. 2019-10-30T08:50:31+00:00). |
end | date_format:Y-m-d\TH:i:sP | required | The end date for the appointment in the full ISO 8601 format (e.g. 2019-10-30T08:50:31+00:00). |
calendar_id | integer | required | The calendar ID associated to the appointment. |
employee_id | integer | optional | The user employee ID associated to the appointment. |
type | string | required | The appointment type =['other_booking', 'close_online_booking', 'client_booking']. |
status | string | optional | The status of the appointment. Must have the "Appointment Status" app enabled. |
heading | string | optional | The appointment title (It's required only for 'other_booking' type). |
notes | string | optional | The appointment additional notes. |
recurring | string | optional | How often this appointment is repeated =[false, 'daily', 'weekly', 'every_other_week'] (It's required for 'other_booking' and 'close_online_booking' types). |
until | date_format:Y-m-d | optional | Until what date this appointment is repeated (It's required if recurring field is different than false). |
client_id | integer | optional | The client ID associated to the appointment (It's required for 'client_booking' type). |
send_receipt | boolean | optional | Should we send the confirmation email straight away? Client must have a valid email address. |
send_phone_receipt | boolean | optional | Should we send the confirmation SMS straight away? Client must have a valid phone number. |
notify_email | boolean | optional | Should we notify the client by email. |
notify_phone | boolean | optional | Should we notify the client by SMS. |
products | array | optional | The products associated to the appointment (It's required for 'client_booking' type). |
Show booking
Requires authentication
Returns the booking data for a given ID.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/bookings/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/bookings/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/bookings/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"start": "2019-06-15T16:25:00+02:00",
"start_formatted": "Saturday 15 June 2019, 16:25",
"end": "2019-06-15T17:15:00+02:00",
"end_formatted": "Saturday 15 June 2019, 17:15",
"calendar_id": 167,
"calendar_name": "Main calendar",
"employee_id": 23,
"employee_name": "John Doe",
"type": "client_booking",
"status": "finished",
"heading": "",
"recurring": null,
"until": null,
"client_id": 1348,
"client_name": "John Smith",
"notify_email": 0,
"notify_phone": 0,
"products": [
{
"id": 125,
"name": "Main service",
"addons": [
{
"id": 434,
"name": "Extra time"
}
]
}
]
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/bookings/{booking}
Update booking
Requires authentication
Updates the booking.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put("api/v1/bookings/1", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"start" => "2019-03-25T10:00:00+02:00",
"end" => "2019-03-25T10:00:00+02:00",
"calendar_id" => 54347,
"employee_id" => 23,
"status" => "finished",
"heading" => "New skill course",
"notes" => "First time for this client",
"recurring" => "daily",
"until" => "2019-03-28",
"client_id" => 1594,
"notify_email" => true,
"notify_phone" => false,
"products" => [
[
"id" => 1574,
],
[
"id" => 2164,
"addons" => [
[
"id" => 434,
],
],
],
],
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X PUT "https://system.easypractice.net/api/v1/bookings/1" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"start":"2019-03-25T10:00:00+02:00","end":"2019-03-25T10:00:00+02:00","calendar_id":54347,"employee_id":23,"status":"finished","heading":"New skill course","notes":"First time for this client","recurring":"daily","until":"2019-03-28","client_id":1594,"notify_email":1,"notify_phone":false,"products":[{"id":1574},{"id":2164,"addons":[{"id":434}]}]}'
const url = new URL("https://system.easypractice.net/api/v1/bookings/1");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"start": "2019-03-25T10:00:00+02:00",
"end": "2019-03-25T10:00:00+02:00",
"calendar_id": 54347,
"employee_id": 23,
"status": "finished",
"heading": "New skill course",
"notes": "First time for this client",
"recurring": "daily",
"until": "2019-03-28",
"client_id": 1594,
"notify_email": 1,
"notify_phone": false,
"products": [
{
"id": 1574
},
{
"id": 2164,
"addons": [
{
"id": 434
}
]
}
]
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Updated",
"data": {
"id": 1,
"start": "2019-06-15T16:25:00+02:00",
"start_formatted": "Saturday 15 June 2019, 16:25",
"end": "2019-06-15T17:15:00+02:00",
"end_formatted": "Saturday 15 June 2019, 17:15",
"calendar_id": 167,
"calendar_name": "Main calendar",
"employee_id": 23,
"employee_name": "John Doe",
"type": "client_booking",
"status": "finished",
"heading": "",
"recurring": null,
"until": null,
"client_id": 1348,
"client_name": "John Smith",
"notify_email": 0,
"notify_phone": 0,
"products": [
{
"id": 125,
"name": "Main service",
"addons": [
{
"id": 434,
"name": "Extra time"
}
]
}
]
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"name": [
"The Name field is required."
]
}
}
HTTP Request
PUT api/v1/bookings/{booking}
PATCH api/v1/bookings/{booking}
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
start | date_format:Y-m-d\TH:i:sP | optional | The start date for the appointment in the full ISO 8601 format (e.g. 2019-10-30T08:50:31+00:00). |
end | date_format:Y-m-d\TH:i:sP | optional | The end date for the appointment in the full ISO 8601 format (e.g. 2019-10-30T08:50:31+00:00). |
calendar_id | integer | optional | The calendar ID associated to the appointment. |
employee_id | integer | optional | The user employee ID associated to the appointment. |
status | string | optional | The status of the appointment. Must have the "Appointment Status" app enabled. |
heading | string | optional | The appointment heading for 'other_booking' type. |
notes | string | optional | The appointment additional notes. |
recurring | string | optional | How often this appointment is repeated =[false, 'daily', 'weekly', 'every_other_week'] (It's required for 'other_booking' and 'close_online_booking' types). |
until | date_format:Y-m-d | optional | Until what date this appointment is repeated (It's required if recurring field is different than false). |
client_id | integer | optional | The client ID associated to the appointment. |
notify_email | boolean | optional | Should we notify the client by email. |
notify_phone | boolean | optional | Should we notify the client by SMS. |
products | array | optional | The products associated to the appointment. |
Delete booking
Requires authentication
Deletes the booking.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete("api/v1/bookings/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X DELETE "https://system.easypractice.net/api/v1/bookings/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/bookings/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Deleted"
}
HTTP Request
DELETE api/v1/bookings/{booking}
Calendar Opening Times
Show Opening Times
Requires authentication
Returns opening times for a Calendar. For example: GET api/v1/calendars/1/opening-times
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/calendars/1/opening-times", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/calendars/1/opening-times" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/calendars/1/opening-times");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": {
"id": 1,
"user_id": 1,
"calendar_id": 1,
"show_in_calendar": true,
"times": {
"monday_start": "09:00",
"monday_end": "17:00",
"monday_closed": false,
"tuesday_start": "09:00",
"tuesday_end": "17:00",
"tuesday_closed": false,
"wednesday_start": "09:00",
"wednesday_end": "17:00",
"wednesday_closed": false,
"thursday_start": "09:00",
"thursday_end": "17:00",
"thursday_closed": false,
"friday_start": "09:00",
"friday_end": "17:00",
"friday_closed": false,
"saturday_start": "09:00",
"saturday_end": "17:00",
"saturday_closed": true,
"sunday_start": "09:00",
"sunday_end": "17:00",
"sunday_closed": true
}
}
}
HTTP Request
GET api/v1/calendars/{calendar}/opening-times
Update Opening Times
Requires authentication
Updates an Opening Times entry for a given calendar. For example: PUT api/v1/calendars/1/opening-times
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put("api/v1/calendars/1/opening-times", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"show_in_calendar" => true,
"times" => [
"monday_start" => "09:00",
"monday_end" => "17:00",
"monday_closed" => false,
"tuesday_start" => "09:00",
"tuesday_end" => "17:00",
"tuesday_closed" => false,
"wednesday_start" => "09:00",
"wednesday_end" => "17:00",
"wednesday_closed" => false,
"thursday_start" => "09:00",
"thursday_end" => "17:00",
"thursday_closed" => false,
"friday_start" => "09:00",
"friday_end" => "17:00",
"friday_closed" => false,
"saturday_start" => "09:00",
"saturday_end" => "17:00",
"saturday_closed" => false,
"sunday_start" => "09:00",
"sunday_end" => "17:00",
"sunday_closed" => false,
],
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X PUT "https://system.easypractice.net/api/v1/calendars/1/opening-times" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"show_in_calendar":1,"times":{"monday_start":"09:00","monday_end":"17:00","monday_closed":false,"tuesday_start":"09:00","tuesday_end":"17:00","tuesday_closed":false,"wednesday_start":"09:00","wednesday_end":"17:00","wednesday_closed":false,"thursday_start":"09:00","thursday_end":"17:00","thursday_closed":false,"friday_start":"09:00","friday_end":"17:00","friday_closed":false,"saturday_start":"09:00","saturday_end":"17:00","saturday_closed":false,"sunday_start":"09:00","sunday_end":"17:00","sunday_closed":false}}'
const url = new URL("https://system.easypractice.net/api/v1/calendars/1/opening-times");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"show_in_calendar": 1,
"times": {
"monday_start": "09:00",
"monday_end": "17:00",
"monday_closed": false,
"tuesday_start": "09:00",
"tuesday_end": "17:00",
"tuesday_closed": false,
"wednesday_start": "09:00",
"wednesday_end": "17:00",
"wednesday_closed": false,
"thursday_start": "09:00",
"thursday_end": "17:00",
"thursday_closed": false,
"friday_start": "09:00",
"friday_end": "17:00",
"friday_closed": false,
"saturday_start": "09:00",
"saturday_end": "17:00",
"saturday_closed": false,
"sunday_start": "09:00",
"sunday_end": "17:00",
"sunday_closed": false
}
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Your opening hours were updated",
"data": {
"id": 1,
"user_id": 1,
"calendar_id": 1,
"show_in_calendar": true,
"times": {
"monday_start": "09:00",
"monday_end": "17:00",
"monday_closed": false,
"tuesday_start": "09:00",
"tuesday_end": "17:00",
"tuesday_closed": false,
"wednesday_start": "09:00",
"wednesday_end": "17:00",
"wednesday_closed": false,
"thursday_start": "09:00",
"thursday_end": "17:00",
"thursday_closed": false,
"friday_start": "09:00",
"friday_end": "17:00",
"friday_closed": false,
"saturday_start": "09:00",
"saturday_end": "17:00",
"saturday_closed": true,
"sunday_start": "09:00",
"sunday_end": "17:00",
"sunday_closed": true
}
}
}
HTTP Request
PUT api/v1/calendars/{calendar}/opening-times
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
show_in_calendar | boolean | required | The flag for whether this opening time is displayed on its calendar. |
times.monday_start | date_format:H:i | required | Monday Start time. |
times.monday_end | date_format:H:i | required | Monday End time. |
times.monday_closed | boolean | required | Monday Closed. |
times.tuesday_start | date_format:H:i | required | Tuesday Start time. |
times.tuesday_end | date_format:H:i | required | Tuesday End time. |
times.tuesday_closed | boolean | required | Tuesday Closed. |
times.wednesday_start | date_format:H:i | required | Wednesday Start time. |
times.wednesday_end | date_format:H:i | required | Wednesday End time. |
times.wednesday_closed | boolean | required | Wednesday Closed. |
times.thursday_start | date_format:H:i | required | Thursday Start time. |
times.thursday_end | date_format:H:i | required | Thursday End time. |
times.thursday_closed | boolean | required | Thursday Closed. |
times.friday_start | date_format:H:i | required | Friday Start time. |
times.friday_end | date_format:H:i | required | Friday End time. |
times.friday_closed | boolean | required | Friday Closed. |
times.saturday_start | date_format:H:i | required | Saturday Start time. |
times.saturday_end | date_format:H:i | required | Saturday End time. |
times.saturday_closed | boolean | required | Saturday Closed. |
times.sunday_start | date_format:H:i | required | Sunday Start time. |
times.sunday_end | date_format:H:i | required | Sunday End time. |
times.sunday_closed | boolean | required | Sunday Closed. |
Calendar Pauses
List Pauses
Requires authentication
Returns all of user's Pauses per each Calendar. For example: GET api/v1/calendars/1/pauses
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/calendars/1/pauses", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/calendars/1/pauses" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/calendars/1/pauses");
let params = {
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"calendar_id": 1,
"weekday": null,
"date": "2020-07-03",
"start_time": "08:00",
"end_time": "20:00"
},
{
"id": 2,
"calendar_id": 1,
"weekday": 3,
"date": null,
"start_time": "12:00",
"end_time": "12:30"
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/calendars/{calendar}/pauses
Query Parameters
Parameter | Status | Description |
---|---|---|
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Create a Pause
Requires authentication
Create a new Pause entry. For example: POST api/v1/calendars/1/pauses
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post("api/v1/calendars/1/pauses", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"weekday" => 1,
"date" => "2020-07-03",
"start_time" => "08:00",
"end_time" => "22:00",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X POST "https://system.easypractice.net/api/v1/calendars/1/pauses" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"weekday":1,"date":"2020-07-03","start_time":"08:00","end_time":"22:00"}'
const url = new URL("https://system.easypractice.net/api/v1/calendars/1/pauses");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"weekday": 1,
"date": "2020-07-03",
"start_time": "08:00",
"end_time": "22:00"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Pause Saved",
"data": {
"id": 1,
"calendar_id": 1,
"weekday": null,
"date": "2020-07-03",
"starttime": "08:00",
"endtime": "22:00"
}
}
HTTP Request
POST api/v1/calendars/{calendar}/pauses
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
weekday | integer | optional | The number of the day of the week (eg: 1 - Monday, 7 - Sunday) |
date | date_format:Y-m-d | optional | The start date of a week long Pause. |
start_time | date_format:H:i | required | The start time of the Pause |
end_time | date_format:H:i | required | Th end time of the Pause |
Show Pause
Requires authentication
Returns a Pause. For example: GET api/v1/calendars/1/pauses/1
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/calendars/1/pauses/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/calendars/1/pauses/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/calendars/1/pauses/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"calendar_id": 1,
"weekday": null,
"date": "2020-07-03",
"start_time": "08:00",
"end_time": "20:00"
}
HTTP Request
GET api/v1/calendars/{calendar}/pauses/{pause}
Update Pause
Requires authentication
Updates a Pause entry for a given calendar. For example: PUT api/v1/calendars/1/pauses/1
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put("api/v1/calendars/1/pauses/1", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"weekday" => 1,
"date" => "2020-07-03",
"start_time" => "08:00",
"end_time" => "22:00",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X PUT "https://system.easypractice.net/api/v1/calendars/1/pauses/1" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"weekday":1,"date":"2020-07-03","start_time":"08:00","end_time":"22:00"}'
const url = new URL("https://system.easypractice.net/api/v1/calendars/1/pauses/1");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"weekday": 1,
"date": "2020-07-03",
"start_time": "08:00",
"end_time": "22:00"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Pause Saved",
"data": {
"id": 1,
"calendar_id": 1,
"weekday": null,
"date": "2020-07-03",
"starttime": "08:00",
"endtime": "22:00"
}
}
HTTP Request
PUT api/v1/calendars/{calendar}/pauses/{pause}
PATCH api/v1/calendars/{calendar}/pauses/{pause}
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
weekday | integer | optional | The number of the day of the week (eg: 1 - Monday, 7 - Sunday) |
date | date_format:Y-m-d | optional | The start date of a week long Pause. |
start_time | date_format:H:i | required | The start time of the Pause |
end_time | date_format:H:i | required | Th end time of the Pause |
Delete Pause
Requires authentication
Deletes the Pause. For example: DELETE api/v1/calendars/1/pauses/1
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete("api/v1/calendars/1/pauses/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X DELETE "https://system.easypractice.net/api/v1/calendars/1/pauses/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/calendars/1/pauses/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Deleted"
}
HTTP Request
DELETE api/v1/calendars/{calendar}/pauses/{pause}
Calendars
List calendars
Requires authentication
Returns all of user's calendars. Use the filter options provided to narrow down the results. For example: GET api/v1/calendars?order_by_name=asc
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/calendars", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"order_by_name" => "asc",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/calendars" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/calendars");
let params = {
"order_by_name": "asc",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"name": "Calendar",
"description": "This is the description of a calendar",
"color": "#C3E1FF",
"type": "standard"
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/calendars
Query Parameters
Parameter | Status | Description |
---|---|---|
order_by_name | optional | =[asc|desc] Order results by name. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Show a calendar
Requires authentication
Returns the calendar data for a given ID.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/calendars/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/calendars/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/calendars/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"name": "Calendar",
"description": "This is the description of a calendar",
"color": "#C3E1FF",
"type": "standard"
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/calendars/{calendar}
Client Custom Attributes
List attributes
Requires authentication
Returns all of the possible custom client attributes which can be used when creating/updating cliengs. These custom attributes are created using the "Custom Fields" app in the system.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/client-custom-attributes", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/client-custom-attributes" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/client-custom-attributes");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
[
{
"identifier": "birthday",
"name": "Birthday",
"type": "date",
"required": false
},
{
"identifier": "age",
"name": "Age",
"type": "number",
"required": false
}
]
HTTP Request
GET api/v1/client-custom-attributes
Show attribute
Requires authentication
Returns the information about a custom attribute given its identifier.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/client-custom-attributes/birthday", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/client-custom-attributes/birthday" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/client-custom-attributes/birthday");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"identifier": "birthday",
"name": "Birthday",
"type": "date",
"required": false
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/client-custom-attributes/{identifier}
Client Journals
List client journals
Requires authentication
Returns all of specified clients journal entries. Use the filter options provided to narrow down the results. For example: GET api/v1/clients/{client_id}/journals?draft=1&order_by_date=desc
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/clients/1/journals", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"locked" => "1",
"favorite" => "1",
"draft" => "1",
"order_by_date" => "desc",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/clients/1/journals" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/clients/1/journals");
let params = {
"locked": "1",
"favorite": "1",
"draft": "1",
"order_by_date": "desc",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"date": "2020-01-23",
"content": "Client Journal Content",
"favorite": true,
"draft": false,
"locked": false,
"locked_at": null
},
{
"id": 3,
"date": "2020-01-22",
"content": "Client Journal Content example2",
"favorite": false,
"draft": true,
"locked": true,
"locked_at": "2020-01-26T18:10:47+00:00"
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/clients/{client}/journals
Query Parameters
Parameter | Status | Description |
---|---|---|
locked | optional | Return only locked journals. |
favorite | optional | Return only favorited journals. |
draft | optional | Return only draft journals. Drafts are entries auto-saved whilst typing. |
order_by_date | optional | =[asc|desc] Order results by journal date. |
Create client journal
Requires authentication
Creates a new client journal with the given data.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post("api/v1/clients/1/journals", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"date" => "2019-03-25",
"content" => "The journal content",
"favorite" => true,
"draft" => false,
"locked" => false,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X POST "https://system.easypractice.net/api/v1/clients/1/journals" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"date":"2019-03-25","content":"The journal content","favorite":1,"draft":false,"locked":false}'
const url = new URL("https://system.easypractice.net/api/v1/clients/1/journals");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"date": "2019-03-25",
"content": "The journal content",
"favorite": 1,
"draft": false,
"locked": false
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (201):
{
"message": "The journal entry was saved",
"data": {
"id": 1,
"date": "2019-03-25",
"content": "The journal content",
"favorite": true,
"draft": false,
"locked": false,
"locked_at": null
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"content": [
"The Content field is required."
]
}
}
HTTP Request
POST api/v1/clients/{client}/journals
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
date | date_format:Y-m-d | required | The date for the journal in the YYYY-MM-DD format. |
content | string | required | The content for the journal. |
favorite | boolean | optional | Mark journal as favorite. Only one favorite per client is allowed. Marking this as a favorite will unmark other favorites from the same client. |
draft | boolean | optional | Mark journal as draft. |
locked | boolean | optional | Mark journal as locked. Locked journals can no longer be updated or deleted. |
Show client journal
Requires authentication
Returns the client journal data for a given ID.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/clients/1/journals/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/clients/1/journals/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/clients/1/journals/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"date": "2020-01-23",
"content": "Client Journal Content",
"favorite": true,
"draft": false,
"locked": false,
"locked_at": null
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/clients/{client}/journals/{journal}
Update client journal
Requires authentication
Updates the client journal. Provide all properties. Any missing properties will be updated to null
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put("api/v1/clients/1/journals/1", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"date" => "2019-03-25",
"content" => "The journal content",
"favorite" => true,
"draft" => false,
"locked" => false,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X PUT "https://system.easypractice.net/api/v1/clients/1/journals/1" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"date":"2019-03-25","content":"The journal content","favorite":1,"draft":false,"locked":false}'
const url = new URL("https://system.easypractice.net/api/v1/clients/1/journals/1");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"date": "2019-03-25",
"content": "The journal content",
"favorite": 1,
"draft": false,
"locked": false
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "The journal entry was saved",
"data": {
"id": 1,
"date": "2019-03-25",
"content": "The journal content",
"favorite": true,
"draft": false,
"locked": false,
"locked_at": null
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"content": [
"The Content field is required."
]
}
}
HTTP Request
PUT api/v1/clients/{client}/journals/{journal}
PATCH api/v1/clients/{client}/journals/{journal}
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
date | date_format:Y-m-d | required | The date for the journal in the YYYY-MM-DD format. |
content | string | required | The content for the journal. |
favorite | boolean | optional | Mark journal as favorite. Only one favorite per client is allowed. Marking this as a favorite will unmark other favorites from the same client. |
draft | boolean | optional | Mark journal as draft. |
locked | boolean | optional | Mark journal as locked. Locked journals can no longer be updated or deleted. |
Delete client journal
Requires authentication
Deletes the client journal.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete("api/v1/clients/1/journals/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X DELETE "https://system.easypractice.net/api/v1/clients/1/journals/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/clients/1/journals/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Deleted"
}
HTTP Request
DELETE api/v1/clients/{client}/journals/{journal}
Clients
List clients
Requires authentication
Returns all of user's clients. Use the filter options provided to narrow down the results. For example: GET api/v1/clients?hasEmail&email=asc
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/clients", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"active" => "1",
"inactive" => "1",
"has_email" => "1",
"has_phone" => "1",
"cpr" => "1205001234",
"tag_id" => "54347",
"order_by_name" => "asc",
"order_by_created" => "desc",
"order_by_email" => "asc",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/clients" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/clients");
let params = {
"active": "1",
"inactive": "1",
"has_email": "1",
"has_phone": "1",
"cpr": "1205001234",
"tag_id": "54347",
"order_by_name": "asc",
"order_by_created": "desc",
"order_by_email": "asc",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"name": "John Smith",
"email": "john@mydomain.dk",
"phone": "61175736",
"address": "159 Bailey Brooks",
"zip": "W10 6DY",
"city": "Copenhagen",
"cpr": "1598431234",
"notes": "Notes about John",
"profile_image_url": "https:\/\/www.gravatar.com\/avatar\/5ea799d8476cbe0b1965c39e7c7dbd99?d=mm&s=200",
"status": "active",
"created_at": "2019-04-16 11:54:42",
"tags": [],
"custom_attributes": [
{
"identifier": "birthday",
"value": "1991-05-23"
}
],
"danmark_group": null
},
{
"id": 2,
"name": "Mary Williams",
"email": "m.williams@mycompany.dk",
"phone": "43612915",
"address": "3 Mike Common",
"zip": "NG34 9HJ",
"city": "Copenhagen",
"cpr": "3574261234",
"notes": "",
"profile_image_url": "https:\/\/www.gravatar.com\/avatar\/5ea799d8476cbe0b1965c39e7c7dbd99?d=mm&s=200",
"status": "inactive",
"created_at": "2019-04-20 08:14:21",
"tags": [],
"custom_attributes": [],
"danmark_group": 1
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/clients
Query Parameters
Parameter | Status | Description |
---|---|---|
active | optional | Return only the active clients. |
inactive | optional | Return only the inactive clients. |
has_email | optional | Return only the clients with an email. |
has_phone | optional | Return only the clients with phone number. |
cpr | optional | Return only the clients with a given CPR number. |
tag_id | optional | Return only clients belonging to this tag ID. |
order_by_name | optional | =[asc|desc] Order results by name. |
order_by_created | optional | =[asc|desc] Order results by creation date. |
order_by_email | optional | =[asc|desc] Order results by email. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Create client
Requires authentication
Creates a new client with the given data.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post("api/v1/clients", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"name" => "John Doe",
"email" => "john.doe@example.com",
"ean" => 5789012345678,
"phone" => 7380111233,
"zip" => "M14 5PT",
"city" => "Manchester",
"cpr" => "0123456789",
"notes" => "Some notes",
"tags" => [
[
"id" => 15,
],
[
"name" => "Gold clients",
],
],
"status" => "active",
"custom_attributes" => [
[
"identifier" => "birthday",
"value" => "1991-05-23",
],
],
"danmark_group" => 1,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X POST "https://system.easypractice.net/api/v1/clients" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"John Doe","email":"john.doe@example.com","ean":5789012345678,"phone":7380111233,"zip":"M14 5PT","city":"Manchester","cpr":"0123456789","notes":"Some notes","tags":[{"id":15},{"name":"Gold clients"}],"status":"active","custom_attributes":[{"identifier":"birthday","value":"1991-05-23"}],"danmark_group":1}'
const url = new URL("https://system.easypractice.net/api/v1/clients");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"name": "John Doe",
"email": "john.doe@example.com",
"ean": 5789012345678,
"phone": 7380111233,
"zip": "M14 5PT",
"city": "Manchester",
"cpr": "0123456789",
"notes": "Some notes",
"tags": [
{
"id": 15
},
{
"name": "Gold clients"
}
],
"status": "active",
"custom_attributes": [
{
"identifier": "birthday",
"value": "1991-05-23"
}
],
"danmark_group": 1
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (201):
{
"message": "Created",
"data": {
"id": 123,
"name": "John Doe",
"email": "john.doe@example.com",
"ean": "5789012345678",
"phone": "7380111233",
"zip": "M14 5PT",
"city": "Manchester",
"cpr": "0123456789",
"notes": "Some notes",
"status": "active",
"tags": [],
"custom_attributes": [
{
"identifier": "birthday",
"value": "1991-05-23"
}
],
"danmark_group": 1
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"name": [
"The Name field is required."
]
}
}
HTTP Request
POST api/v1/clients
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
name | string | required | The Name of the client. |
string | optional | The Email of the client. | |
ean | string | optional | The EAN-number of the client. |
phone | string | optional | The Phone of the client without the country code. |
zip | string | optional | The Zip/Postcode of the client. |
city | string | optional | The City of the client. |
cpr | string | optional | The CPR of the client. |
notes | string | optional | The Notes of the client. |
tags | array | optional | The tags associated to the client. It's possible to use the id or the name for each tag. |
status | string | optional | The status of the client. Currently only two statuses are allowed: "active" and "inactive". |
custom_attributes | array | optional | The custom fields and their values for the client. Must have "Custom Fields" app enabled. Non-existent fields will be ignored. See Client Custom Attributes for a list of available attributes on your account. |
danmark_group | integer | optional | (Danish accounts only) The Sygeforsikring "danmark" group number for this client. Must be one of these values: null (not set), 0 (Ved ikke), 1 (Gruppe 1), 2 (Gruppe 2), 5 (Gruppe 5) or 6 (Gruppe 6). A valid CPR is required to assign a client to a "danmark" group. |
Show client
Requires authentication
Returns the client data for a given ID.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/clients/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/clients/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/clients/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"name": "John Smith",
"email": "john@mydomain.dk",
"phone": "61175736",
"address": "159 Bailey Brooks",
"zip": "W10 6DY",
"city": "Copenhagen",
"cpr": "1598431234",
"notes": "Notes about John",
"profile_image_url": "https:\/\/www.gravatar.com\/avatar\/5ea799d8476cbe0b1965c39e7c7dbd99?d=mm&s=200",
"status": "active",
"created_at": "2019-04-16 11:54:42",
"tags": [],
"custom_attributes": [
{
"identifier": "birthday",
"value": "1991-05-23"
}
],
"danmark_group": 1
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/clients/{client}
Update client
Requires authentication
Updates the client.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put("api/v1/clients/1", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"name" => "John Doe",
"email" => "john.doe@example.com",
"ean" => 5789012345678,
"phone" => 7380111233,
"zip" => "M14 5PT",
"city" => "Manchester",
"cpr" => "0123456789",
"notes" => "Some notes",
"tags" => [
[
"id" => 15,
],
[
"name" => "Gold clients",
],
],
"status" => "active",
"custom_attributes" => [
[
"identifier" => "birthday",
"value" => "1991-05-23",
],
],
"danmark_group" => 1,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X PUT "https://system.easypractice.net/api/v1/clients/1" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"John Doe","email":"john.doe@example.com","ean":5789012345678,"phone":7380111233,"zip":"M14 5PT","city":"Manchester","cpr":"0123456789","notes":"Some notes","tags":[{"id":15},{"name":"Gold clients"}],"status":"active","custom_attributes":[{"identifier":"birthday","value":"1991-05-23"}],"danmark_group":1}'
const url = new URL("https://system.easypractice.net/api/v1/clients/1");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"name": "John Doe",
"email": "john.doe@example.com",
"ean": 5789012345678,
"phone": 7380111233,
"zip": "M14 5PT",
"city": "Manchester",
"cpr": "0123456789",
"notes": "Some notes",
"tags": [
{
"id": 15
},
{
"name": "Gold clients"
}
],
"status": "active",
"custom_attributes": [
{
"identifier": "birthday",
"value": "1991-05-23"
}
],
"danmark_group": 1
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Updated",
"data": {
"id": 1,
"name": "John Doe",
"email": "john.doe@example.com",
"ean": "5789012345678",
"phone": "7380111233",
"zip": "M14 5PT",
"city": "Manchester",
"cpr": "0123456789",
"notes": "Some notes",
"status": "active",
"tags": [],
"custom_attributes": [
{
"identifier": "birthday",
"value": "1991-05-23"
}
],
"danmark_group": 1
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"name": [
"The Name field is required."
]
}
}
HTTP Request
PUT api/v1/clients/{client}
PATCH api/v1/clients/{client}
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
name | string | required | The Name of the client. |
string | optional | The Email of the client. | |
ean | string | optional | The EAN-number of the client. |
phone | string | optional | The Phone of the client without the country code. |
zip | string | optional | The Zip/Postcode of the client. |
city | string | optional | The City of the client. |
cpr | string | optional | The CPR of the client. |
notes | string | optional | The Notes of the client. |
tags | array | optional | The tags associated to the client. It's possible to use the id or the name for each tag. |
status | string | optional | The status of the client. Currently only two statuses are allowed: "active" and "inactive". |
custom_attributes | array | optional | The custom fields and their values for the client. Must have "Custom Fields" app enabled. Non-existent fields will be ignored. See Client Custom Attributes for a list of available attributes on your account. |
danmark_group | integer | optional | (Danish accounts only) The Sygeforsikring "danmark" group number for this client. Must be one of these values: null (not set), 0 (Ved ikke), 1 (Gruppe 1), 2 (Gruppe 2), 5 (Gruppe 5) or 6 (Gruppe 6). A valid CPR is required to assign a client to a "danmark" group. |
Delete client
Requires authentication
Removes the client from the user's account and all of its associated data, such as bookings/journals/messages. Use with caution.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete("api/v1/clients/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X DELETE "https://system.easypractice.net/api/v1/clients/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/clients/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Deleted"
}
HTTP Request
DELETE api/v1/clients/{client}
Client tags
List clients tags.
Requires authentication
Returns all of user's clients tags. Use the filter options provided to order the results. For example: GET api/v1/clients?order_by_tag=asc
. Please note that this is an endpoint to administer the tags already created on the user. If you need to add/remove tags from clients, then use the Clients endpoint instead.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/client-tags", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"order_by_name" => "asc",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/client-tags" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/client-tags");
let params = {
"order_by_name": "asc",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"name": "Premium clients",
"timestamp": "2019-09-30T17:55:00+02:00"
},
{
"id": 2,
"name": "Gold clients",
"timestamp": "2019-09-30T17:55:00+02:00"
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/client-tags
Query Parameters
Parameter | Status | Description |
---|---|---|
order_by_name | optional | =[asc|desc] Order results by name. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Create clients tag.
Requires authentication
Creates a new clients tag with the given data.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post("api/v1/client-tags", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"name" => "Premium clients",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X POST "https://system.easypractice.net/api/v1/client-tags" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"Premium clients"}'
const url = new URL("https://system.easypractice.net/api/v1/client-tags");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"name": "Premium clients"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (201):
{
"message": "The new tag was created",
"data": {
"id": 123,
"name": "Premium clients",
"timestamp": "2019-09-30T17:55:00+02:00"
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"name": [
"The name field is required."
]
}
}
HTTP Request
POST api/v1/client-tags
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
name | string | required | The Name of the tag. |
Show clients tag.
Requires authentication
Returns the clients tag data for a given ID.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/client-tags/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/client-tags/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/client-tags/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"name": "Premium clients",
"timestamp": "2019-09-30T17:55:00+02:00"
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/client-tags/{client_tag}
Update clients tag.
Requires authentication
Updates the clients tag.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put("api/v1/client-tags/1", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"name" => "Premium clients",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X PUT "https://system.easypractice.net/api/v1/client-tags/1" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"Premium clients"}'
const url = new URL("https://system.easypractice.net/api/v1/client-tags/1");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"name": "Premium clients"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "The tag was updated",
"data": {
"id": 1,
"name": "Premium clients",
"timestamp": "2019-09-30T17:55:00+02:00"
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"name": [
"The name field is required."
]
}
}
HTTP Request
PUT api/v1/client-tags/{client_tag}
PATCH api/v1/client-tags/{client_tag}
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
name | string | required | The Name of the tag. |
Delete clients tag.
Requires authentication
Removes the clients tag from the user's account.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete("api/v1/client-tags/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X DELETE "https://system.easypractice.net/api/v1/client-tags/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/client-tags/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "Deleted"
}
HTTP Request
DELETE api/v1/client-tags/{client_tag}
Invoices
List invoices
Requires authentication
Returns all of user's invoices. Use the filter options provided to narrow down the results. For example: GET api/v1/invoices?client_id=123
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/invoices", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"client_id" => "54347",
"paid" => "1",
"unpaid" => "1",
"order_by_number" => "asc",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/invoices" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/invoices");
let params = {
"client_id": "54347",
"paid": "1",
"unpaid": "1",
"order_by_number": "asc",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"draft": false,
"client_id": 123,
"number": 454,
"date": "2019-04-20T00:00:00+01:00",
"due_date": "2019-04-20T00:00:00+01:00",
"executed_date": "2019-04-20T00:00:00+01:00",
"paid_date": "2019-04-20T00:00:00+01:00",
"sent": true,
"sent_via_ean": false,
"paid": true,
"credited": false,
"status": "paid",
"clientname": "John Doe",
"clientcpr": "123456-7890",
"clientaddress": "54 Harry Lane",
"clientzip": "1234",
"clientcity": "Copenhagen",
"note": "Lorem Ipsum",
"payment_type": "card",
"currency": "DKK",
"total": 625,
"lines": [
{
"id": 23,
"invoice_id": 1,
"product_id": 1,
"position": 0,
"amount": 1,
"price": 500,
"vat": true,
"vat_rate": 25,
"total_without_vat": 500,
"total": 625,
"text": "Client appointment",
"comment": "",
"booking_description": "Appointment Tuesday 16 April 2019, 16:05"
}
]
},
{
"id": 2,
"draft": false,
"client_id": 22,
"number": 455,
"date": "2019-05-01T00:00:00+01:00",
"due_date": "2019-05-01T00:00:00+01:00",
"executed_date": "2019-05-01T00:00:00+01:00",
"paid_date": "2019-05-01T00:00:00+01:00",
"sent": true,
"sent_via_ean": false,
"paid": true,
"credited": false,
"status": "paid",
"clientname": "Jaimes Armsworth",
"clientcpr": "121212-7890",
"clientaddress": "4 Snow Street",
"clientzip": "5454",
"clientcity": "Copenhagen",
"note": "Lorem Ipsum",
"payment_type": "card",
"currency": "DKK",
"total": 1500,
"lines": [
{
"...": "..."
},
{
"...": "..."
}
]
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/invoices
Query Parameters
Parameter | Status | Description |
---|---|---|
client_id | optional | Return only invoices belonging to this client ID. |
paid | optional | Return only the paid invoices. |
unpaid | optional | Return only the unpaid invoices. |
order_by_number | optional | =[asc|desc] Order results by invoice number. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Mark an invoice as paid
Requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post("api/v1/invoices/1/mark-as-paid", [
'headers' => [
"Authorization" => "Bearer {token}",
"Content-Type" => "application/json",
],
'json' => [
"date" => "2019-05-16",
"payment_type" => "card",
"amount" => 1500,
"currency" => "DKK",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X POST "https://system.easypractice.net/api/v1/invoices/1/mark-as-paid" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"date":"2019-05-16","payment_type":"card","amount":1500,"currency":"DKK"}'
const url = new URL("https://system.easypractice.net/api/v1/invoices/1/mark-as-paid");
let headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
}
let body = {
"date": "2019-05-16",
"payment_type": "card",
"amount": 1500,
"currency": "DKK"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"message": "The Invoice 123 was marked as paid on 2019-05-20 with the payment method Card"
}
Example response (400):
{
"error": {
"message": "The Invoice 123 is already paid.",
"status_code": 400
}
}
Example response (422):
{
"error": {
"message": "The given data is invalid",
"status_code": 422
},
"data": {
"payment_type": [
"The selected Payment type is invalid."
]
}
}
HTTP Request
POST api/v1/invoices/{id}/mark-as-paid
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
date | date | required | The Date of the payment. |
payment_type | string | required | The Payment method used. Available values: 'transfer', 'cash', 'card', 'other', 'mobile_pay' (Denmark only), 'health_insurance', 'swish' (Sweden only) |
amount | float | required | The Amount of the payment. |
currency | string | required | The Currency of the payment. |
Online Booking
List Available Dates
Requires authentication
Returns a list of Available dates based on a supplied date range, products and calendars. It does not return dates in the past, as they would never be available.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/online-booking/available-dates", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"from" => "2020-08-01",
"to" => "2020-09-01",
"product_ids" => "1",
"addon_ids" => "4",
"calendar_id" => "1",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/online-booking/available-dates" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/online-booking/available-dates");
let params = {
"from": "2020-08-01",
"to": "2020-09-01",
"product_ids": "1",
"addon_ids": "4",
"calendar_id": "1",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"date": "2020-08-21",
"available": true
},
{
"date": "2020-08-22",
"available": false,
"reason": "closed_opening_time"
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/online-booking/available-dates
Query Parameters
Parameter | Status | Description |
---|---|---|
from | required | date_format:Y-m-d Return Available Dates from the start of the supplied date. |
to | required | date_format:Y-m-d Return Available Dates to the end of the supplied date. |
product_ids | required | array Return Available Dates/Times based on an array of product IDs. |
addon_ids | optional | array Return Available Dates/Times based on an array of product addons that are allowed to be attached to the supplied product_ids. |
calendar_id | optional | integer Return Available Dates/Times based on a specific Calendar. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
List Available Times
Requires authentication
Returns a list of Available times based on a supplied date, products and calendars. It does not return times in the past, as they would never be available.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/online-booking/available-times", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"date" => "2020-09-01",
"product_ids" => "1",
"addon_ids" => "4",
"calendar_id" => "1",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/online-booking/available-times" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/online-booking/available-times");
let params = {
"date": "2020-09-01",
"product_ids": "1",
"addon_ids": "4",
"calendar_id": "1",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"date": "2020-08-30T09:00:00+01:00",
"available": true
},
{
"date": "2020-08-30T10:00:00+01:00",
"available": false,
"reason": "overlapping_booking"
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/online-booking/available-times
Query Parameters
Parameter | Status | Description |
---|---|---|
date | required | date_format:Y-m-d Return Available Times for the supplied date. |
product_ids | required | array Return Available Dates/Times based on an array of product IDs. |
addon_ids | optional | array Return Available Dates/Times based on an array of product addons that are allowed to be attached to the supplied product_ids. |
calendar_id | optional | integer Return Available Dates/Times based on a specific Calendar. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Services
List services
Requires authentication
Returns all of user's services. Use the filter options provided to narrow down the results. For example: GET api/v1/services?order_by_name=asc
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/services", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"order_by_name" => "asc",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/services" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/services");
let params = {
"order_by_name": "asc",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"name": "Example of a service",
"description": "This is an example of your first service. You can either edit this service or delete it and create a new one to make if fit your practice",
"duration": 45,
"break_after_service": 15,
"currency": "DKK",
"price": 50,
"vat": true,
"vat_rate": 25,
"product_group_id": 0,
"is_available_in_online_booking": true,
"online_payment_enabled": true,
"reserve_online_payment": true,
"require_payment_in_advance": true,
"payment_rates_enabled": true,
"payment_rates_interval": "weekly",
"payment_rates_number": 4,
"calendars": [
{
"id": 12,
"name": "Calendar",
"color": "#C3E1FF"
}
],
"addons": [
{
"id": 2,
"name": "Additional time"
}
]
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/services
Query Parameters
Parameter | Status | Description |
---|---|---|
order_by_name | optional | =[asc|desc] Order results by name. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Show service
Requires authentication
Returns the service data for a given ID.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/services/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/services/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/services/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"name": "Example of a service",
"description": "This is an example of your first service. You can either edit this service or delete it and create a new one to make if fit your practice",
"duration": 45,
"break_after_service": 15,
"currency": "DKK",
"price": 50,
"vat": true,
"vat_rate": 25,
"product_group_id": 0,
"is_available_in_online_booking": true,
"online_payment_enabled": true,
"reserve_online_payment": true,
"require_payment_in_advance": true,
"payment_rates_enabled": true,
"payment_rates_interval": "weekly",
"payment_rates_number": 4,
"calendars": [
{
"id": 12,
"name": "Calendar",
"color": "#C3E1FF"
}
],
"addons": [
{
"id": 2,
"name": "Additional time"
}
]
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/services/{product}
List addons
Requires authentication
Returns all of user's addons. Addons are similar to services, but have fewer properties and their functionality depends on the service it is attached to during the booking (Online Payment, Payment Rates, etc). Use the filter options provided to narrow down the results. For example: GET api/v1/addons?order_by_name=asc
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/addons", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"order_by_name" => "asc",
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/addons" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/addons");
let params = {
"order_by_name": "asc",
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 2,
"name": "Additional time",
"description": "",
"duration": 15,
"break_after_service": 0,
"currency": "DKK",
"price": 15,
"vat": true,
"vat_rate": 25,
"is_available_in_online_booking": true,
"services": [
{
"id": 1,
"name": "Example of a service"
}
]
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/addons
Query Parameters
Parameter | Status | Description |
---|---|---|
order_by_name | optional | =[asc|desc] Order results by name. |
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Show addon
Requires authentication
Returns the addon data for a given ID.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/addons/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/addons/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/addons/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 2,
"name": "Additional time",
"description": "",
"duration": 15,
"break_after_service": 0,
"currency": "DKK",
"price": 15,
"vat": true,
"vat_rate": 25,
"is_available_in_online_booking": true,
"services": [
{
"id": 1,
"name": "Example of a service"
}
]
}
Example response (404):
{
"error": {
"message": "Not Found",
"status_code": 404
}
}
HTTP Request
GET api/v1/addons/{addon}
User Employees
List Employees
Requires authentication
Returns all of user's employees. For example: GET api/v1/employees
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/employees", [
'headers' => [
"Authorization" => "Bearer {token}",
],
'query' => [
"page_size" => "20",
"page" => "4",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/employees" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/employees");
let params = {
"page_size": "20",
"page": "4",
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"data": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"profile_image_url": "https:\/\/www.gravatar.com\/avatar\/a6753b5d10e6a069e284cff387f94665?d=mm"
},
{
"id": 2,
"name": "Jane Doe",
"email": "jane@example.com",
"profile_image_url": "https:\/\/www.gravatar.com\/avatar\/a6753b5d10e6a069e284cff387f94665?d=mm"
}
],
"links": {
"...": "..."
},
"meta": {
"...": "..."
}
}
HTTP Request
GET api/v1/employees
Query Parameters
Parameter | Status | Description |
---|---|---|
page_size | optional | (default: 10) The number of items per page. |
page | optional | (default: 1) The page number. |
Show Employee
Requires authentication
Returns an Employee. For example: GET api/v1/employees/1
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get("api/v1/employees/1", [
'headers' => [
"Authorization" => "Bearer {token}",
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl -X GET -G "https://system.easypractice.net/api/v1/employees/1" \
-H "Authorization: Bearer {token}"
const url = new URL("https://system.easypractice.net/api/v1/employees/1");
let headers = {
"Authorization": "Bearer {token}",
"Accept": "application/json",
"Content-Type": "application/json",
}
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
Example response (200):
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"profile_image_url": "https:\/\/www.gravatar.com\/avatar\/a6753b5d10e6a069e284cff387f94665?d=mm"
}
HTTP Request
GET api/v1/employees/{employee}
Errors
The EasyPractice API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is malformed or otherwise invalid. Please double check our API documentation for allowed request parameters. |
401 | Unauthorized -- Your API key is incorrect or has been revoked. Check the Authentation section on how to get an API token. |
403 | Forbidden -- You do not have access rights to the resource. Your API key might be limited to what you can access. |
404 | Not Found -- The resource was not found. |
405 | Method Not Allowed -- The HTTP method you used was incorrect and unsupported for the specific endpoint. |
422 | Unprocessable Entity -- Some or all data provided is invalid for the type of request. Please see the response data for clues about which of the data provided is invalid and why. |
429 | Too Many Requests -- You are making too many requests. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. |
Help
If you have any questions regarding our API, you can contact us at support@easypractice.net.
EasyPractice © 2016