Hi! Please just pass @client_id@ and @client_sign@ or @client_login@ and @client_password@ information as clientData.
Do not pass any other client data.
Make sure that you already have this client.
I do not see that you pass client_login or client_id to authenticate client.
If you do not need client login feature please just turn it off and this code will work for you.
If you need this feature then please create client get client_id and client_hash and pass required information for client login (see above).
var loginClient = new JSONRpcClient({
‘url’: ‘//user-api.simplybook.me/login’,
‘onerror’: function (error) {
alert(error);
}
});
var token = loginClient.getToken(‘narendra’, ‘5501cb0d7052b9d95ba78559ed41cd65c7bc0d3a51e21e259cbe092142f7537e’);
var loginClient = new JSONRpcClient({
‘url’: ‘//user-api.simplybook.me/login’,
‘onerror’: function (error) {
alert(error);
}
});
var token = loginClient.getToken(‘narendra’, ‘5501cb0d7052b9d95ba78559ed41cd65c7bc0d3a51e21e259cbe092142f7537e’);
var client = new JSONRpcClient({
‘url’: ‘https://user-api.simplybook.me/’,
‘headers’: {
‘X-Company-Login’: ‘narendra’,
‘X-Token’: token
},
‘onerror’: function (error) {
alert(error);
window.location = “login.php”;
}
});
window.location = “Home.php”;
var login = (“<?php echo $_POST['username']; ?>”);
var password = (“<?php echo $_POST['pass']; ?>”);
var services = client.getClientInfoByLoginPassword (login, password);
console.log(services);
here is how can input client id and client hash for making booking and see my old booking
Hi! Please just pass client_id and client_sign or client_login and client_password information as clientData.
Do not pass any other client data.
Make sure that you already have this client.