I have been accessing a website and entering 3 parameters and an Authorization to get access to data. When processed, the data appears in a Responds Window on the website, and I manually select all and copy it to a text file. The Authorization Key is good for a day, and I just need to update the 3 parameters each time when I make a request.
I have to repeat this process for about 50+ times.
I have tried using this sample code from someone on this website over 1 year ago, and I have no errors, and it doesn't seems to connect.
I am perfectly happy trying to get it working by manually entering the authorization key code for now. This takes most of the coding out.
Sub Test()
Dim sUrl As String, sAuth As String
sUrl = "https://cl.nnn.nnnn.com/api/tracking/game/play?gameId=2017121601&gamekey=57444&playId=51"
sAuth = "NGS AKIAIX2XXXXXXXXXPOTKDQ:XXXXXXXXXXXkfmT7enl6I="
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", sUrl, False
.SetRequestHeader "Authorization", "Basic " & sAuth
.Send
Debug.Print .ResponseText
Debug.Print .GetAllResponseHeaders
End With
End Sub