I was trying to work with Narro API and MEAN stack. I have some text articles. I want to convert my text data to audio. From the requirements, it should use Narro.co for audio conversion. From their documentation, I started with authentication.

Here is the code,

var request = require("request"); var options = { method: 'GET', url: 'https://www.narro.co/api/v1', headers: { authorization: 'Bearer <access_token>' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });

We can generate the clientId and clientSecret from the Narro developer account.

The ClientId(sample) : 921edefq-540y-4g75-be2c-2ade450dc503 The clientSecret(sample): a904efd2-a362-4cc5-80qe-262b24728b47743e244e-e39c-44e7-a479-3f0bt3445245

But it is not working.

I always end up with -

{ errors: [ { message: 'Unauthorized' } ] }

If it is not the right method, Please suggest me the best way to use Narro API with authentication.