Publish Data Using the REST API

The REST API supports publishing data changes and data deletion to a data hub.

Overview

The REST API provides the capabilities to manage loads, which includes querying, creating, submitting and canceling loads. It also supports persisting records in existing loads. Finally, it provides a shortcut to Load and Submit data in a single request.

Query Existing Loads

Method

GET

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name] to list the loads [base_url]/load-count/[data_location_name] to count the loads

Supported Parameters

  • $offset: Defines the results offset for pagination for the list of loads.

  • $limit Defines the maximum number of returned results for the list of loads.

  • $batchId: Limit results to the loads with given Batch ID.

  • $loadStatus: Limit results to the loads in a given status.

  • $jobNamePattern: Limit results to the loads running in a queue with a name matching the pattern (use the _ and % wildcards to represent one or any number of characters).

  • $queueNamePattern: Limit results to the loads with a job name matching the pattern. Use the _ and % wildcards to represent one or any number of characters.

  • $programNamePattern: Limit results to the loads created with program name matching the pattern. Use the _ and % wildcards to represent one or any number of characters.

  • $loadCreator: Limit results to the loads with this creator.

  • $batchSubmitter: Limit results to the loads with this submitter.

  • $loadDescriptionPattern: Limit results to the load with a description matching the pattern. Use the _ and % wildcards to represent one or any number of characters.

Response Format

The response contains a count of loads, or the list of loads meeting the criteria. The information returned for each load depends on the status of the load.

Example 1. Query Existing Loads: sample response.
{
  "loads": [
    {
      "loadId": 21,
      "loadStatus": "DONE",
      "loadCreator": "semadmin",
      "loadCreationDate": "2019-04-01T15:47:51.920Z",
      "programName": "curl",
      "loadDescription": "Customer Load",
      "loadSubmitDate": "2019-04-01T15:47:52.137Z",
      "batchSubmitter": "semadmin",
      "batchId": 21,
      "integrationJobName": "INTEGRATE_DATA",
      "integrationJobQueueName": "Default",
      "integrationJob": {
        "startDate": "2019-04-01T15:47:54.537Z",
        "completionDate": "2019-04-01T15:48:39.483Z",
        "duration": 44946,
        "currentTask": {
          "name": "Insert new MH for modified MD records",
          "startDate": "2019-04-01T15:48:39.244Z",
          "duration": 239
        },
        "notificationStatus": "DONE"
      },
      "numberOfJobExecutions": 1,
      "submitInterval": -1,
      "submittable": true,
      "loadType": "EXTERNAL_LOAD"
    }
  ]
}

Load Type

The loadType indicates the nature of the load:

  • An external load (EXTERNAL_LOAD) which can be submitted (submittable=true).

  • A continuous load (CONTINUOUS_LOAD) which cannot be manually submitted but is automatically submitted every submitInterval seconds.

  • A load attached to application activities, which cannot be submitted:

    • WORKFLOW_SUBMIT corresponds to a submit performed by a workflow.

    • LEGACY_WORKFLOW corresponds to a submit performed by a legacy workflow. It replaces the WORKFLOW load type, which is deprecated

    • DIRECT_AUTHORING corresponds to a submit performed by a direct authoring action.

    • DIRECT_DELETE corresponds to a submit performed by a direct delete action.

    • DIRECT_DUPS_CONFIRM corresponds to a submit performed by a direct duplicates confirmation action.

    • DIRECT_DUPS_MANAGEMENT corresponds to a submit performed by a direct duplicates manager action.

Load Status

The possible values for the Load Status are listed in the table below.

Load Status Description

RUNNING

The load is currently running.

CANCELED

The load was canceled (CancelLoad)

PENDING

The load was submitted. A batch was created and is waiting for the batch poller to pick it.

SCHEDULED

The batch was taken into account by the batch poller. The job is queued by the engine.

PROCESSING

The batch’s job is currently being processed by the engine.

SUSPENDED

The job is suspended, either by an administrator or due to an error. It awaits for administrator intervention.

WARNING

