AmazonS3 Storage exception

I am not using amazon s3 but grtting below error. I use internal storage. Please advise

AmazonS3 Storage exception: Error making request with Error Code Forbidden and Http Status Code Forbidden. No further error information was returned by the service.

Trying to compare to pdfs code:

import { CompareApi, FileInfo, ComparisonOptions, ComparisonsRequest } from “groupdocs-comparison-cloud”;

async function main(): Promise {

// initialize api
const compareApi = CompareApi.fromKeys("myclientid", "mysecret");

// source file
const source = new FileInfo();
source.filePath = ".\\admitnote1.pdf";

// target file
const target = new FileInfo();
target.filePath = ".\\Admitnote2.pdf";

// define compare options
const options = new ComparisonOptions();
options.sourceFile = source;
options.targetFiles = [target];
options.outputPath = ".\\result.pdf";




// create comparison request
const request = new ComparisonsRequest(options);

//console.log(JSON.stringify(request));


// compare
const response = await compareApi.comparisons(request).catch((ex)=>{
    console.log(ex.message);
});
console.log("Output file link: " + response)

}

main()

if you need client id to look at the api activity log for more details on error: 898931ae-33c8-40e0-ab4f-98b005cf3df8

@Rameshreddypediatrix
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): COMPARISONCLOUD-229

Hi @Rameshreddypediatrix , I have analyzed logs based on your clientId, and discovered wrong request body. But I wasn’t able to reproduce the “Amazon S3 Exception” - this could be temporary issue. I also noticed that you probably use SDK for Node.js. Here is example of code that works and send right options:

"use strict";

global.comparison_cloud = require("groupdocs-comparison-cloud");
global.fs = require("fs");
global.serializer_1 = require("groupdocs-comparison-cloud/lib/serializer");

//// ***********************************************************
////          GroupDocs.Comparison Cloud API Examples
//// ***********************************************************

//TODO: Get your clientId and clientSecret at https://dashboard.groupdocs.cloud (free registration is required).

global.clientId = "xxxx-xxxx-xxxx-xxxx";
global.clientSecret = "xxxxxxxxxxxxxxxx";

global.myStorage = "First Storage";

const config = new comparison_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

// construct CompareApi
global.compareApi = comparison_cloud.CompareApi.fromConfig(config);

// construct ReviewApi
global.reviewApi = comparison_cloud.ReviewApi.fromConfig(config);

// construct PreviewApi
global.previewApi = comparison_cloud.PreviewApi.fromConfig(config);

// construct InfoApi
global.infoApi = comparison_cloud.InfoApi.fromConfig(config);

// construct FileApi
global.fileApi = comparison_cloud.FileApi.fromConfig(config);

// construct StorageApi
global.storageApi = comparison_cloud.StorageApi.fromConfig(config);

// construct LicenseApi
global.licenseApi = comparison_cloud.LicenseApi.fromConfig(config);

async function examples() {
    try {
        let source = new comparison_cloud.FileInfo();
        source.filePath = "Niva Travel_.pdf";
        let target = new comparison_cloud.FileInfo();
        target.filePath = "niva-legend-3dv-tth.pdf";
        let options = new comparison_cloud.ComparisonOptions();
        options.sourceFile = source;
        options.targetFiles = [target];
        options.outputPath = "result.pdf";

        let request = new comparison_cloud.ComparisonsRequest(options);		

        let response = await compareApi.comparisons(request);
        console.log("Output file link: " + response.href);	
    } catch (error) {
        console.log(error.message);
    }
}

examples();

You can fine more node.js examples here: GitHub - groupdocs-comparison-cloud/groupdocs-comparison-cloud-node-samples: GroupDocs.Comparison Cloud SDK for Node.js examples, plugins and showcase projects

Also, here is right example of comparison options, for request body, for reference:

{
  "SourceFile": {
    "FilePath": "Niva Travel_.pdf"
  },
  "TargetFiles": [
    {
      "FilePath": "niva-legend-3dv-tth.pdf"
    }
  ],
  "OutputPath": "compare_output.pdf"
}

These options are different from what I see in your requests:

{"comparisonOptions":{"SourceFile":{"FilePath":".\\admitnote1.pdf","VersionId":null,"StorageName":null,"Password":null},"TargetFiles":[{"FilePath":".\\Admitnote2.pdf","VersionId":null,"StorageName":null,"Password":null}],"Settings":null,"ChangeType":"None","OutputPath":".\\result.pdf"}}

There is “comparisonOptions” root element that is wrong.

If you have more questions, please feel free to ask!