Compare Request

 Table of Contents

To invoke a comparison you POST a request in the structured JSON format or using multipart/form-dataTo understand how the compare process works, refer to Compare Guide.

End point
POST /api/json/v1/compare

Compare Request using JSON

Here is a simple synchronous example:

  "a": {
    "type": "file",
    "path": "/Users/exampleUser/Documents/f1.json"
  "b": {
    "type": "file",
    "path": "/Users/exampleUser/Documents/f2.json"
  "wordByWord": false,
  "arrayAlignment": "typeWithValuePriority"

The example above shows how comparison inputs could be specified using a file path. The  ajson and bjson elements in the request can contain different types of children according to the types of data being processed. This is described in more detail in the I/O types page

The request allows the parameters to be changed from their default values.

Form Input

In addition to requests in structured JSON format, multipart/form-data can also be used.

For example:

POST /api/json/v2/compare HTTP/1.1
Authorization: {{auth-token}}
Content-Type: multipart/form-data; boundary=unique-boundary-id
Accept: application/json

Content-Disposition: form-data; name="a"
Content-Disposition: form-data; name="b"
Content-Disposition: form-data; name="wordByWord"

Content-Disposition: form-data; name="arrayAlignment"


Comparison Model

When specifying a comparison, these are the various available objects and parameters:



(required object)

Input A to the comparison.

See this page for the various I/O types available. 


(required object)

Input B to the comparison.

See this page for the various I/O types available. 

For more details about parameters, see the links to the individual pages given below.


Merging of arrays is controlled by how items in the arrays match together.

Available Options:

  • positionPriority
  • typeWithValuePriority
  • orderless
wordByWordbooleanfalseStrings can be compared by whole string equality, or more granular word by word level.

A parameter with a value containing an array of configuration instructions.

For example, Ignore Changes by deletion, allows changes to be ignored by key.

{ "dxConfig" : 
    { "ignoreChanges" : "delete",
      "key" : "key-name" 
#content .code