The job completed successfully, but some records have caused validation errors.

DONE

The job completed successfully with no validation errors.

ERROR

The job did not complete successfully, it was canceled by an administrator.

Integration Job

If a job is attached to the load (the load was submitted), then the integrationJob object provides details about this job, including its start date, current task, duration and any error that may occur in this job.
It also includes the notificationStatus, which indicates whether the notifications were successfully sent.

The currentTask corresponds to the running task for RUNNING jobs and the last executed task for KILLED or SUSPENDED jobs
Use the API to monitor jobs which are SUSPENDED or in ERROR to report possible issues with the integration. Combine this endpoint with the capability to manage loads to automate job restart.

Query a Load

Method

GET

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]/[load_id or load_name]

Response Format

The response contains the load identified by [load_id or load_name]. The information returned for the load depends on its status.

Example 2. Query one Load: sample response.
{
  "loadId": 26,
  "loadStatus": "CANCELED",
  "loadCreator": "semadmin",
  "loadCreationDate": "2019-04-08T09:35:46.897Z",
  "numberOfJobExecutions": 0,
  "submitInterval": -1,
  "submittable": true,
  "loadType": "DIRECT_AUTHORING"
}

Initialize a Load

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]

Request Payload

The request contains the CREATE_LOAD action, as well as the information required to create a new load.

Example 3. Load creation: sample request.
{
  "action":"CREATE_LOAD",
  "programName": "curl",
  "loadDescription": "Load Customers"
}

Response Format

The response contains the load information, including the load ID, load type, and an indication of the status.

Example 4. Load creation: sample response.
{
  "loadId": 27,
  "loadStatus": "RUNNING",
  "loadCreator": "semadmin",
  "loadCreationDate": "2019-05-06T13:35:44.259Z",
  "programName": "curl",
  "loadDescription": "Load Customers",
  "numberOfJobExecutions": 0,
  "submitInterval": -1,
  "submittable": true,
  "loadType": "EXTERNAL_LOAD"
}

Load Data

To load data in a given load, the URL must contain the Load ID that was returned at load creation time, or the Load ID/Name of a continuous load.

Data is loaded in GD tables for basic entities and in MD tables for ID and Fuzzy matched entities.

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]/[load_id or load_name]

Request Payload

The request contains the PERSIST_DATA action, as well as the information required to load data. This information includes:

  • The persistOptions, which define how records are published into the hub. See Configure Data Loads for more information.

  • The persistRecords, which contain the records to be loaded into the hub.

Example 5. Load data: sample request.
{
  "action":"PERSIST_DATA",
  "persistOptions": {
    "defaultPublisherId": "CRM",
    "optionsPerEntity": {
      "Customer": {
        "enrichers": "JOB_PRE_CONSO",
        "validations": "ALL",
        "queryPotentialMatchesRules": "ALL",
        "queryPotentialMatchesBaseExpressions": "ID",
        "responsePayloadRecordsBaseExpressions": "VIEW_ATTRS"
        }
      },
    "missingIdBehavior": "GENERATE",
    "persistMode": "IF_NO_ERROR_OR_MATCH",
    "responsePayload": "RECORDS"
    },
  "persistRecords": {
    "Customer": [
      {
        "CustomerName": "Gadgetron"
      }
    ]
  }
}

Response Format

The response contains, in the records element, the enriched records, the failedValidations as well as the potentialMatches (if any).
The response also contains the records' status as well as the load information..

Example 6. Load submission: sample response.
{
    "status": "PERSISTED",   (1)
    "load": {                (2)
        "loadId": 27,
        "loadStatus": "RUNNING",
        "loadCreator": "semadmin",
        "loadCreationDate": "2019-05-06T13:35:44.259Z",
        "programName": "curl",
        "loadDescription": "Load Customers",
        "numberOfJobExecutions": 0,
        "submitInterval": -1,
        "submittable": true
    },
    "records": {
        "Customer": [
            {
                "entityName": "Customer",
                "recordValues": {
                    "PublisherID": "CRM",
                    "SourceID": "5",
                    ...
                    "CustomerName": "Gadgetron",
                    "TotalRevenue": null,
                    "InputAddress.Address": null,
                    ...
                    "GeocodedAddress.Quality": null,
                    "FID_AccountManager": null
                },
                "failedValidations": [],
                "potentialMatches": []
            }
        ]
    }
}
1 The status is PERSISTED if the data was persisted, or or PERSIST_CANCELLED, if the data has not been persisted, for example if validations failed, or if a match was found.
2 Load information, similar to the information returned when querying a load.

