Free Support Forum - aspose.cloud

Api using nodejs getting Below Error

Response from ApI
key is correct but I get below response
{ message: ‘No HTTP resource was found that matches the request URI ‘http://api .aspose.cloud/v1.1/test.doc/saveAs?AppSid=41cbf44e-2bb8-4bd4-ab3a-58e5b569ddbd’ .’, code: 404 }

My Usage logs

Error: Error while loading file ‘test.doc’ from storage: AmazonS3 exception: Error ‘The specified key does not exist.’, Bucket ‘afc-filestorage’, FilePath ‘64628/85c10523-b990-402f-893c-bae45d969a8e/test.doc’ => Error while loading file ‘test.doc’ from storage: AmazonS3 exception: Error ‘The specified key does not exist.’, Bucket ‘afc-filestorage’, FilePath ‘64628/85c10523-b990-402f-893c-bae45d969a8e/test.doc’ => AmazonS3 exception: Error ‘The specified key does not exist.’, Bucket ‘afc-filestorage’, FilePath ‘64628/85c10523-b990-402f-893c-bae45d969a8e/test.doc’. Method: Save the document as… Parameters: name ‘test.doc’,saveOptionsData ‘Aspose.Words.Cloud.DTO.Saving.PdfSaveOptionsData’,folder ‘’


This Topic is created by sohail.aspose using the Email to Topic plugin.

@vinita.bhandari

Thank you for contacting Aspose Support.

http://api .aspose.cloud/v1.1/test.doc/saveAs?AppSid=41cbf44e-2bb8-4bd4-ab3a-58e5b569ddbd

This URL is incorrect. Please ensure you are using our maintained Aspose.Words Node.js SDK. The following command installs Aspose.Words-Cloud via NPM

npm install asposewordscloud --save

Please contact us if there are any problems.

@mateensajjad

Thank you for replying

I already installed asposewordscloud using mentioned command

npm install asposewordscloud --save

If I use above command so I don’t have to use SDK?

@vinita123

If I use above command so I don’t have to use SDK?

Yes. npm install asposewordscloud --save is a convenient way to integrate SDK into your project.

I am using npm install asposewordscloud --save

Still getting below error

Response from ApI
key is correct but I get below response
{ message: ‘No HTTP resource was found that matches the request URI ‘http://api .aspose.cloud/v1.1/test.doc/saveAs?AppSid=41cbf44e-2bb8-4bd4-ab3a-58e5b569ddbd’ .’, code: 404 }

My Usage logs

Error: Error while loading file ‘test.doc’ from storage: AmazonS3 exception: Error ‘The specified key does not exist.’, Bucket ‘afc-filestorage’, FilePath ‘64628/85c10523-b990-402f-893c-bae45d969a8e/test.doc’ => Error while loading file ‘test.doc’ from storage: AmazonS3 exception: Error ‘The specified key does not exist.’, Bucket ‘afc-filestorage’, FilePath ‘64628/85c10523-b990-402f-893c-bae45d969a8e/test.doc’ => AmazonS3 exception: Error ‘The specified key does not exist.’, Bucket ‘afc-filestorage’, FilePath ‘64628/85c10523-b990-402f-893c-bae45d969a8e/test.doc’. Method: Save the document as… Parameters: name ‘test.doc’,saveOptionsData ‘Aspose.Words.Cloud.DTO.Saving.PdfSaveOptionsData’,folder ‘’

@vinita123

I am assuming you are using Aspose Cloud Storage and are not using any third party storage.

Please consider following code:

const { WordsApi, PostDocumentSaveAsRequest, SaveOptionsData } = require("asposewordscloud");

wordsApi = new WordsApi(AppSid, AppKey);

var request = new PostDocumentSaveAsRequest({
    name: "fileStoredInCloud.doc",
    saveOptionsData: new SaveOptionsData(
        {
            saveFormat: "pdf",
            fileName: "destination.pdf"
        })
});

wordsApi.postDocumentSaveAs(request).then((result) => {    
    console.log(result.body.code);    
}).catch(function(err) {
    // Deal with an error
    console.log(err);
}); 

PostDocumentSaveAsRequest API assumes that input file fileStoredInCloud.doc exist at Aspose Cloud Storage.

You are getting following error because input file test.doc does not exist at Aspose Cloud Storage.

{ message: 'Error while loading file \'test.doc\' from storage: AmazonS3 exception: Error \'The specified key does not exist.\', Bucket \'afc-filestorage\', FilePath \'9971/24d10606-81da-4fc2-8faf-c463c77e9539/test.doc\'',
  code: 400 }

First, upload the file using Aspose Cloud UI or using Aspose.Storage File Upload API to Aspose Cloud Storage.

Please use PUT /words/convert API if you want to send input file in request body and wants API to return converted file in API response.

Please let us know if you need any further information.