The API is for:

Individuals

Helps individuals remotely access their accounts.

Managers

Helps property managers share their property details with remote services and apps.

Everybody

Helps everybody to make online bookings.

Security

Your Client ID and Secret allow you to make secure calls to your account on the system, therefore you should never expose your details to the web or share them with another person. These keys are bound to your registered account, and not any properties that you may have access to, so compromising your Client ID and Secret would allow access to all properties you have access rights to.

If you suspect that your Client ID might have been compromised, you must immediately inform us.

Authentication

The system allows you to make an unlimited number of API Client ids and secrets. This allows you to create different clients for different services, for example you may want one service (e.g. a website) to only have the ability to search for properties, whereas another client ( such as a mobile phone app) might have the ability to pull invoice information from accounts.

The API uses the OAuth 2.0 protocol for simple, but effective authentication and authorization. OAuth 2.0 is much easier to use than previous schemes and developers can start using the API almost immediately.

Calls to the API require a token issued by the system, which can be retrieved by sending a POST request containing grant_type, client id and secret. This is an example of what a token request in PHP might look like:

$client_id = 'CLIENT-ID';
$client_secret = 'CLIENT-SECRET';
$server = 'http://oloughlinshotel.com/jomres/api/';

$data=array(
	'grant_type' => 'client_credentials' , 
	"client_id" => $client_id , 
	"client_secret" => $client_secret
	);

$ch = curl_init($server);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$token_request=curl_exec ($ch);

$status = curl_getinfo($ch); 
curl_close ($ch);
$response = json_decode($token_request);  
		

Successfully authenticated clients will receive a message like

{"access_token":"2c8d95f62b9b700f4515acb9f23d07f9a131e8df","expires_in":3600,"token_type":"Bearer","scope":"bookings_get,bookings_set,properties_get,properties_set,email_get,favourites_get,favourites_set,search_get"}
		

The token in the response is what you will use to send calls to the system that request access to the system's available Methods. Once you have your token, you can start requesting information from the system:

$token = $response->access_token;
$server = 'http://oloughlinshotel.com/jomres/api/';
$result = query_remote_server( $server , $token , "GET" , "favourites" );

function query_remote_server( $server , $token , $method="GET" , $request ="" , $data=array(3) )
	{
	$ch = curl_init($server.$request);

	switch ( $method )
		{
		case 'POST':
				curl_setopt($ch, CURLOPT_POST, true);
				curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
			break;
		case 'DELETE':
				curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
			break;
		case 'PUT':
				curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); 
				curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
			break;
		default :
			break;
		}
	
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(
		'Authorization: Bearer '.$token,
		'Accept: application/json',
		));
	
	curl_setopt($ch, CURLINFO_HEADER_OUT, true);
	curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
	$result=curl_exec ($ch);
	$errors = curl_error($ch);
	$status = curl_getinfo($ch); 
	$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	curl_close ($ch);
	return array (
		"result" => $result , 
		"status" => $status , 
		"errors" => $errors , 
		"response_code" => $response_code
		);
	}
		

Permissions ( Scopes )

You can give each Client specific permissions, for example some may only be able to perform searches, whereas others can directly access properties.

Additionally you can allow these clients to only Get (retrieve) information, or both Get and Set (change, including delete) information.

Endpoints

Calls to this API use an OAuth2 REST format request (DELETE , GET , POST & PUT ) and the endpoint is

http://oloughlinshotel.com/jomres/api/
		

Responses

The Envelope

Every authenticated response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact.

{
	"meta": {
		"code": 200
		},
	"data": {
		"xxx": yyy
		}
}
		
When dealing with the response, you would normally act on the response found in the "data" key.

meta

The meta key is used to communicate extra information about the response to the developer. Normally, you'll only ever see a code key with value 200. However, sometimes things go wrong, and in that case you might see a response like:

{
	"meta": {
		"code": 400,
		"error_message": "You didn't send something."
		}
}
		

Methods

Methods are the actual things you can do once you have a valid access token.

Title Get user's email address
Get the user's email address
File email.php
Jomres Plugin api_feature_email
Scope email_get
Method GET
URL Parameters None
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/email
	
Success Response
{
	"data": {
		"email_address": "example@example.com"
	}
}
				
Notes as stored in My Account, which is not necessarily the same as that stored in their CMS account details.

