Im trying to set up a connection to the TestRail API within VBA for Excel but I keep getting this error
"{"error":"Authentication failed: invalid or missing user\/password or session cookie."}"
This is the HTTP request
userPass = user + ":" + pass
Dim TAuth As New MSXML2.XMLHTTP60
userPass = Base64Encode(userPass)
userPass = "Basic " + userPass
With TAuth
.Open "POST", "https://testrail.<server>.com/index.php?/api/v2/get_case/3 HTTP/1.1", False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", userPass
.send
sStatus = .Status
sErg = .responseText
End With
Now I am using the correct username/password variables and the server address is accurate and Base64Encode() is working correctly.
Why am I recieving the Auth failed error?