system
April 17, 2020, 7:56am
1
Migrated from Redmine #515 | Author: Henry Piassek
Status: Closed | Priority: High, I’m very impatient | Created: 2020-04-17
Hi,
we’re experiencing issues when invoking getToken. Endpoint returns an empty http response with status 200 - OK. We would expect to receive an authentication token OR an exception/error message.
Endpoint Url: https://user-api.enterpriseappointments.com/login
Payload: {“method”:“getToken”,“jsonrpc”:“2.0”,“params”:{“companyLogin”:“COMPANYLOGIN”,“apiKey”:“VALID-API-KEY-FOR-COMPANYLOGIN”}}
The same call used to work a few days ago. Can you tell what we’re doing wrong?
Please let me know if you need additional info. Thanks!
system
April 17, 2020, 7:57am
2
Redmine Admin wrote:
Hi, please provide as RAW HTTP request (with all params and headers) for investigation
system
April 17, 2020, 8:49am
3
Henry Piassek wrote:
Hi, please find raw HTTP request below:
POST https://user-api.enterpriseappointments.com/login HTTP/1.1
Host: user-api.enterpriseappointments.com
Accept: application/json
User-Agent: clickflows.io/1.0,(+https://docs.clickflows.io/api/bot)
Request-Id: |1e9f9491-49d04a4e0a34b480.1.
Content-Type: application/json; charset=utf-8
Content-Length: 159
{“method”:“getToken”,“jsonrpc”:“2.0”,“params”:{“companyLogin”:“versicherungsheld”,“apiKey”:“4355456963aa8368bc234bb96e99d4664faf8db1f0f5f19417276fa48bcc7d93”}}
system
April 17, 2020, 8:53am
4
Dmytro Bondarev wrote:
Hi! Please use non named parameters:
{“method”:“getToken”,“jsonrpc”:“2.0”,“params”:[“versicherungsheld”,“4355456963aa8368bc234bb96e99d4664faf8db1f0f5f19417276fa48bcc7d93”]}
system
April 17, 2020, 9:02am
5
Henry Piassek wrote:
Hi,
thanks for your prompt response.
Changed parameters - same result. Please find raw HTTP request below:
POST https://user-api.enterpriseappointments.com/login HTTP/1.1
Host: user-api.enterpriseappointments.com
Accept: application/json
User-Agent: clickflows.io/1.0,(+https://docs.clickflows.io/api/bot)
Request-Id: |f0a07971-4dc6cf114c30d2d9.1.
Content-Type: application/json; charset=utf-8
Content-Length: 135
{“method”:“getToken”,“jsonrpc”:“2.0”,“params”:[“versicherungsheld”,“4355456963aa8368bc234bb96e99d4664faf8db1f0f5f19417276fa48bcc7d93”]}
Response is 200 - OK with empty body.
system
April 17, 2020, 9:12am
6
Redmine Admin wrote:
Tried it and such code works just fine
<?php
require_once 'JsonRpcClient.php';
try {
$loginClient = new JsonRpcClient('https://user-api.enterpriseappointments.com' . '/login/');
$token = $loginClient->getToken('versicherungsheld', '4355456963aa8368bc234bb96e99d4664faf8db1f0f5f19417276fa48bcc7d93');
$client = new JsonRpcClient('https://user-api.enterpriseappointments.com' . '/', array(
'headers' => array(
'X-Company-Login: ' . 'versicherungsheld',
'X-Token: ' . $token
)
));
} catch (Exception $e) {
$serviceEnabled = false;
var_dump($e);
exit();
}
$res = $client->getEventList();
var_dump($res);
?>
with result
object(stdClass)#4 (1) {
["1"]=>
object(stdClass)#5 (19) {
["id"]=>
string(1) "1"
["name"]=>
string(18) "Beratungsgesprцєch"
["duration"]=>
string(2) "15"
["buffertime_before"]=>
string(1) "0"
["buffertime_after"]=>
string(1) "0"
["hide_duration"]=>
string(1) "1"
["description"]=>
string(0) ""
["is_public"]=>
string(1) "1"
["is_active"]=>
string(1) "1"
["position"]=>
string(1) "1"
["file_id"]=>
NULL
["seo_url"]=>
string(17) "versicherungsheld"
["is_recurring"]=>
string(1) "0"
["picture"]=>
NULL
["picture_sub_path"]=>
NULL
["is_visible"]=>
string(1) "1"
["picture_path"]=>
NULL
["additional_fields"]=>
array(0) {
}
["classes_plugin_info"]=>
object(stdClass)#6 (2) {
["unit_group_binded_in_class"]=>
NULL
["unit_groups_binded_in_classes"]=>
array(0) {
}
}
}
}
system
April 17, 2020, 9:51am
7
Henry Piassek wrote:
Hi, just FYI: It was due to the absence of id property in request base object. Any kind of error information pointing that out would have been very useful though. Thank you once more for looking into it!