Example not working. Returning `ErrorInvalidInputData`

Hello Support,

I’m following the Words Cloud documentation and trying to execute the example: Compare|Documents (aspose.cloud) gives me ErrorInvalidInputData in both cURL and postman:

Request

curl -v "https://api.aspose.cloud/v4.0/words/online/put/compareDocument?destFileName=CompareDocumentOut.doc"      -X PUT      -H "Content-Type: multipart/form-data"      -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2NTgyNTA5NzAsImV4cCI6MTY1ODI1NDU3MCwiaXNzIjoiaHR0cHM6Ly9hcGkuYXNwb3NlLmNsb3VkIiwiYXVkIjpbImh0dHBzOi8vYXBpLmFzcG9zZS5jbG91ZC9yZXNvdXJjZXMiLCJhcGkuYmlsbGluZyIsImFwaS5pZGVudGl0eSIsImFwaS5wcm9kdWN0cyIsImFwaS5zdG9yYWdlIl0sImNsaWVudF9pZCI6IjYyZWQ2ZGU3LTI1OWYtNDc1ZC1iNjMxLTJiM2FkYmVmNzE2MiIsImNsaWVudF9kZWZhdWx0X3N0b3JhZ2UiOiI0ODBmNGQ0MC1lNzc3LTRkZDYtOGQzZC0zMjU2NTVhMDcyMWUiLCJjbGllbnRfaWRlbnRpdHlfdXNlcl9pZCI6Ijg5ODkwNyIsInNjb3BlIjpbImFwaS5iaWxsaW5nIiwiYXBpLmlkZW50aXR5IiwiYXBpLnByb2R1Y3RzIiwiYXBpLnN0b3JhZ2UiXX0.aQZ14L1d6veCM8WHcr7IPzAu5KRDdhWIxADUUeDnTi1oggB5WTkB6vtAQ2bxBQnNuvxu73OyLvovnWk5skgaEbmeejBBqxgPCccraOmD0HrDjEs9zMwyhEZq3rp-oOA9Mz0hDfHTrPCvo1F-z8d42mxS_VgBWTkG-7H8cDGmbjtaVRDiHEni2hmfQlVVyXoA8Zk8ZUvB06M3TcIItnuvBIsyB14BpfX5V6fiwAQrxGJ9bWnxhqkmsEI8iTSPvHSnxlD2Nt1ACa2ajfWWI4ukfpoWNjJmn7vEEXme4QcLc16l9AACuogBO4GkU__luC8VOXzfDEjXis6EArstFwx7iQ"      -F Document="@compareTestDoc1.doc"      -F ComparingDocument="@compareTestDoc2.doc"

cUrl

{
  "Error": {
    "Code": "ErrorInvalidInputData",
    "Message": "Can not deserialize string '��\u0011ࡱ\u001a�\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000>\u0000\u0003\u0000��\t\u0000\u0006\u0000\u0000\u0000...\u0016...",
    "Description": "Operation Failed. The input data is not valid."
  },
  "RequestId": "Root=1-62d6ebd3-0d1c3a37269a8ff675a03a11"
}

Postman

{
    "Error": {
        "Code": "ErrorInvalidInputData",
        "Message": "Can not deserialize string '��ࡱ�

How can I fix it?

Thank you

@developer.looplex

We are sorry for the inconvenience. We are investigating the CompareDocumentOnline cURL command. Meanwhile, you can use CompareDocument API method for the document comparison from Cloud storage.

curl -X PUT "https://api.aspose.cloud/v4.0/words/compareTestDoc1.doc/compareDocument?destFileName=Compare_output.doc" -H "accept: application/json" -H "Authorization: Bearer [Access_Token]" 
-H "Content-Type: application/json" 
-H "x-aspose-client: Containerize.Swagger" 
-d ""ComparingWithDocument":"compareTestDoc2.doc","Author":"author","DateTime":"2022-07-20T05:10:54.451Z","CompareOptions":{"IgnoreCaseChanges":true,"IgnoreTables":true,"IgnoreFields":true,"IgnoreFootnotes":true,"IgnoreComments":true,"IgnoreTextboxes":true,"IgnoreFormatting":true,"IgnoreHeadersAndFooters":true,"Target":"Current","AcceptAllRevisionsBeforeComparison":true}}"

Hello,

I’m getting the same error. I would like to know if this problem in CompareDocumentOnline API is now resolved? and what is the solution?

thanks in advance.

@saharsam6

Let me check the details and share an update.

@saharsam6

As shared in another post, the above issue was fixed. It is working fine now in SDKs and Postman. But unfortunately, I am facing some issues with cURL. It might be my cURL version issue or the way fields are processed in cURL. I have logged a ticket(WORDSCLOUD-2161) to further investigate the issue.

Please note that when using online methods to process files from your local drive, you need to follow the parameters order in the request. In normal methods, you can send parameters in any order.

Thank you so much for the answer.

@saharsam6, @developer.looplex

We have checked the cURL command issue and it seems the DateTime field is causing the problem. However, you can omit the field as following. Hopefully, it will help you accomplish the task.

curl -X PUT "https://api.aspose.cloud/v4.0/words/online/put/compareDocument" 
-H "accept: multipart/mixed" 
-H "Authorization: Bearer eyJhb.....h5JlUovRQxL4BkteQNYZoTKNQ" 
-H "Content-Type: multipart/form-data" 
-F document="@C:/Temp/compareTestDoc1.doc" 
-F compareData="{ \"Author\":\"string\", \"ResultDocumentFormat\": \"doc\"}" 
-F comparingDocument="C:/Temp/compareTestDoc2.doc"