Configure Data Loads

Persist Options

When loading one or more records you can configure the following elements in the persistOptions element:

  • For each entity:

    • enrichers: Defines the enrichers that should be executed before persisting the records. By default, no enricher is executed. Possible values are:

      • JOB_PRE_CONSO: Run all the enrichers configured with a Pre-Consolidation Only or Pre and Post Consolidation scope.

      • ALL: Run all enrichers defined for the entity.

      • A list of enricher names in the following format:

        [
          "<enricher_name>",
          ...
        ]
    • validations: Defines the validations that should be executed after the enrichers. By default, no validation is executed. Possible values are:

      • JOB_PRE_CONSO: Run all validations configured with a Pre-Consolidation Only or Pre and Post Consolidation scope.

      • ALL: Run all the validations defined for the entity.

      • A list of validations with their name and type in the following format:

        [
          {
            "validationType": "<validation_type>",
            "validationName": "<Validation_name>"
          },
        ...
        ]

        Possible validationType values are CHECK, PLUGIN, MANDATORY, LOV, FOREIGN or UNIQUE.

    • queryPotentialMatchesRules: Defines the match rules to use to detect potential matches. By default, no match detection is performed. Possible values are:

      • ALL: Run all the match rules defined for the entity.

      • A list of match rule names, in the following format:

        [
          "<match_rule_name>",
          ...
        ]
    • queryPotentialMatchesHighestScoreOnly: When set to true, only the match found with the highest match score is returned in the response. Otherwise, all matches found are returned.

      The queryPotentialMatches parameter is deprecated and is replaced with queryPotentialMatchesRules and queryPotentialMatchesHighestScoreOnly.

    • queryPotentialMatchesBaseExpressions: Defines the set of base attributes to include in the response for the potential matches found. Possible values are:

      • NONE: No attributes.

      • USER_ATTRS (default): All entity attributes, except the built-in attributes and references.

      • VIEW_ATTRS: All entity attributes, except references. Includes the built-in attributes.

      • ID: Only the identifier attributes. Depending on the entity type and the matched record’s location, PublisherID, SourceID, the golden ID, and/or the primary key will be returned.

    • queryPotentialMatchesExpressions: Expressions to include to include in the response for the potential matches found, in addition to the base attributes (queryPotentialMatchesBaseExpressions). These expressions are in the following format: [alias]:[semql_expression].

    • responsePayloadRecordsBaseExpressions: Defines the set of base attributes to include in the response for the persisted records. Possible values are:

      • NONE: No attributes.

      • USER_ATTRS (default): All entity attributes, except the built-in attributes and references.

      • VIEW_ATTRS: All entity attributes, except references, including the built-in attributes.

      • ID: Only the identifier attributes. Depending on the entity type, PublisherID, SourceID, and/or the primary key are returned.

    • responsePayloadRecordsExpressions: Expressions to include in the response for the persisted records, in addition to the base attributes (responsePayloadRecordsBaseExpressions). These expressions are in the following format: [alias]:[semql_expression].

  • For the entire load:

    • missingIdBehavior: Option to define whether to generate IDs when they are not provided in the payload. Possible values are GENERATE to generate the ID or FAIL to fail loading if the ID is missing.

    • persistMode: Flag to define whether the records should be persisted or not. Possible values are:

      • IF_NO_ERROR_OR_MATCH (Default value): Persist a record if no validation error was raised and no potential match was found.

      • ALWAYS: Always persist a record.

      • NEVER: Never persist a record.

    • responsePayload: This flag specifies the content of the response payload. Possible values are:

      • RECORDS (Default value): Details of the persisted records.

      • SUMMARY: Count of persisted records.

      • SUMMARY_AND_RECORDS: Count and details of the persisted records.

Update Existing Records

The REST API allows to update Golden records for basic entities and Master records for ID and Fuzzy matched entities.

Single Update

You update an existing record by providing its ID when loading the data:

  • For basic entities, the ID attribute of the record to update.

  • For ID and Fuzzy-matched entities, the Source ID and Publisher ID of the master record to update.

If you persist a record in a load with an existing record ID, a copy of the record is checked out and changes are applied only to the fields provided in the request body. Other attributes still keep their value.

Mass Update

With the MASS_UPDATE_DATA action, you can use the endpoint to update multiple records within the same payload.

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]/[load_id or load_name]

Request Payload

The request contains the MASS_UPDATE_DATA action, as well as the information required to update data. This information includes:

  • responsePayload specifies the content of the response payload:

    • RECORDS (Default value): Details of persisted records.

    • SUMMARY: Count of persisted records.

    • SUMMARY_AND_RECORDS: Count and details of persisted records.

  • responsePayload defines whether the records should be persisted or not.

For each entity you can set the following options:

  • updateCondition: Defines the SemQL expression used to qualify the set of records to update.

  • updateValues: Specifies the list of attributes to update for the entity. At least one of the properties updateValues or updateExpressions is required, and no attribute must be present in both locations.

  • updateExpression: Sets the list of literal values for the attributes to update for the entity.

  • enrichers: Defines the enrichers that should be executed after the mass-update. By default, no enricher is executed.
    Possible values are:

    • JOB_PRE_CONSO: Run all the enrichers configured with a Pre-Consolidation Only or Pre and Post Consolidation scope.

    • ALL: Run all enrichers defined for the entity.

    • A list of enricher names.

  • validations: Defines the validations that should be executed after the enrichers. By default, no validation is executed.
    Possible values are:

    • JOB_PRE_CONSO: Run all validations configured with a Pre-Consolidation Only or Pre and Post Consolidation scope.

    • ALL: Run all the validations defined for the entity.

    • A list of validations with their name and type.

  • queryPotentialMatchesRules: Defines the match rules to use to query potential matches. By default, no match detection is performed. Possible values are:

    • ALL: Run all the match rules defined for the entity.

    • A list of match rule names.

  • queryPotentialMatchesHighestScoreOnly: When set to true, only the match found with the highest match score is returned in the response. Otherwise, all matches found are returned.

    The queryPotentialMatches parameter is deprecated and is replaced with queryPotentialMatchesRules and queryPotentialMatchesHighestScoreOnly.

  • queryPotentialMatchesBaseExpressions: Defines the set of base attributes to include in the response for the potential matches found. Possible values are:

    • NONE: No attributes.

    • USER_ATTRS (default): All entity attributes, except the built-in attributes and references.

    • VIEW_ATTRS: All entity attributes, except references. Include the built-in attributes.

    • ID: Only the identifier attributes. Depending on the entity type and the matched record’s location, PublisherID, SourceID, the golden ID, and/or the primary key will be returned.

  • queryPotentialMatchesExpressions: Expressions to include to include in the response for the potential matches found, in addition to the base attributes (queryPotentialMatchesBaseExpressions). These expressions are in the following format: [alias]:[semql_expression].

  • responsePayloadRecordsBaseExpressions: Defines the set of base attributes to include in the response for the mass-updated records. Possible values are:

    • NONE: No attributes.

    • USER_ATTRS (default): All entity attributes, except the built-in attributes and references.

    • VIEW_ATTRS: All entity attributes, except references, including the built-in attributes.

    • ID: Only the identifier attributes. Depending on the entity type, PublisherID, SourceID, and/or the primary key are returned.

  • responsePayloadRecordsExpressions: Expressions to include in the response for the mass-updated records, in addition to the base attributes (responsePayloadRecordsBaseExpressions). These expressions are in the following format: [alias]:[semql_expression].

Example 7. Mass Update Data: sample request to mass update records.
{
  "action": "MASS_UPDATE_DATA",
  "massUpdateOptions": {
    "responsePayload": "SUMMARY",
    "persistMode": "IF_NO_ERROR_OR_MATCH",
    "optionsPerEntity": {
      "Customer": {
        "updateCondition": "Email is not null",
        "updateValues": {
          "Email": "NA",
        },
        },
        "enrichers": [
          "CleanseEmail"
        ],
        "validations": [],
        "queryPotentialMatchesRules": "ALL"
      }
    }
  }
}

Response Format

The response contains the status of the request, the load information as well as a the summary or the list of all the records updated as part of this request.

Example 8. Mass update data: sample response.
{
  "status": "PERSISTED",
  "load": {                (1)
  ...
  },
  "massUpdateSummary": {
    "Customer":
    {
      "recordsPersisted": 25,
      "recordsWithFailedValidations": 4,
      "recordsWithPotentialMatches": 0
    }
  }
}
1 Load information, similar to the information returned when querying a load.
Use the restApiMassUpdateFetchBatchSize system property to change the fetch batch size when mass updating records. The default value is 1000.

Set the Auditing Fields

By default, the auditing fields, Creator, Updator, CreateDate, UpdateDate are automatically set to the current user name and the current date when the user publishes the data. These values cannot be set by the user.

However, a user may be configured to push values in these auditing fields to publish data, for example, in the past, or on behalf of other users.

A user with a role having the Allow Publishing as user in API option selected in a model privilege grant is able to set the audit fields (Creator, Updator, CreateDate, UpdateDate) while publishing data via the REST API.

Enrich, Validate and Detect Matches

When loading or updating data, you can choose to execute enrichers, validations, and matchers for each entity.

Enrich and Validate

You may define, for each entity you want to configure, under the optionsPerEntity element, one element named after the entity. For each entity, you can:

  • give a list of enrichers to run, with their enricher names,

  • give a list of validations to execute, with their validationType and validationName.

Detect Matches

When loading data, indicate with the queryPotentialMatchesRules whether the platform should check for duplicates according to the matching rules defined for the entity.

When checking for duplicates, master records potentially matching an incoming record are returned in the response, to help identify the reason for the matches.

You can define the attributes returned to only include those required for a specific use case, with two additional properties:

  • queryPotentialMatchesBaseExpressions defines the set of base attributes to include in the master records detected as potential matches:

    • NONE: no attributes.

    • USER_ATTRS: all attributes, except built-in attributes and references.

    • VIEW_ATTRS: all attributes, except references. This includes built-in attributes.

    • ID: only the identifier attributes. Depending on the entity type and the matched record’s location, PublisherID, SourceID, the golden ID, and/or the primary key will be returned.

  • queryPotentialMatchesExpressions defines a list of expressions to return in addition to the set of base attributes. These expressions are in the following format: <alias>:<semql_expression>.

For example, the following request looks for potential matches.

Example 9. Request to test potential matches for the Person entity.
{
  "action":"PERSIST_DATA",
  "persistOptions": {
    "defaultPublisherId": "CRM",
    "optionsPerEntity": {
      "Person": {
        "queryPotentialMatchesRules": ["SameExactEmailMatchName"],  (1)
        "enrichers":["CleanseEmail"],
        "validations":[],
        "queryPotentialMatchesBaseExpressions": "NONE", (2)
        "queryPotentialMatchesExpressions": { (2)
          "Name": "Concat(FirstName, ' ', LastName)",
          "Email": "CleansedEmail",
          "Golden ID": "Gold_ID",
          "Master ID": "ID"
        }
      }
    },
    "missingIdBehavior": "FAIL",
    "persistMode": "NEVER"   (3)
  },
  "persistRecords": {
    "Person": [
    {
      "SourceID": "99998",
      "FirstName": "John",
      "LastName": "Doe",
      "DateOfBirth": "1974-01-25",
      "SourceEmail": "jass@ellerbusch.com"
    }
    ]
  }
}
1 Trigger potential matches detection for the records using one match rule. Note that since the matcher uses enriched values, the CleanseEmail enricher is also triggered.
2 Select the information returned for the potential matches. Since queryPotentialMatchesBaseExpressions is set to NONE, only the expressions defined in the queryPotentialMatchesExpressions are returned.
3 This value for PersistMode never persists the records. This call only finds potential matches.

