从Excel 2016中的API获取数据

Rup*_*pal 2 api rest excel token

我想使用针对Toogl的rest API将一些报告导入Excel。规格:https//github.com/toggl/toggl_api_docs/blob/master/reports.md

我有一个访问令牌要使用。我可以在Excel中轻松地预定义“获取数据”方法来导入数据吗?努力寻找。

nee*_*lsg 6

这应该很容易做到。您可以XmlHttpRequest按照此快速教程在Excel中进行GET请求。每个教程一个简单的请求是:

Dim xmlhttp As New MSXML2.XMLHTTP60, myurl As String
myurl = "http://requestb.in/15oxrjh1" //replace with your URL
xmlhttp.Open "GET", myurl, False
xmlhttp.Send
MsgBox(xmlhttp.responseText)
Run Code Online (Sandbox Code Playgroud)

每个链接的API的身份验证都是通过在请求中传递标头来完成的,该标头类似于:

xmlhttp.setRequestHeader "Authorization", AuthCredentials
Run Code Online (Sandbox Code Playgroud)