我试图用Excel中的VBA从一个报表中获取数据。
我收到以下错误消息:
{“数据”:{“消息”:“请求方法'GET‘不受支持”,“代码”:3000}
这是我的密码:
Dim strUrl As String
strUrl = "https://api.clockify.me/api/workspaces/{workspaceId}/reports/{reportId}/"
Set hReq = CreateObject("MSXML2.XMLHTTP")
With hReq
.Open "GET", strUrl, False
.SetRequestHeader "X-api-key", "{api-key}"
.SetRequestHeader "content-type", "application/json"
.Send
End With
'wrap the response in a JSON root tag "data" to count returned objects
Dim response As String
response = "{""data"":" & hReq.ResponseText & "}"
Debug.Print response
为什么这里不允许GET方法?
发布于 2018-12-12 12:15:48
查看文档(docs/#tag-Report)..。我没有看到"GET /workspaces/{workspaceId}/reports/{reportId}/“API调用-关闭是GET /reports/{reportId}或PUT/DELETE /workspaces/{workspaceId}/reports/{reportId},这将解释为什么要获得"GET不允许”,因为您只能将或删除到/workspaces/{workspaceId}/reports/{reportId}/终结点。我猜你想要"GET /reports/{reportId}“。试试看。
我猜这个GET / reports /{reportId}不在工作空间下面,因为报告可以公开.但那只是猜测。
https://stackoverflow.com/questions/53126192
复制相似问题