The response to this request is as follows:

Example 10. Response with one potential match found
{
  "status": "PERSIST_CANCELLED",
  "load": {
    ...
  },
  "records": {
    "Person": [
      {
        "entityName": "Person",
        "recordValues": {
          "CleansedEmail": "jass@ellerbusch.com",
          "SourceEmail": "jass@ellerbusch.com",
          "DateOfBirth": "1974-01-25",
          "FirstName": "John",
          "SourceID": "99998",
          "PublisherID": "CRM",
          "LastName": "Doe",
          ...
        },
        "failedValidations": [],
        "potentialMatches": [
          {
            "matchRuleName": "ExactEmailMatch",
            "matchScore": 74,
            "matchedRecordLocation": "MD",
            "matchedRecordId": {
              "SourceID": "1320830",
              "PublisherID": "CRM"
            },
            "matchedRecordData": {
              "Name": "Jass Ellerbusch",
              "Email": "jass@ellerbusch.com",
              "Golden ID": 10002,
              "Master ID": "CRM.1320830"
            }
          }
        ]
      }
    ]
  }
}

Data Loading Behavior

When invoked with a payload, the REST operation will run the enrichers, validations and matchers for each record, depending on the entity configuration.

It will then return:

  • The enriched data

  • a list of validation errors if any

  • a list of potential matches detected by the matching rules.

The record may be persisted or not at that stage, depending on the persistMode option:

  • If set to ALWAYS, then the records are persisted even if they have errors and potential matches.

  • If set to NEVER, then the records are not persisted. Use this option to perform a dry-run to test your records.

  • If set to IF_NO_ERROR_OR_MATCH (default value), then the records are persisted if no validation error was raised and no potential match was found.

Publish Deletions

You can use the endpoint to load data, with the DELETE_DATA action, in order to publish record deletions.

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]/[load_id or load_name]

Request Payload

The request contains the DELETE_DATA action, as well as the information required to delete data. This information includes:

  • The deleteOptions, which define how records are deleted:

    • The deleteType property defines whether to use HARD_DELETE or SOFT_DELETE.

    • The recordType property defines whether to delete GOLDEN or MASTER records.

  • The deleteRecords, which contain the IDs to identify the records to delete:

    • To delete a fuzzy/ID matched golden record or a basic entity record: the golden ID.

    • To delete a master record for a fuzzy matched entity: the PublisherID, SourceID pair.

    • To delete a master record for an ID matched entity: the PublisherID, <id_attribute> pair.

Submitting other information than these IDs in this property is considered an error.

Example 11. Delete data: sample request to delete a golden record.
{
  "action":"DELETE_DATA",
  "deleteOptions": {
    "deleteType": "SOFT_DELETE",
    "recordType": "GOLDEN"
    },
  "deleteRecords": {
    "Customer": [
      {
        "CustomerID": "123456"
      }
   ]
  }
}

Response Format

The response contains the status of the request, the load information as well as a list of all the records deleted as part of this request (including child records deleted by a cascade).

Example 12. Delete data: sample response.
{
  "status": "PERSISTED",   (1)
  "load": {                (2)
  ...
  },
  "records": {
    "Customer": [
    {
      "entityName": "Customer",
      "CustomerID": "123456",
      "status": "DELETABLE" (3)
    },
    {
      "entityName": "Contact",
      "CustomerID": "778899",
      "status": "DELETABLE"
    },
    ...
    ]
  }
}
1 The status is PERSISTED if the delete request was persisted, or PERSIST_CANCELLED, if the request was not persisted.
2 Load information, similar to the information returned when querying a load
3 Record deletion status.

