cancel
Showing results for 
Search instead for 
Did you mean: 

Error while making call for oauth token api call from classic asp

New Community Member

Error while making call for oauth token api call from classic asp

Hi,

 

I am getting the given below error message while making a call to https://api.sandbox.paypal.com/v1/oauth2/token/ api from classic asp.

msxml6.dll (0x80090326)
The message received was unexpected or badly formatted.

 

I am using given below code: 

 

Set xmlhttp = server.createObject("MSXML2.ServerXMLHTTP.6.0")
url = "https://api.sandbox.paypal.com/v1/oauth2/token/"
xmlhttp.open "POST", url, false

xmlhttp.setRequestHeader "Accept", "application/json"
xmlhttp.setRequestHeader "Accept-Language", "en_US"

xmlhttp.setRequestHeader "Authorization", "Basic "& Base64Encode(client-id&":"&secret-key)

xmlhttp.send "grant_type=client_credentials"

 

Error is produced at 

xmlhttp.send "grant_type=client_credentials"

line of code.

Thanks in advance