system
March 29, 2018, 12:05pm
1
Migrated from Redmine #135 | Author: umair meon
Status: Closed | Priority: High, I’m very impatient | Created: 2018-03-29
i have problem to create booking with api here is my code
$eventId=1;
$unitId=1;
$clientData = array(
'name' => 'Umair',
'email' => 'memumair939@gmail.com',
'phone' => '+92 3313542329'
);
$startDate="2018-04-1";
$endDate="2018-04-2";
$startTime="09:00:00";
$endTime="05:00:00";
$booknew = $client->book($eventId, $unitId, $addClient, $startDate, $startTime, $endDate, $endTime,"UTC -5:00 / -4:00");
and show this error
Selected time start is not available
i which step iam wrong please help me
system
March 29, 2018, 12:11pm
2
Dmytro Bondarev wrote:
“UTC -5:00 / -4:00” - is wrong parameter you should pass offset between company timezone and client timezone in seconds.
$clientData - wrong parameter you should pass client id.
“2018-04-1” - wrong date format.
please fix this issues and if it does not solve problem, please provide us full http request.
system
March 29, 2018, 12:31pm
3
umair meon wrote:
I am follow this date format
$startDate a date string in format ‘Y-m-d’*
system
March 29, 2018, 12:53pm
5
umair meon wrote:
face same issue with changing this
$startDate=“2018-04-01”;
$endDate=“2018-04-02”;
$startTime=“9:00:00”;
$endTime=“10:00:00”;
Message: Request error: Selected time start is not available
system
March 29, 2018, 12:53pm
6
Dmytro Bondarev wrote:
please provide us full http request.
system
March 29, 2018, 12:54pm
7
umair meon wrote:
$startDate=“2018-04-01”;
$endDate=“2018-04-02”;
$startTime=“9:00:00”;
$endTime=“10:00:00”;
$addClient=$client->addClient($clientData);
$booknew = $client->book($eventId, $unitId, $addClient, $startDate, $startTime, $endDate, $endTime,“60”);
system
March 29, 2018, 1:00pm
9
Dmytro Bondarev wrote:
it is not http request. it is your code and we do not know how it works inside.
that is why we need request, that you send to our server. it should like:
@POST /login HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json
{“jsonrpc”:“2.0”,“method”:“getUserToken”,“params”:[“…”,“…”,“…”],“id”:1}@
system
March 29, 2018, 1:05pm
10
umair meon wrote:
$this->load->library(“JsonRpcClient”);
$loginClient = new JsonRpcClient(‘http://user-api.simplybook.me ’ . ‘/login/’);
$token = $loginClient->getUserToken('hyderswf', 'admin', 'xxxxxx');
echo $token;
if($token!=""){
$client = new JsonRpcClient('http://user-api.simplybook.me' . '/admin/', array(
‘headers’ => array(
'X-Company-Login: ’ .‘hyderswf’,
'X-User-Token: ’ . $token
)
));
system
March 29, 2018, 1:06pm
11
Dmytro Bondarev wrote:
Please look at example. It is your code. We do not know how it works inside.
system
March 29, 2018, 1:11pm
12
umair meon wrote:
I am follow this docs link
system
March 29, 2018, 1:16pm
13
Dmytro Bondarev wrote:
If you did everything right, but still get this error, check that this time available to book.
system
March 29, 2018, 1:32pm
14
umair meon wrote:
In my time setting sat 9 to 6 i have written in start time 9 but show not available
like that
$startDate=“2018-04-02”;
$endDate=“2018-04-03”;
$startTime=“09:00:00”;
$endTime=“10:00:00”;
system
March 29, 2018, 1:35pm
15
Dmytro Bondarev wrote:
Please check if this time available to book.
system
March 29, 2018, 1:39pm
16
umair meon wrote:
Yes available from 9 am to 6 pm
system
March 29, 2018, 1:56pm
17
Dmytro Bondarev wrote:
Are you able to book this time from admin side?
I see that the start date and end date is different. Why?
system
March 29, 2018, 2:20pm
18
umair meon wrote:
i am already use this code few month age run perfectly but he should give me error
system
March 29, 2018, 2:22pm
19
umair meon wrote:
$startDate=“2018-04-02”;
$endDate=“2018-04-02”;
$startTime=“12:00:00”;
$endTime=“06:00:00”;
same date but issue is still
system
March 29, 2018, 2:23pm
20
Dmytro Bondarev wrote:
Why did you set 06:00:00?
Is it possible that end date less than start date?