system
April 26, 2022, 8:20am
1
Migrated from Redmine #872 | Author: Janek Metsallik
Status: Rejected | Priority: High, I’m very impatient | Created: 2022-04-26
Hi!
I have an issue with the getToken API.
Request: HttpRequest(HttpMethod(POST),https://user-api.simplybook.it/login,List (x-company-login: actual-company-here),HttpEntity.Strict(application/json,161 bytes total),HttpProtocol(HTTP/1.1)), {“jsonrpc”:“2.0”,“method”:“getToken”,“params”:{“companyLogin”:“actual-company-here”,“apiKey”:“actual-key-here”},“id”:431}
Randomly depending on a run of the client program returns either:
Success: {“result”:“actual-token-here”,“id”:“431”,“jsonrpc”:“2.0”}
or
Failure: {“error”:{“code”:-32000,“message”:“Company does not exist”,“data”: },“id”:“431”,“jsonrpc”:“2.0”}
The only way I can overcome the failure is to restart the client program; often several tries.
What can be the reason for the failure message?
Thank you very much!
system
April 26, 2022, 8:22am
2
Redmine Admin wrote:
Hi, how many such requests you are doing per second/minute/hour ?
Are you sure there is no problem in our software?
system
April 26, 2022, 8:52am
3
Janek Metsallik wrote:
This is a test program, which I run occasionally and it calls the API once in 20 seconds. Aiming to make a few calls in an hour in the future.
system
April 26, 2022, 9:05am
4
Janek Metsallik wrote:
btw, testing with curl returns success always. It is a Java program, which manages to get the failures.
system
April 26, 2022, 9:17am
5
Redmine Admin wrote:
then it look like a bug in this java program. If you have steps to reproduce the issue then we will be able to check it of course
system
June 15, 2022, 1:11pm
6
Janek Metsallik wrote:
Solved: Problem was rooted in the way of generating the JSON of RPC requests. The Java program used Java Map for the RPC arguments. The Map serialized the entries in random order, which resulted in a seemingly random refusal by the simplybook API server. Fixing the order of JSON elements generation removed the issue.