https://developers.openapi.it/ and counter
I'm on vba.
I need to set my get statement, for https://developers.openapi.it/services/oauth#tag/counters
i just have email of my account and apykey
This is my code for all my get statement in general:
Private Sub RestExample1()
Dim APICall As String
Dim myXML As New MSXML2.DOMDocument60
APICall = "https://oauth.openapi.it/counters/total/"
.Open "GET", APICall, False
.setRequestHeader "Authorization", "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxx"
how to set the this:
for test i can send my account id and password
Solved! Go to Solution.
Hi @sal21 ,
Looks like your API requires HTTP Basic authentication. It's a base64 encoded string, made up of your username + colon (:) + password, eg:
User = "josh"
Password = "pa$$"
String = "josh:pa$$"
String after base64 encoding: "am9zaDpwYSQk"
Then the full header is:
"Authorization: Basic am9zaDpwYSQk"
I don't know VBA, but a Google showed this snippet, which may work for you...
user = "someusername" password = "somepassword" xmlhttp.setRequestHeader "Authorization", "Basic " + Base64Encode(user + ":" + password)
See: https://swagger.io/docs/specification/authentication/basic-authentication/ to learn about Basic Auth.