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

devasp
New Community Member

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

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.