Title Delete a favourite
Delete a user's favourite by property uid
File favourites.php
Jomres Plugin api_feature_favourites
Scope favourites_set
Method DELETE
URL Parameters favourites/:ID/
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/favourites/2
	
Success Response
{
	"data": {
		"id": "1"
	}
}
				
Notes None

Title Get user's favourites
Get the user's favourite properties ( property uids )
File favourites.php
Jomres Plugin api_feature_favourites
Scope favourites_get
Method GET
URL Parameters favourites
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/favourites/
	
Success Response
{
	"data": {
		"ids": [
			6,
			3,
			5,
			4
		]
	}
}
				
Notes None

Title Add a favourite
Add a property uid to a user's favourites
File favourites.php
Jomres Plugin api_feature_favourites
Scope favourites_set
Method POST
URL Parameters favourites/:ID/
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/favourites/1
	
Success Response
{
	"data": {
		"id": "1"
	}
}
				
Notes None

Title Delete Property
Delete a user's property
File properties.php
Jomres Plugin api_feature_properties
Scope properties_set
Method DELETE
URL Parameters properties/:ID/
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85
	
Success Response
{
	"data": {
		"id": "86"
	}
}
				
Notes If the user has just one property that they have access rights to, they will not be able to delete that property

Title Get all properties
Get all of a user's properties
File properties.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/all/
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/all
	
Success Response
{
	"data": {
		"ids": [
			1,
			2,
			3,
			4,
			5,
			6,
			7,
			8,
			9,
			10,
			12,
			13,
			14,
			15,
			16,
			17,
			18,
			19,
			20,
			21,
			22,
			23,
			24,
			25,
			52,
			53,
			79,
			80,
			81,
			82,
			85,
			86
		]
	}
}
				
Notes Supplies all properties that a use has rights to administer

