What is happening?
Our old legacy SJP server is being phased out, and developers will need to update any existing calls to SJP URLs to the new WebAPI equivalent URLs.
Developers also now need to supply an API key when making requests via the WebAPI.
What do I need to do?
- If your Bookeasy integration code uses PHP and contains the SJP class, replace that with our updated webapi class, which is more or less a drop-in replacement. See our Sample Web API class for the updated code.
- Search your project / solution / code for any instances of sjp.impartmedia.com , or "sjp". Any SJP urls that you find in your code will need to be updated to their WebAPI equivalent URLs. In many cases, the data that comes back will be exactly the same and in the same format. Full details about which URLs need to change are available at http://webapi.bookeasy.com.au/Home/SJPUpgradeHelp but here are some examples:
- change https://sjp.impartmedia.com/be/getOperatorsDetailsShort to https://webapi.bookeasy.com.au/be/getOperatorsDetailsShort
and in doing so, the data that comes back should be exactly the same - change https://sjp.impartmedia.com/be/getOperatorsInformation to https://webapi.bookeasy.com.au/api/getOperatorsInformation
and in doing so, the data that comes back should be exactly the same
- change https://sjp.impartmedia.com/be/getOperatorsDetailsShort to https://webapi.bookeasy.com.au/be/getOperatorsDetailsShort
- Ensure that any code you have that executes GET requests to WebAPI urls includes a HTTP Header of the following format: apiKey: INSERT-API-KEY-HERE
- command line example:
curl -X GET --header 'Accept: application/json' --header 'apiKey: 7edd898e69a14170b469fbf1eea98d41' 'https://webapi.bookeasy.com.au/api/getAccomAttributes?q=4' - PHP example:
$header = array('apiKey: '.$webapiKey);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
- command line example: