Need Node js code snippet to get data from Assembla

62 views Asked by At

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.

1

There are 1 answers

1
Mohammad Raheem On
 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
    });