I'm working with paypal API and flowing with this document make your firest call.
I got a Status Code 400 (Bad Request) with an error message:
Object {error: "invalid_request", error_description: "grant_type is a required parameter"}
'Authorization': "Basic RU9KMlMtWjZPb05fbGVfS1MxZDc1d3NaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA6RUNsdXNNRVVrOGU5aWhJN1pkVkxGNWNaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA=",
In this case I used the Client-Id and Secret which provided by the example and encoded them in base 64.
$http({
url: 'https://api.sandbox.paypal.com/v1/oauth2/token',
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': "Basic RU9KMlMtWjZPb05fbGVfS1MxZDc1d3NaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA6RUNsdXNNRVVrOGU5aWhJN1pkVkxGNWNaNnkwU0ZkVnNZOTE4M0l2eEZ5WnA=",
'Accept-Language': 'en_US'
},
data: { grant_type: 'client_credentials' }
}).success(function (data, status, headers, config) {
console.log(data)
}).error(function (data, status, headers, config) {
console.log(data)
});