The documentation says to obtain oauth token use the following :
curl -v 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"
How to send -u and -d parameters using angular js
var senddata = {
clientId:"Ac8T1BCmIxgxbS5O_ztwejxvNW8Cbr0y1724_2cd8bGl68axHyw_nEdcOBli",
secret:"EAwgXhALV78LnphCPf-R3zs1Dx3nkcIOMc4TftSLh9q5EpgyqdeE19El9Oh0",
grant_type:"client_credentials"
};
Run Code Online (Sandbox Code Playgroud)
Tried passing senddata in http.post(url,senddata)
But I am getting
{"error":"invalid_client","error_description":"Invalid client credentials"}
Run Code Online (Sandbox Code Playgroud)