Kronos API v2 - including multiple query parameters in a request

1.4k views Asked by At

I am trying to access the Time Entries object via the Kronos API v2.

The documentation says that there are two required Query Parameters: start_date and end_date.

I am able to query the endpoint including one of the parameters at a time but am not able to enter both. And, I find the documentation quite lacking.

The root of the endpoint is:

https://secure.saashr.com/ta/rest/v2/companies/{cid}/time-entries

Here are things I have tried to suffix to the above endpoint:

?start_date=2019-11-01&end_date=2019-12-01
?start_date=2019-11-01|end_date=2019-12-01
?start_date=2019-11-01 end_date=2019-12-01
?start_date=2019-11-01?end_date=2019-12-01
?start_date=2019-11-01:end_date=2019-12-01
?filter=start_date:=:2019-11-01|end_date:=:2019-12-01

I also tried including quotes around the dates.

Everything results in some 400 level error when querying the API. With most of the above suffixes, it recognizes start_date but not the end_date. In this case, the error is:

{'code': 400, 'message': 'Missing required: end_date'}]

Note, above {cid} is replaced with the company's id.

In summary, how should I include two query parameters in the Kronos API?

1

There are 1 answers

0
Андрей Еремеев On

The first option is correct.

https://secure.saashr.com/ta/rest/v2/companies/{cid}/time-entries?start_date=2019-11-01&end_date=2019-12-01 

should work just fine.

Could you provide full URL you set in request?