Providing authentication info via msxml2.ServerXMLHTTP

Solution 1:

Try

http.Open "GET", vurl, False, "yourusername", "yourpassword"

I don't know if this works on justgiving, but it does with the Bing API

Also, this question may be relevant XmlHttp Request Basic Authentication Issue

Edit - using Response.ContentType and Msxml2.ServerXMLHTTP.6.0

vurl = "https://api.justgiving.com/API_KEY/v1/account"
Set http = Server.CreateObject("msxml2.ServerXMLHTTP.6.0")
http.Open "GET", vurl, False, "username", "pwd"
http.setTimeouts 5000, 5000, 10000, 10000 'ms - resolve, connect, send, receive'
http.setRequestHeader "Authorization", "Basic MY_AUTH_STRING"
http.Send

Response.ContentType = "application/xml"    

Set items = http.responseXML.getElementsByTagName("account")

etc

Solution 2:

Apologies for adding to an old post. However this has consistently come up when Googling for help on MailChimp API V3.0 and VBA.

This is the fix I used:

ret = objhttp.Open("POST", sURL, False) 
objhttp.setRequestHeader "Content-Type", "application/json"
objhttp.setRequestHeader "Accept", "application/json"

'V3 API uses HTTP Basic Authorisation inside an https: wrapper.
'The standard windows method does not seem to work however the 
'following hack does.
'In summary the user name and APIkey are seperated with a Colon: and 
'base 64 encoded and added to a Http RequestHeader


objhttp.setRequestHeader "Authorization", "Basic " & Base64Encode(APIUser & ":" & ApiKey)

objhttp.send (sJson)

You will need to code the Base64Encode function. I grabbed some code from http://pastie.org/1192157 (Ex StackOverflow) and pasted it into a VBA Module.

Hope it helps.