Trying to get data from Assembla using node js rest API call. I am not sure how to authenticate using the Bearer token and get the JSON output. is there any way we can use HTTP request and get the output as expected. Please help.
Asked
Active
Viewed 58 times
1 Answers
0
Put your access token in the request to authenticate api and you will get the json data
request({
method: 'GET',
uri: 'https://api.assembla.com/v1/spaces',
auth: {
bearer: access_token
}
}, function (error, response, body) {
//this contains a json object
});

Mohammad Raheem
- 1,131
- 1
- 13
- 23
-
tried but getting below error buffer.js:262 throw new TypeError(kFromErrorMsg); TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object. – Deepan Chakravarthy Aug 29 '18 at 17:22