Good afternoon, I ran into an invalid client problem when trying to parse a document, all the paths are correct, I think the error lies in my access keys
BOOK_READER_CLIENT_ID is the Client Id that is listed in my application and BOOK_READER_CLIENT_SECRET is the Client Secret that is listed there
Here is the piece of code I am trying to run
async readBook(req, res, next) {
try {
const book = await BookModel.findById(req.params.id);
if (!book) {
return res.status(404).json({message: 'Книга не найдена'});
}
const config = new Configuration(
process.env.BOOK_READER_CLIENT_ID,
process.env.BOOK_READER_CLIENT_SECRET
);
const parseApi = new ParseApi(config);
const fb2FilePath = path.join(__dirname, `../uploads/books/${book.fileName}`);
const fileBytes = fs.readFileSync(fb2FilePath);
const parseOptions = new ParseOptions();
parseOptions.filePath = 'document.fb2';
const response = await parseApi.parse(new ParseRequest(parseOptions, fileBytes));
const parsedText = response.text;
res.send(`
<html>
<head>
<title>FB2 Parsing</title>
</head>
<body>
<pre>${parsedText}</pre>
</body>
</html>
`);
} catch (e) {
next(e)
}
}
And here is my answer when a try to send book id
{ message: 'invalid_client', code: 400 }