Title Get all regions in database
Get all regions in database
File properties.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/regions/(:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/regions
	
Success Response
{
	"data": {
		"regions": {
			"6": {
				"id": "6",
				"countrycode": "AD",
				"regionname": "Andorra la Vella"
			},
			"1": {
				"id": "1",
				"countrycode": "AD",
				"regionname": "Canillo"
			},
			"2": {
				"id": "2",
				"countrycode": "AD",
				"regionname": "Encamp"
			},
			"7": {
				"id": "7",
				"countrycode": "AD",
				"regionname": "Escaldes-Engordany"
			}
		}
	}
}
				
Notes If you want to create properties through the api you will need a region's ID, which can be found in the returned results of this method

Title Get all property features
Get all property features
File properties.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/features/(:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/features
	
Success Response
{
	"data": {
		"all_property_features": {
			"32": {
				"abbv": "24hr service",
				"desc": "24hr Room service",
				"image": "24hour.png",
				"ptype_xref": "a:1:{i:0;s:1:\"1\";}",
				"cat_id": "9"
			}
		}
	}
}
				
Notes Index of the returned array is the unique id of the property features. Note that some property features are only available to some property types, see the serialized ptype_xref column. cat_id refers to the category of property features and is unlikely to be of use to you.

Title Get Property Availability
Get the room availabiity of a property. Returns the room uids available on the requested dates.
File properties_availabilities.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/availabilities/:START_DATE/:END_DATE
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/2/availabilities/2016-05-20/2016-05-22
	
Success Response
{
	"data": {
		"available_rooms": {
			"7": {
				"room_uid": 7,
				"room_name": "",
				"room_number": "01",
				"room_classes_uid": 1,
				"room_features_uid": "",
				"max_people": 3
			}
		}
	}
}
				
Notes

Title Get Property Name
Get the property name by property uid
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/name(/:LANGUAGE) LANGUAGE is optional, default to en-GB if not sent
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/name/en-GB
	
Success Response
{
	"data": {
		"property_name": "Best West Hotel"
	}
}
				
Notes

Title Get Property Description
Get the property description
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/description(/:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/description/en-GB
	
Success Response
{
	"data": {
		"property_description": "

property description<\/p>" } }

Notes

Title Get Property Checkin times
Get the property Checkin times as entered into the property details edit page
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/property_checkin_times(/:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/property_checkin_times/en-GB
	
Success Response
{
	"data": {
		"property_checkin_times": "

checking times<\/p>" } }

Notes

Title Get Property Area Activities
Get the property Area Activities as entered into the property details edit page
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/property_area_activities(/:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/property_area_activities/en-GB
	
Success Response
{
	"data": {
		"property_area_activities": "

area activities<\/p>" } }

Notes

Title Get Property Driving Directions
Get the property Driving directions as entered into the property details edit page
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/property_driving_directions(/:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/property_driving_directions/en-GB
	
Success Response
{
	"data": {
		"property_driving_directions": "

driving directions<\/p>" } }

Notes

Title Get Property Terms and Conditions
Get the property Terms and Conditions as entered into the property details edit page
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/property_policies_disclaimers(/:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/property_policies_disclaimers/en-GB
	
Success Response
{
	"data": {
		"property_policies_disclaimers": "

terms etc<\/p>" } }

Notes

Title Get Latitude & Logitude
Get the property location
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/lat_long
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/lat_long
	
Success Response
{
	"data": {
		"lat_long": {
			"lat": "51.49998",
			"long": "-0.13596"
		}
	}
}
				
Notes

Title Get Property Accommodation tax rate
Get the property Accommodation tax rate
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/accommodation_tax_rate
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/accommodation_tax_rate
	
Success Response
{
	"data": {
		"accommodation_tax_rate": 20
	}
}
				
Notes

Title Get Property Room types
Get the property room types
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/property_room_types
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/property_room_types/en-GB
	
Success Response
{
	"data": {
		"this_property_room_classes": {
			"4": {
				"abbv": "Room 4 Poster bed",
				"desc": false,
				"image": "fourposter.png"
			},
			"1": {
				"abbv": "Room Double beds",
				"desc": false,
				"image": "double.png"
			},
			"3": {
				"abbv": "Room Single",
				"desc": false,
				"image": "single.png"
			},
			"2": {
				"abbv": "Room Twin beds",
				"desc": false,
				"image": "twin.png"
			}
		}
	}
}
				
Notes

Title Get Property Settings
Get the property specific settings
File properties_details.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/details/settings
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/details/settings
	
Success Response
{
	"data": {
		"settings": {
			"version": "6.1.0",
			"newTariffModels": "2"
		}
	}
}Anarrayofsettings,
trimmedforbrevity.
				
Notes The property's mrConfig variable

Title Get Main Image
Get the property main image
File properties_images.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/images/main
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/images/main
	
Success Response
{
	"data": {
		"images": {
			"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/2.jpg",
			"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/2.jpg",
			"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/2.jpg"
		}
	}
}
				
Notes

Title Get Slideshow Images
Get the property slideshow images
File properties_images.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/images/slideshow
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/images/slideshow
	
Success Response
{
	"data": {
		"images": [
			[
				{
					"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/slideshow\/0\/2.jpg",
					"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/slideshow\/0\/medium\/2.jpg",
					"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/slideshow\/0\/thumbnail\/2.jpg"
				}
			]
		]
	}
}
				
Notes

Title Get Room Images
Get the property room images
File properties_images.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/images/room
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/images/room
	
Success Response
{
	"data": {
		"images": {
			"7": [
				{
					"large": "http:\/\/localhost\/quickstart\/jomres\/images\/noimage.gif",
					"medium": "http:\/\/localhost\/quickstart\/jomres\/images\/noimage.gif",
					"small": "http:\/\/localhost\/quickstart\/jomres\/images\/noimage_small.gif"
				}
			]
		}
	}
}
				
Notes The indecies of the array returned is the room uid.

Title Get Property Tariffs
Get the property tariffs
File properties_tariffs.php
Jomres Plugin api_feature_properties
Scope properties_get
Method GET
URL Parameters properties/:ID/tariffs/(:LANGUAGE)
POST/PUT Params None
Sample Call
http://oloughlinshotel.com/jomres/api/properties/85/tariffs/en-GB
	
Success Response
{
	"data": {
		"tariffs": [
			{
				"rates_uid": 31530,
				"rate_title": "Tariff",
				"rate_description": "",
				"validfrom": "2016\/05\/24",
				"validto": "2026\/05\/24",
				"roomrateperday": 150,
				"mindays": 1,
				"maxdays": 1000,
				"minpeople": 1,
				"maxpeople": 4,
				"roomclass_uid": "4",
				"ignore_pppn": 0,
				"allow_we": 1
			},
			{
				"rates_uid": 31531,
				"rate_title": "Tariff",
				"rate_description": "",
				"validfrom": "2016\/05\/24",
				"validto": "2026\/05\/24",
				"roomrateperday": 140,
				"mindays": 1,
				"maxdays": 1000,
				"minpeople": 1,
				"maxpeople": 5,
				"roomclass_uid": "1",
				"ignore_pppn": 0,
				"allow_we": 1
			},
			{
				"rates_uid": 31532,
				"rate_title": "Tariff",
				"rate_description": "",
				"validfrom": "2016\/05\/24",
				"validto": "2026\/05\/24",
				"roomrateperday": 130,
				"mindays": 1,
				"maxdays": 1000,
				"minpeople": 1,
				"maxpeople": 2,
				"roomclass_uid": "3",
				"ignore_pppn": 0,
				"allow_we": 1
			},
			{
				"rates_uid": 31533,
				"rate_title": "Tariff",
				"rate_description": "",
				"validfrom": "2016\/05\/24",
				"validto": "2026\/05\/24",
				"roomrateperday": 120,
				"mindays": 1,
				"maxdays": 1000,
				"minpeople": 1,
				"maxpeople": 6,
				"roomclass_uid": "2",
				"ignore_pppn": 0,
				"allow_we": 1
			}
		]
	}
}
				
Notes

Title Add property
Create a property
File properties.php
Jomres Plugin api_feature_properties
Scope properties_get
Method POST
URL Parameters properties/add/(:LANGUAGE)
POST/PUT Params property_name, property_street, property_town, region, property_postcode, country, property_tel, price, lat, long, ptype_id, stars, superior, property_description, property_checkin_times, property_area_activities, property_driving_directions, property_airports, property_othertransport, property_policies_disclaimers
Sample Call
http://oloughlinshotel.com/jomres/api/properties/add
	
Success Response
{
	"data": {
		"id": 87
	}
}
				
Notes Useful companion methods www.example.com/jomres/api/properties/regions & www.example.com/jomres/api/properties/types which return region names and ids, and property types and their ids, respectively.

POST FIELDS example

$data = array (
"property_name" => "API Property",
"property_street" => "API Property",
"property_town" => "API Property",
"region" => 6, Use www.example.com/jomres/api/properties/regions to retrieve Region ids
"property_postcode" => "API Property",
"country" => "GB", Countries sent must be in ISO 3166 format ( http:www.iso.org/iso/country_codes )
"property_tel" => "01234 567890",
"price" => "0.00", Real estate type properties only
"lat" => "51.50068", Latitude
"long" => "-0.14317", Longitude
"ptype_id" => 1, Use www.example.com/jomres/api/properties/types to retrieve possible property types and their available ids
"stars" => 4,
"superior" => 0, 0 no, 1 yes
"property_description" => 'Lorem ipsum dolor sit amet...',
"property_checkin_times" => 'Lorem ipsum dolor sit amet...',
"property_area_activities" => 'Lorem ipsum dolor sit amet...',
"property_driving_directions" => 'Lorem ipsum dolor sit amet...',
"property_airports" => 'Lorem ipsum dolor sit amet...',
"property_othertransport" => 'Lorem ipsum dolor sit amet...',
"property_policies_disclaimers" => 'Lorem ipsum dolor sit amet...'
);

Title Get room types
Returns a list of room types with their IDs
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/site_structure/types/room(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/site_structure/types/room
	
Success Response
{
	"data": {
		"all_room_types": {
			"29": {
				"room_classes_uid": 29,
				"room_class_abbv": "5 bedroom cave",
				"room_class_full_desc": false,
				"image": "5bedrooms.png"
			},
			"16": {
				"room_classes_uid": 16,
				"room_class_abbv": "Car rental Hatchback",
				"room_class_full_desc": false,
				"image": "car_rental_hatchback.png"
			}
		}
	}
}
				
Notes Site Structure api feature, would be used when setting up search forms in a remote device, as it supplies the currently available room types in the system.

Title Get property types
Returns a list of property types with their IDs
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/site_structure/types/property(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/site_structure/types/property
	
Success Response
{
	"data": {
		"all_property_type_titles": {
			"1": "Hotel",
			"2": "Yacht",
			"3": "Car",
			"4": "Camp Site",
			"5": "Bed and Breakfast",
			"6": "Villa",
			"7": "Apartment",
			"8": "Cottage",
			"9": "Tour",
			"10": "For Sale",
			"12": "Cave house"
		}
	}
}
				
Notes Site Structure api feature, would be used when setting up search forms in a remote device, as it supplies the currently available property types in the system. The index is the property type id.

Title Search for properties by number of stars
Perform searches and receive back basic property details of results after searching by stars
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/stars/:NUMBER(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/stars/3
	
Success Response
{
	"data": {
		"search_results": {
			"2": {
				"property_name": "Best West Hotel",
				"property_street": "142 - 146 Harley Street",
				"property_town": "London",
				"property_postcode": "W1G 7LD",
				"property_region": "London, City of",
				"property_region_id": "1154",
				"property_country": "United Kingdom",
				"property_country_code": "GB",
				"property_tel": "34324324324",
				"property_email": "your@email.com",
				"stars": 5,
				"images": [
					[
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/2.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/2.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/2.jpg"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg"
						}
					]
				],
				"property_details_page": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=viewproperty&property_uid=2",
				"bookthis_link": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=dobooking&selectedProperty=2",
				"bookthis_text": "Request booking"
			}
		}
	}
}
				
Notes Returns an indexed array of properties, the array key is the property uid
Array contents :
property_name
property_street
property_town
property_postcode
property_region
property_region_id
property_country
property_country_code
property_tel
property_email
images , an array of any images that may have been uploaded. These are the "main" images which are typically seen on the property list pages.
property_details_page
bookthis_link , this is either to the booking form, or to the contact owner page depending on the property's configuration.
bookthis_text , related to the bookthis_link it's contents will vary according to the property's configuration.

Title Search for properties by price
Perform searches and receive back basic property details of results after searching by price
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/price/:LOW/:HIGH(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/price/50/100/
	
Success Response
{
	"data": {
		"search_results": {
			"2": {
				"property_name": "Best West Hotel",
				"property_street": "142 - 146 Harley Street",
				"property_town": "London",
				"property_postcode": "W1G 7LD",
				"property_region": "London, City of",
				"property_region_id": "1154",
				"property_country": "United Kingdom",
				"property_country_code": "GB",
				"property_tel": "34324324324",
				"property_email": "your@email.com",
				"stars": 5,
				"images": [
					[
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/2.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/2.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/2.jpg"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg"
						}
					]
				],
				"property_details_page": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=viewproperty&property_uid=2",
				"bookthis_link": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=dobooking&selectedProperty=2",
				"bookthis_text": "Request booking"
			}
		}
	}
}
				
Notes Returns an indexed array of properties, the array key is the property uid
Array contents :
property_name
property_street
property_town
property_postcode
property_region
property_region_id
property_country
property_country_code
property_tel
property_email
images , an array of any images that may have been uploaded. These are the "main" images which are typically seen on the property list pages.
property_details_page
bookthis_link , this is either to the booking form, or to the contact owner page depending on the property's configuration.
bookthis_text , related to the bookthis_link it's contents will vary according to the property's configuration.

Title Search for properties by property feature uids
Perform searches and receive back basic property details of results after searching by property feature uids /
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/features/:ARRAY(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/features/3,2,5
	
Success Response
{
	"data": {
		"search_results": {
			"2": {
				"property_name": "Best West Hotel",
				"property_street": "142 - 146 Harley Street",
				"property_town": "London",
				"property_postcode": "W1G 7LD",
				"property_region": "London, City of",
				"property_region_id": "1154",
				"property_country": "United Kingdom",
				"property_country_code": "GB",
				"property_tel": "34324324324",
				"property_email": "your@email.com",
				"stars": 5,
				"images": [
					[
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/2.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/2.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/2.jpg"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg"
						}
					]
				],
				"property_details_page": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=viewproperty&property_uid=2",
				"bookthis_link": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=dobooking&selectedProperty=2",
				"bookthis_text": "Request booking"
			}
		}
	}
}
				
Notes Returns an indexed array of properties, the array key is the property uid
Array contents :
property_name
property_street
property_town
property_postcode
property_region
property_region_id
property_country
property_country_code
property_tel
property_email
images , an array of any images that may have been uploaded. These are the "main" images which are typically seen on the property list pages.
property_details_page
bookthis_link , this is either to the booking form, or to the contact owner page depending on the property's configuration.
bookthis_text , related to the bookthis_link it's contents will vary according to the property's configuration.

Title search for properties in town
Perform searches and receive back basic property details of results
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/towns/:TOWN(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/towns/Torquay,London/en-GB
	
Success Response
{
	"data": {
		"search_results": {
			"2": {
				"property_name": "Best West Hotel",
				"property_street": "142 - 146 Harley Street",
				"property_town": "London",
				"property_postcode": "W1G 7LD",
				"property_region": "London, City of",
				"property_region_id": "1154",
				"property_country": "United Kingdom",
				"property_country_code": "GB",
				"property_tel": "34324324324",
				"property_email": "your@email.com",
				"stars": 5,
				"images": [
					[
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/2.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/2.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/2.jpg"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg"
						}
					]
				],
				"property_details_page": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=viewproperty&property_uid=2",
				"bookthis_link": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=dobooking&selectedProperty=2",
				"bookthis_text": "Request booking"
			}
		}
	}
}
				
Notes Returns an indexed array of properties, the array key is the property uid
Array contents :
property_name
property_street
property_town
property_postcode
property_region
property_region_id
property_country
property_country_code
property_tel
property_email
images , an array of any images that may have been uploaded. These are the "main" images which are typically seen on the property list pages.
property_details_page
bookthis_link , this is either to the booking form, or to the contact owner page depending on the property's configuration.
bookthis_text , related to the bookthis_link it's contents will vary according to the property's configuration.

Title search for properties in region
Perform searches and receive back basic property details of results after searching by region
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/regions/:REGIONS(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/regions/Devon
	
Success Response
{
	"data": {
		"search_results": {
			"2": {
				"property_name": "Best West Hotel",
				"property_street": "142 - 146 Harley Street",
				"property_town": "London",
				"property_postcode": "W1G 7LD",
				"property_region": "London, City of",
				"property_region_id": "1154",
				"property_country": "United Kingdom",
				"property_country_code": "GB",
				"property_tel": "34324324324",
				"property_email": "your@email.com",
				"stars": 5,
				"images": [
					[
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/2.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/2.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/2.jpg"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg"
						}
					]
				],
				"property_details_page": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=viewproperty&property_uid=2",
				"bookthis_link": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=dobooking&selectedProperty=2",
				"bookthis_text": "Request booking"
			}
		}
	}
}
				
Notes Returns an indexed array of properties, the array key is the property uid
Array contents :
property_name
property_street
property_town
property_postcode
property_region
property_region_id
property_country
property_country_code
property_tel
property_email
images , an array of any images that may have been uploaded. These are the "main" images which are typically seen on the property list pages.
property_details_page
bookthis_link , this is either to the booking form, or to the contact owner page depending on the property's configuration.
bookthis_text , related to the bookthis_link it's contents will vary according to the property's configuration.

Title search for properties in countries
Perform searches and receive back basic property details of results
File search.php
Jomres Plugin api_feature_search
Scope search_get
Method GET
URL Parameters search/countries/:COUNTRIES(:LANGUAGE)
POST/PUT Params none
Sample Call
http://oloughlinshotel.com/jomres/api/search/countries/GB,RO/en-GB
	
Success Response
{
	"data": {
		"search_results": {
			"2": {
				"property_name": "Best West Hotel",
				"property_street": "142 - 146 Harley Street",
				"property_town": "London",
				"property_postcode": "W1G 7LD",
				"property_region": "London, City of",
				"property_region_id": "1154",
				"property_country": "United Kingdom",
				"property_country_code": "GB",
				"property_tel": "34324324324",
				"property_email": "your@email.com",
				"stars": 5,
				"images": [
					[
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/2.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/2.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/2.jpg"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2---Copy.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/74xDBSTTjJdmPG76VpZw-2.JPG",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/74xDBSTTjJdmPG76VpZw-2.JPG"
						},
						{
							"large": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"medium": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/medium\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg",
							"small": "http:\/\/localhost\/quickstart\/jomres\/uploadedimages\/2\/property\/0\/thumbnail\/9s1lvXLlSbCX5l3ZaYWP-hdr-1---Copy.jpg"
						}
					]
				],
				"property_details_page": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=viewproperty&property_uid=2",
				"bookthis_link": "http:\/\/localhost\/quickstart\/index.php?option=com_jomres&Itemid=103&lang=en&task=dobooking&selectedProperty=2",
				"bookthis_text": "Request booking"
			}
		}
	}
}
				
Notes
Countries sent must be in ISO 3166 format ( http:www.iso.org/iso/country_codes )
Returns an indexed array of properties, the array key is the property uid
Array contents :
property_name
property_street
property_town
property_postcode
property_region
property_region_id
property_country
property_country_code
property_tel
property_email
images , an array of any images that may have been uploaded. These are the "main" images which are typically seen on the property list pages.
property_details_page
bookthis_link , this is either to the booking form, or to the contact owner page depending on the property's configuration.
bookthis_text , related to the bookthis_link it's contents will vary according to the property's configuration.

PHP Example

Here you can see a complete example of adding a new property through the API.

CLIENT-ID and CLIENT-SECRET in this example are placeholders, you would need to use your own Client ID and Secret.

$client_id = 'CLIENT-ID';
$client_secret = 'CLIENT-SECRET';
$server = 'http://oloughlinshotel.com/jomres/api/';

$data=array(
    'grant_type' => 'client_credentials' , 
    'client_id' => $client_id , 
    'client_secret' => $client_secret
    );

// First let's get our access token

try 
    {
    $ch = curl_init($server);
    curl_setopt($ch, CURLINFO_HEADER_OUT, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    $token_request=curl_exec ($ch);

    $status = curl_getinfo($ch); 
    curl_close ($ch);
    $response = json_decode($token_request);  

    if (isset($response->access_token))
        {
        $token = $response->access_token;
        // Now that we've got the access token, we can request access to the API
        
        // First we will build the data we'll send to the remote server. 
         $data = array (
            "property_name"        => "API Property",
            "property_email"       => "api_test@test.com",
            "property_street"      => "API Property",
            "property_town"        => "API Property",
            "region"               => 6,
            "property_postcode"    => "API Property",
            "country"              => "GB",
            "property_tel"         => "01234 567890",
            "price"                => "0.00", // Real estate type properties only
            "lat"                  => "51.50068",
            "long"                 => "-0.14317",
            "ptype_id"             => 1,
            "stars"                => 4,
            "superior"             => 0, // 0 no, 1 yes
            "property_description"          => 'Lorem ipsum dolor sit amet...',
            "property_checkin_times"        => 'Lorem ipsum dolor sit amet...',
            "property_area_activities"      => 'Lorem ipsum dolor sit amet...',
            "property_driving_directions"   => 'Lorem ipsum dolor sit amet...',
            "property_airports"             => 'Lorem ipsum dolor sit amet...',
            "property_othertransport"       => 'Lorem ipsum dolor sit amet...',
            "property_policies_disclaimers" => 'Lorem ipsum dolor sit amet...'
            );

        $result = query_remote_server( $server , $token , "POST" , "properties/add/" ,$data  ); 
    
        if ($result['response_code'] == "200"  )
            {
            echo $result['result'];
            }
        elseif ( $result['response_code'] == "204")
            {
            echo "No data to return";
            }
        else
            {
            echo "Response code ".$result['response_code'];
            var_dump($result['result']);
            }
        }
    else
        {
        throw new Exception("Error, json & token not returned ".$token_request);
        }
    }
catch(Exception $e) 
    {
    echo 'Message: ' .$e->getMessage();
    }
    
    
function query_remote_server( $server , $token , $method="GET" , $request ="" , $data=array(3) )
    {
    $ch = curl_init($server.$request);

    switch ( $method )
        {
        case 'POST':
                curl_setopt($ch, CURLOPT_POST, true);
                curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
            break;
        case 'DELETE':
                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
            break;
        case 'PUT':
                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); 
                curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
            break;
        default :
            break;
        }
    
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Authorization: Bearer '.$token,
        'Accept: application/json',
        ));
    
    curl_setopt($ch, CURLINFO_HEADER_OUT, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $result=curl_exec ($ch);
    $errors = curl_error($ch);
    $status = curl_getinfo($ch); 
    $response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    return array (
	"result" => $result ,
	"status" => $status , 
	"errors" => $errors , 
	"response_code" => $response_code 
	);
    }
	

TERMS AND CONDITIONS

By using the API, you agree to this policy. We reserve the right to change this policy at any time without notice, so please check it regularly. Your continued use of the API constitutes acceptance of any changes.

[WEBSITE TERMS AND CONDITIONS]