I am trying to implement the paypal REST API for an application in ColdFusion. I have my application set up in paypal so I have the client_id & secret key's.
https://developer.paypal.com/webapps/developer/docs/integration/direct/make-your-first-call/
This URL shows an example curl call that I am trying to reproduce in CF:
curl https://api.sandbox.paypal.com/v1/oauth2/token \
-H "Accept: application/json" \
-H "Accept-Language: en_US" \
-u "EOJ2S-Z6OoN_le_KS1d75wsZ6y0SFdVsY9183IvxFyZp:EClusMEUk8e9ihI7ZdVLF5cZ6y0SFdVsY9183IvxFyZp" \
-d "grant_type=client_credentials"
here is my CF call (modified the keys a little for my test account)
<cfhttp method="post" url="https://api.sandbox.paypal.com/v1/oauth2/token" result="test">
<cfhttpparam type="header" name="authorization" value="ASfK_BCZ54849na-kMSKvrKEk4WNDkoIikQlTfsI3nS-ghY1VTzH5q2pU:EC-7qhACEQ7XGjo2dU4gFPJDH3Et0KeMx0Z5Xmbf9PnhPE5diq-CO" >
<cfhttpparam type="header" name="content-type" value="application/x-www-form-urlencoded" >
<cfhttpparam type="formfield" name="grant_type" value="client_credentials" >
The response I receive is "invalid_client" - "invalid client credentials". The docs state that the auhorization should be passed in the form "client_id:secret". I have played around changing the names of my field's, tried passing it in the header and tried passing it as a formfield, all to no avail. Best I can tell, paypal does not require a signature method and states it uses basic http auth.
Can anyone see what I am missing here?