Getting authorization error on Convert to PDF

URGENT!

The cloud is down!

noUserContext {“message”:“Authorization failed”,“path”:[“_entities”,0,“itineraryPdf”],“locations”:[{“line”:1,“column”:131}],“extensions”:{},“stackTrace”:“Error: Authorization failed\n at /node_modules/asposewordscloud/dist/internal/requestHelper.js:80:31\n at Generator.throw ()\n at rejected (/node_modules/asposewordscloud/dist/internal/requestHelper.js:32:65)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)”}

@itappdev

It seems you are encountering an “Authorization failed” error while trying to convert a document to PDF using the Aspose API. This issue typically arises due to incorrect or missing authentication credentials.

Here are some steps you can take to troubleshoot and resolve this issue:

  1. Check API Key and App SID: Ensure that you are using the correct API key and App SID. These credentials are essential for authenticating your requests. You can find them in your Aspose Cloud dashboard.

  2. Verify Token Expiration: If you are using a token-based authentication, make sure that your token has not expired. If it has, you will need to generate a new token.

  3. Review API Endpoint: Ensure that you are sending your request to the correct API endpoint. Sometimes, using an incorrect endpoint can lead to authorization errors.

  4. Inspect Request Format: Double-check the format of your request. Ensure that all required parameters are included and correctly formatted.

  5. Check Account Status: If your account has any restrictions or has been suspended, you may face authorization issues. Verify your account status in the Aspose Cloud dashboard.

  6. Test with Sample Code: You can refer to sample code for converting documents to PDF. For example, in C#, you can use the following code snippet:

    var request = new ConvertDocumentRequest(
        document: File.OpenRead("path/to/your/document.docx"),
        format: "pdf"
    );
    var response = await wordsApi.ConvertDocument(request);
    

    Make sure to replace "path/to/your/document.docx" with the actual path to your document.

If you continue to experience issues after checking these points, consider reaching out to Aspose support for further assistance.

Sources:
[1]: ConvertDocumentTests.cs

Sorry for the inconvenience, admin team said that issue was fixed.