Default language.

Example of using the REST API to merge entries


This topic discusses how to use the Merge endpoint to merge entries.

Merge

The following table lists details about using the Merge operation to merge an existing entry into a form.

URL qualifier

/mergeEntry/{formName}

formName - The form for which an entry is to be created.

Method

POST

Headers

Header

Value

Authorization

token

Content-Type

application/json

(Optional) X-AR-Client-Type

Client Type ID

(Optional) X-AR-RPC-Queue

RPC queue to which the client calls are routed

(Optional) X-AR-Timeout

Timeout (in seconds) for REST request

Default value —120 seconds

(Optional) X-AR-TR-Core-Id

The core ID in a trace ID

(Optional) X-AR-TR-Counter

The counter in a trace ID

(Optional) X-AR-Trace-Id

The complete trace ID

(Optional) X-AR-TR-Is-Counter-Locked

The lock counter

Request body

An entry object in JSON format, merge options, and qualification.

Returns

No body content, but returns HTTP status code 201 with the Location header set to the URL of the new instance resource.

Merge Type

A value that indicates the action to take if the operation includes an Entry ID field and Entry ID that already exists in the target form. This parameter is ignored if you do not specify the Entry ID field or the ID specified does not conflict with existing entry IDs.

Merge Type

Description

DUP_ERROR

Generates an error.

DUP_NEW_ID

Creates a new entry with a new entry ID.

DUP_OVERWRITE

Deletes the existing entry and creates a new one.

DUP_MERGE

Update the fields specified in fieldList in the existing entry.

GEN_NEW_ID

Always generates a new entry ID for the record, even if there is no conflicting entry ID.

The following example shows how to merge an entry without an attachment field.

{
// normal entry values section
   "values" : {
        ...
   },
   // merge options
   "mergeOptions" : {
       "ignorePatterns" : false,
       "ignoreRequired" : false,
       "workflowEnabled" : false,
       "associationsEnabled" : false,
       "mergeType" : "DUP_ERROR",
       "multimatchOption" : 0
   },
   // a String representation of the qualification
   "qualification" : "'8'LIKE \"%match criteria%\"
}

Merge with attachments

The following table lists details about using the Merge endpoint to merge an existing entry with attachments.

URL qualifier

/mergeEntry/{formName}

formName - The form for which an entry is to be created.

Method

POST

Headers

Header

Value

Authorization

token

Content-Type

multipart/form-data

(Optional) X-AR-Client-Type

Client Type ID

(Optional) X-AR-RPC-Queue

RPC queue to which the client calls are routed

(Optional) X-AR-Timeout

Timeout (in seconds) for REST request

Default value —120 seconds

(Optional) X-AR-TR-Core-Id

The core ID in a trace ID

(Optional) X-AR-TR-Counter

The counter in a trace ID

(Optional) X-AR-Trace-Id

The complete trace ID

(Optional) X-AR-TR-Is-Counter-Locked

The lock counter

Request body

An entry object in JSON format, merge options and qualification

Returns

No body content, but returns HTTP status code 201 with the Location header set to the URL of the new instance resource.

All possible error codes

If the request is not successful, the following error code is returned:

500 - Internal Server Error

For more information, see Error-handling-for-the-REST-API.

The following example shows how to merge an entry with an attachment field.

{
   // normal entry values section
   "values" : {
        ...
            AttachmentFieldName : "attachedFileName",
        ...
   },
   // merge options
   "mergeOptions" : {
       "ignorePatterns" : false,
       "ignoreRequired" : false,
       "workflowEnabled" : false,
       "associationsEnabled" : false,
       "mergeType" : "DUP_ERROR",
       "multimatchOption" : 0
   },
   // a String representation of the qualification
   "qualification" : "'8'LIKE \"%match criteria%\"
}


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*