The record deletion status indicates whether deletion is possible or not for the record. It is one of the following:

  • DELETABLE: Record is deletable and will be if the load is submitted.

  • PERMISSION_DENIED: Record cannot be deleted due to a privilege issue.

  • CHILD_RESTRICTION: Record cannot be deleted due to a restriction on a child record.

  • RECORD_NOT_FOUND: Record is not found and cannot be deleted.

  • OTHER_ERROR: Another error occurred during deletion.

Submit a Load

To submit a load, the URL must contain the Load ID that was returned at load creation time.

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]/[load_id]

Request Payload

The request contains the SUBMIT action, as well as the job to use when submitting the data.

Example 13. Load submission: sample request.
{
  "action":"SUBMIT",
	"jobName": "INTEGRATE_DATA"
}

Response Format

The response contains the load information, including the load ID, batch ID, and an indication of the status.

Example 14. Load submission: sample response.
{
  "loadId": 27,
  "loadStatus": "PENDING",
  "loadCreator": "semadmin",
  "loadCreationDate": "2019-05-06T13:35:44.259Z",
  "programName": "curl",
  "loadDescription": "Load Customers",
  "loadSubmitDate": "2019-05-06T13:39:02.807Z",
  "batchSubmitter": "semadmin",
  "batchId": 24,
  "integrationJobName": "INTEGRATE_DATA",
  "integrationJobQueueName": "Default",
  "numberOfJobExecutions": 0,
  "submitInterval": -1,
  "submittable": true,
  "loadType": "EXTERNAL_LOAD"
}

Cancel a Load

To cancel a load, the URL must contain the Load ID that was returned at load creation time.

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]/[load_id]

Request Payload

The request contains only the CANCEL action.

Example 15. Load cancellation: sample request.
{
  "action":"CANCEL"
}

Response Format

The response contains load ID as well as an indication of the status.

Example 16. Load cancellation: sample response.
{
  "loadId": 28,
  "loadStatus": "CANCELED",
  "loadCreator": "semadmin",
  "loadCreationDate": "2019-05-06T13:41:52.865Z",
  "programName": "curl",
  "loadDescription": "Load Customers",
  "numberOfJobExecutions": 0,
  "submitInterval": -1,
  "submittable": true,
  "loadType": "EXTERNAL_LOAD"
}

Load and Submit Data

Using the REST API, it is possible to create a load, load data (or request deletions) and submit the load in a single request.

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]

Request Payload

The request contains the CREATE_LOAD_AND_SUBMIT action, as well as the information required to create a new load, load data and submit the load. This includes the persistOptions and persistRecords elements.

Example 17. Load and Submit: sample request.
{
  "action":"CREATE_LOAD_AND_SUBMIT",
	"programName": "curl",
	"loadDescription": "Customer Load",
	"jobName": "INTEGRATE_DATA",
	"persistOptions": (1)
	"persistRecords": (1)
	"deleteOptions" : (2)
	"deleteRecords" : (2)
}
1 See Configure Data Loads for more information about the persistOptions and persistRecords.
2 See Publish Deletions for more information about the deleteOptions and deleteRecords.

Response Format

The response contains load ID as well as an indication of the status.

Example 18. Load and Submit: sample response.
{
    "status":  (1)
    "records": (2)
    "load":    (3)
}
1 PERSISTED or PERSIST_CANCELLED, if the data has not been persisted, for example if a match was found.
2 See Load Data for more information about this payload.
3 Load information, similar to the information returned when querying a load.

Manage a Load

When a load was submitted, it is still possible to manage it using the REST API.

Method

POST

Base URL

http://<host>:<port>/semarchy/api/rest/

URL

[base_url]/loads/[data_location_name]/[load_id]

Request Payload

The request contains the SUSPEND, KILL OR RESUME actions to perform the management operation on the load.

Example 19. Load submission: sample request.
{
  	"action":"RESUME"
}

Response Format

The response contains the load information and its new state. If the requested operation is not possible, an error is returned.

Combine this endpoint with the capability to query loads for automating production monitoring, for example to automatically resume jobs that are suspended.