Getting unauthorized error while converting html to pdf with newly generated token

Getting following error while uploading html file.
{
“requestId”: “3b35fba3-cbfd-40a2-8ddb-e9f6549c5db9”,
“error”: {
“code”: “authorizationError”,
“message”: “Unauthorized”,
“description”: “Operation Failed. The authorization data is incorrect.”,
“dateTime”: “2025-04-10T18:03:07.1366997Z”,
“innerError”: null
}
}

Even for other apis also it is giving the same error.

I am able to generate new token with the token api and using that.
But still it is giving error.

Hi @Deepali11 it can be as it says. Please check this page Local File Conversion – Aspose.HTML Cloud . It has examples in C# and Javascript on how to upload file and run conversion of programatically uploaded file . Also it has a link to the page with guidance for authorisation that might be an issue in your case.

Hi @andrey.gubal

It is intermittent issue on your side.
I have not made any changes in my code.
But it starts failing some times.
right now it is failing in my code and also in postman for same error.

It will be a big problem for us if it keeps on happening intermittently in production environment.
Can you please look into this and fix this.
image.png (277.8 KB)

res: IncomingMessage {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: ‘1.1’,
complete: false,
rawHeaders: [Array],
rawTrailers: [],
joinDuplicateHeaders: undefined,
aborted: true,
upgrade: false,
url: ‘’,
method: null,
statusCode: 401,
statusMessage: ‘Unauthorized’,
client: [TLSSocket],
_consuming: true,
_dumped: false,
req: [Circular *1],
responseUrl: ‘https://api.aspose.cloud/v4.0/html/file?path=/htmlfolder’,
redirects: [],
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 12,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0
},

Hi @andrey.gubal

Can you please check this we are blocked in prod env since yesterday.
Html to pdf conversion is not working at all.

Hi @Deepali11 please check if it works now for you. Also just for future testing there is an alternative way for conversion without uploading a file but just by passing content of the file to conversion api - HTML Content to PDF – Aspose.HTML Cloud

Hi @andrey.gubal

It is working now
What was the issue and will it be frequent.
We have added html to pdf functionality in prod env and facing lot of difficulties due to these errors.

It has happened lot of time in last 2 days.
Please update

@Deepali11 There was some instability with storage where you upload files to. Not directly connected to conversion functionality. As for now it is adjusted and it didn’t happen before with the storage, so we don’t expect it can be back.

Okay
But I was getting unauthorized error in logs.

Is there any difference in latency when we directly pass content to conversion api as write now it is taking approx 3 sec to convert.

Hi @Deepali11 there are several factors. I sent you simplified “sync” version of the api. It means that it includes not only conversion but also status check every second. So it does 3 things: 1) start conversion, 2) Check status until completed, 3) Download result for you. Each step may have own latency. There is also async version where you do those steps yourself. Please check this article https://docs.aspose.cloud/html/convert-html-to-pdf/ It starts from describing “sync” and “async” conversions in API. In general latency more depends on the document, size and complexity, than on the approach in conversion.