I am able to connect to an api and collect data if it does not require authentication via xmlhttprequest within VBA module of an MS Access Database
However, where I am struggling is when I need to provide a consumer key and consumer secret as authentication is oAuth 1.0a. I do not know how to configure the setRequestHeader as most examples I have been able to find use basic authentication with username / password combinations. I am also not clear if that is the correct place to be trying to set the key and secret?
Any suggestions are most welcome
Code:
sub ReadDataViaAPI()
Dim reader As New XMLHTTP60
reader.Open "GET", "[URL unfurl="true"]https://api.github.com/orgs/dotnet/repos"[/URL]
reader.setRequestHeader "Accept", "application/json"
reader.send
Do Until reader.ReadyState = 4
DoEvents
Loop
If reader.status = 200 Then
[indent][/indent]'do something here with exposed records(s)
End If
end sub
However, where I am struggling is when I need to provide a consumer key and consumer secret as authentication is oAuth 1.0a. I do not know how to configure the setRequestHeader as most examples I have been able to find use basic authentication with username / password combinations. I am also not clear if that is the correct place to be trying to set the key and secret?
Code:
sub ReadDataViaAPI()
Dim reader As New XMLHTTP60
reader.Open "GET", "[URL unfurl="true"]https://api.github.com/orgs/dotnet/repos"[/URL]
reader.setRequestHeader "Accept", "application/json"
reader.setRequestHeader "Authorization", 'how do I configure this element?
reader.send
Do Until reader.ReadyState = 4
DoEvents
Loop
If reader.status = 200 Then
[indent][/indent]'do something here with exposed records(s)
End If
end sub
Any suggestions are most welcome