I'm attempting to access the online API of http://api.football-data.org/index using Excel VBA to eventually populate an excel sheet with a click of a button. Currently I have:
Sub apiTest()
Dim oRequest As Object
Set oRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
oRequest.Open "GET", "http://api.football-data.org/v1/competitions/354/fixtures/?matchday=22", False
oRequest.SetRequestHeader "X-Auth-Token", "replace this with my api token"
oRequest.Send
MsgBox oRequest.ResponseText
End Sub
According to the site, all I need to do is to add the X-Auth-Token field to the header and it should work. However, when I try to run this the response body says "The resource you are looking for is restricted". Am I using WinHTTPRequest improperly?