简体   繁体   English

Kronos API v2 - 在一个请求中包含多个查询参数

[英]Kronos API v2 - including multiple query parameters in a request

I am trying to access the Time Entries object via the Kronos API v2.我正在尝试通过 Kronos API v2 访问时间条目对象。

The documentation says that there are two required Query Parameters: start_date and end_date .文档说有两个必需的查询参数: start_dateend_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.查询 API 时,一切都会导致一些 400 级错误。 With most of the above suffixes, it recognizes start_date but not the end_date .使用上述大多数后缀,它识别start_date但不识别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.注意,上面的{cid}替换为公司的 id。

In summary, how should I include two query parameters in the Kronos API?总之,我应该如何在 Kronos API 中包含两个查询参数?

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?你能提供你在请求中设置的完整 URL 吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM