首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Clockify Api中使用“生成摘要报告”

无法在Clockify Api中使用“生成摘要报告”
EN

Stack Overflow用户
提问于 2018-11-17 09:45:08
回答 2查看 557关注 0票数 1

我一直在尝试使用Clockify api生成报告,并且一直在跟踪official documentation。首先,我尝试使用自己的数据,但经过反复试验,我甚至开始尝试默认数据。也不走运。根据文档,这应该是可行的:

代码语言:javascript
复制
   curl -X POST -H 'X-Api-Key: {apikey}' -H 'content-type: application/json' -d '{
    "startDate": "2018-06-18T00:00:00.000Z",
    "endDate": "2018-06-24T23:59:59.999Z",
    "me": "false",
    "userGroupIds": "[]",
    "userIds": "[]",
    "projectIds": "[]",
    "clientIds": "[]",
    "taskIds": "[]",
    "tagIds": "[]",
    "billable": "BOTH",
    "includeTimeEntries": "true",
    "zoomLevel": "week",
    "description": "",
    "archived": "Active",
    "roundingOn": "false"
    }' -v -i 
 'https://api.clockify.me/api/workspaces/{workspace}/reports/summary/'

但事实并非如此。答案将是:

代码语言:javascript
复制
{
  "message": "Could not read document: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: java.io.PushbackInputStream@4a679880; line: 5, column: 19] (through reference chain: com.clockify.adapter.http.summaryReport.GetSummaryReportRequest[\"userGroupIds\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: java.io.PushbackInputStream@4a679880; line: 5, column: 19] (through reference chain: com.clockify.adapter.http.summaryReport.GetSummaryReportRequest[\"userGroupIds\"])",
  "code": 3002
}

我不知道我做错了什么,所以任何帮助都会非常感谢。

EN

回答 2

Stack Overflow用户

发布于 2018-12-13 01:02:54

问题出在他们的默认数据上--数组不应该用"“括起来,所以正确的数据应该是:

代码语言:javascript
复制
{
    "startDate": "2018-06-18T00:00:00.000Z",
    "endDate": "2018-06-24T23:59:59.999Z",
    "me": "false",
    "userGroupIds": [],
    "userIds": [],
    "projectIds": [],
    "clientIds": [],
    "taskIds": [],
    "tagIds": [],
    "billable": "BOTH",
    "includeTimeEntries": "true",
    "zoomLevel": "week",
    "description": "",
    "archived": "Active",
    "roundingOn": "false"
}

这对我来说很有效,但是现在我得到了一个"No enum constant com.clockify.domain.model.DashboardSelection.false“error (代码3002)”,我还没能弄清楚。我使用的JSON昨天还能用,但今天就不行了……所以不确定到底是怎么回事。

编辑:删除"me“字段,它可以防止我收到的错误。如果您只想要自己的条目,只需在userIds字段中输入您的用户ID即可。

票数 0
EN

Stack Overflow用户

发布于 2020-02-23 02:51:16

这对我来说很有效:

代码语言:javascript
复制
data = {
    "startDate":f"{start}T00:00:00.000Z",
    "endDate": f"{end}T23:59:59.999Z",
    "me": "false",
    "userGroupIds": [],
    "userIds": [],
    "projectIds": [],
    "clientIds": [],
    "taskIds": [],
    "tagIds": [],
    "billable": "BOTH",
    "includeTimeEntries": True,
    "zoomLevel": "month",
    "description": "",
    "archived": "Active",
    "roundingOn": False 
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53347463

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档