system
October 19, 2017, 2:23pm
1
Migrated from Redmine #57 | Author: umair meon
Status: Rejected | Priority: High, I’m very impatient | Created: 2017-10-19
i was try this code for create booking but show error “Selected date start is not available”
Here is my code
$eventId=1;
$unitId=1;
$clientData=array(‘name’=>‘umair’,‘email’=>‘test@gmail.com’,‘phone’=>‘+38099999999’);
$data=“2017-10-20”;
$time=“10:00:00”;
$book = $client->book ($eventId, $unitId, $date, $time, $clientData);
system
October 19, 2017, 2:27pm
2
Dmytro Bondarev wrote:
You can get this error because selected date/time not available to book.
To check this we need more information.
Please provide company login.
system
October 19, 2017, 2:34pm
3
umair meon wrote:
ok now i have got this error
“Client with given id not found”
system
October 19, 2017, 2:35pm
4
Dmytro Bondarev wrote:
Ok, probably client with this id does not exists.
system
October 19, 2017, 2:37pm
5
umair meon wrote:
so tell me how can i solve this ?
system
October 19, 2017, 2:39pm
6
Redmine Admin wrote:
you need to use existing id of existing client or add client first and then use his id
system
October 19, 2017, 2:42pm
7
umair meon wrote:
please check my code and than tell me which part i was changed?
system
October 19, 2017, 2:43pm
8
umair meon wrote:
i already use real email in clientdata
system
October 19, 2017, 3:07pm
9
Dmytro Bondarev wrote:
We are not able to help you without full information.
system
October 19, 2017, 3:38pm
10
umair meon wrote:
i am use this function
book ($eventId, $unitId, $date, $time, $clientData, , $count, $batchId, $recurringData)
in this function there is no any client id needed so why i got this error
"An uncaught Exception was encountered
Type: Exception
Message: Request error: Client with given id not found"
system
October 19, 2017, 3:39pm
11
Dmytro Bondarev wrote:
As i said it is impossible to help you without information.
Please provide full request to API.
system
October 20, 2017, 7:02am
12
umair meon wrote:
which type of information you need?
system
October 20, 2017, 7:02am
13
Dmytro Bondarev wrote:
Please provide full request to API.
system
October 20, 2017, 7:21am
14
umair meon wrote:
$this->load->library(“JsonRpcClient”);
$loginClient = new JsonRpcClient(‘http://user-api.simplybook.me ’ . ‘/login/’);
$token = $loginClient->getUserToken(‘fashion’, ‘admin’, ‘xxxxx’);
if($token!=“”){
$client = new JsonRpcClient(‘http://user-api.simplybook.me ’ . ‘/admin/’, array(
‘headers’ => array(
'X-Company-Login: ’ .‘fashion’,
'X-User-Token: ’ . $token
)
));
i used this request
system
October 20, 2017, 7:24am
15
Dmytro Bondarev wrote:
It is code to get token.
We need full HTTP request to API to book with all data.
system
October 20, 2017, 7:30am
16
umair meon wrote:
$this->load->library(“JsonRpcClient”);
$loginClient = new JsonRpcClient(‘http://user-api.simplybook.me ’ . ‘/login/’);
$token = $loginClient->getUserToken(‘fashion’, ‘admin’, ‘xxxx’);
$client = new JsonRpcClient(‘http://user-api.simplybook.me ’ . ‘/admin/’, array(
‘headers’ => array(
'X-Company-Login: ’ .‘fashion’,
'X-User-Token: ’ . $token
)
));
$clientData = array(
‘name’ => ‘Abdul Qadir’,
‘email’ => 'un489@hotmail.com ',
‘phone’ => ‘+92 3313542329’
);
$eventId=1;
$unitId=1;
$date=“2017-10-21”;
$time=“10:00:00”;
$book = $client->book($eventId, $unitId, $date, $time, $clientData);
system
October 20, 2017, 7:36am
18
Dmytro Bondarev wrote:
Please check the reference API documentation | SimplyBook.me Online Scheduling
You are using wrong parameters for this method.