I have the following curl code which I am trying to convert to VBA for excel
Endpoint : http://api.datadoctorit.com/email-validate
Request Type : POST
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen( $data ),
'X-Auth-Token: XXXXXXX'
) );
Here is the code that I came up with:
Dim strURL As String
Dim hReq As WinHttpRequest: Set hReq = CreateObject("WinHttp.WinHttpRequest.5.1")
Dim strResp As String
Dim Token As String
Token = mytoken
strURL = "http://api.datadoctorit.com/email-validate"
hReq.Open "POST", strURL, False
hReq.SetRequestHeader "Content-Type", "application/json"
hReq.Send "X-Auth-Token" & ":" & token
strResp = hReq.ResponseText
MsgBox strResp
I keep getting this error:
" {""error"":""You need to sign in or sign up before continuing.""}"