I am getting “Authorization failed” error while sending request for conversion from word to html.
function invokeApiMethodInternal(requestOptions, confguration, notApplyAuthToRequest) {
return __awaiter(this, void 0, void 0, function* () {
requestDebug(request, (type, data, r) => {
if (r.writeDebugToConsole) {
const toLog = {};
toLog[type] = data;
// tslint:disable-next-line:no-console
console.log(JSON.stringify(toLog, undefined, 2));
}
});
if (!requestOptions.headers) {
requestOptions.headers = {};
}
requestOptions.timeout = 1000 * confguration.timeout;
requestOptions.headers["x-aspose-client"] = "nodejs sdk";
requestOptions.headers["x-aspose-client-version"] = "22.10";
requestOptions.uri = encodeURI(requestOptions.uri.toString());
const auth = confguration.authentication;
if (!notApplyAuthToRequest) {
try {
yield auth.applyToRequest(requestOptions, confguration);
}
catch (error) {
throw new Error("Authorization failed");
}
}