API - Planyo Web Services

You are here: Planyo » Help » API
The Planyo API lets you perform advanced functions and automate the Planyo reservation system (e.g. import resource data and photos into your site, make automated reservations). To use the API you must be familiar with a programming language such as PHP, Java, Ruby or ASP.NET.

Authentication

Click here to get your API key. You will need it to authenticate all calls made to the API

Request format

At this time the API uses only the REST request format: a simple GET or POST HTTP action. The REST end point URL is: http://api.planyo.com/rest/

Here's a sample test request: http://api.planyo.com/rest/?method=api_test

Required parameters

All API requests require the following parameters:
method - this is the method being called
api_key - your API key (note: the API key is required for all methods except api_test). Click here to get your key

Optional parameters

version - you can optionally specify the version of the API that you're using. Use the value of latest or simply skip this parameter to use the latest API version. The latest version is: 0.2
language - by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned in the data key

Response format

At this time Planyo API only uses JSON (JavaScript Object Notation) as the response format. This is one of the most popular data formats (more info about this format at json.org) fully supported by languages like PHP or even JavaScript. The response uses a named array for the output data with text-based keys.

Successful responses

Here's a sample response (returned by the api_test method):
{"data":"API Test Response","response_code":0,"response_message":"Method api_test executed successfully."}

Successful responses will contain the response data in the data key. This is usually another named array but in the response above, it's a simple string 'API Test response'.

The response_code key will always contain the value of 0 (success) and response_message will say Method xyz executed successfully.

Failure responses

Failure responses will contain one of the following failure codes in the response_code key:
1 - authentication error (invalid API key) or invalid method
3 - invalid input data
4 - other error

response_message will contain the error message (in English)

API Methods

The API is at this time far from being complete. Please send your requests for additional functionality using the contact form. The following methods are currently available:
add_notification_callback
add_reservation_payment
add_resource
add_user
add_vacation
can_make_reservation
do_reservation_action
get_all_resources
get_all_users
get_custom_property
get_event_times
get_form_items
get_rental_price
get_reservation_data
get_reservation_payment_amount
get_reservation_products
get_resource_info
get_resource_pricing
get_resource_seasons
get_resource_usage_for_month
get_site_info
get_user_data
is_resource_available
list_reservation_payments
list_reservations
list_vacations
make_reservation
modify_user
process_template
remove_vacation
reservation_search
resource_search
set_custom_property
set_event_times
set_payment_gateway

Sample code

You'll find a PHP sample in the get_all_resources, get_event_times and process_template functions

API playground

You'll find the API playground where you can easily test any API function here

HTTP notifications

Planyo can also inform your server whenever an event occurs, such as new reservation being entered or a reservation being cancelled etc. You don't need the API key for this functionality, please see Q222 for the details.