[#43] how to pass client_login or client_id to authenticate client.

Migrated from Redmine #43 | Author: alok soni
Status: Closed | Priority: High, I’m very impatient | Created: 2017-09-07


my login page is

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 = (“”);
var password = (“”);

var services = client.getClientInfoByLoginPassword (login, password);
console.log(services);

Vitaliy Kordiak wrote:

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.

alok soni wrote:

how to find client_sign

Vitaliy Kordiak wrote:

Client sign is md5($clientId . $clientHash . $secretKey)
Client id you are getting when you are reating new client.

alok soni wrote:

in Client sign is md5($clientId . $clientHash . $secretKey)

my i know about clientHash and secretKey how to fetch that

Vitaliy Kordiak wrote:

Vitaliy Kordiak wrote:

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.

Vitaliy Kordiak wrote:

[[Company public service methods - Company public service methods - SimplyBook.me]]
please read this documentation

alok soni wrote:

you have any example of login page first login client with email and password no need to send Client sign and Client id then booking page come this page i want to after login Simplybook.me API example and make booking

Vitaliy Kordiak wrote:

no, we do not have other examples.
we consider that there is enough documentation for this.

I want to remind you, if you want to integrate booking on your site, we also have special widgets for this
More details: Settings → Booking widget for your own website

Example widget code:


            

Dmytro Bondarev wrote:

Then just login client before using getClientInfo method or getClientInfoByLoginPassword.
The API is not able to save state, so you have to pass client_id, client_hash to book method also.