[#305] Error while using example from the main web site

Migrated from Redmine #305 | Author: Bob Marley
Status: Closed | Priority: High, I’m very impatient | Created: 2018-12-13


I am getting

JsonRpcClient->__call(‘getUnitList’, Array) #1 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/simplybookme/JsonRpcClient.php on line 57
howewer I have done all steps that are mantioned on main web site. My final code:

<?php
require_once('JsonRpcClient.php');
require_once('Contract.php');

$loginClient = new JsonRpcClient('https://user-api.simplybook.me' . '/login/');
$token = $loginClient->getToken(SIMPLYBOOKME_LOGIN, SIMPLYBOOKME_API);

$client = new JsonRpcClient('https://user-api.simplybook.me' . '/admin/', array(
    'headers' => array(
                        'X-Company-Login: ' . SIMPLYBOOKME_LOGIN,
                        'X-User-Token: ' . $token
                      )
));

$services = $client->getUnitList();

echo $services;

?>

Contract.php it’s where I define my constant variables

Redmine Admin wrote:

it must be

'X-Token': token

as described here API documentation | SimplyBook.me Online Scheduling

Bob Marley wrote:

Sure! My bad. Shiro d’jakuyu!

Redmine Admin wrote:

:slight_smile:

(Short original content)