REST Import API

Schedule Import Job

Schedules an import. The import files have to be uploaded first using the REST File API.

URL Pattern

/manage/import

Method

POST

Content types

application/json

Media types

application/json, application/xml

Result

The job object of the scheduled import job

Query Parameters

Parameter

Required

Default

Datatype

Parameter description

workflowServiceEndpoint

no

String

Informatica BPM callback parameter. Defines the name of the service endpoint which must be available in an attached Informatica BPM instance.

workflowCorrelationId

no

String

Informatica BPM callback parameter. An arbitrary id which is used by the Informatica BPM workflow to identify the correct workflow process.

workflowCommunicationMode

no

REST

REST/QUEUE

Informatica BPM callback parameter. Defines the communication mode which can be using JMS message queue and REST communication.

workflowQueueId

no

First trigger queue id in server.properties

String

Informatica BPM callback parameter. An queue id defined in the server properties in the message queue section which is used as response queue

Content

The content has to be a JSON object which includes the properties listed below.

Properties

Field

Required

Default

Datatype

Parameter description

executionDate

no

now

DATETIME

Date and time when the import should be started

files

yes

A list of file objects

A list of objects describing an uploaded file. The object has to include the property id. The number and order of the files has to match the files specified in the import mapping.

mapping

yes

ENTITY_ITEM

A reference to the import mapping stored in the database. Import mappings have the entity ImportProfile. The property id has to be specified.

entitySpecificData

no

A list of JSON objects

Each object contains information that is specific to the imported entity, for example, the catalog in case of Articles.

options

no

JSON object

A JSON object containing the import options

Properties of the entitySpecificData element

Field

Required

Default

Datatype

Parameter description

entityIdentifier

yes

String

The identifier of the entity that should be imported, for example, Article

properties

no

JSON object

Properties for the specified entity

Properties of the properties element for entity Article (standard without customizing)

Field

Required

Default

Datatype

Parameter description

parent

yes

String

The id of the catalog.

groupAssignmentMode

no

0

Integer

If set to

  • 0: References to structure groups are added to existing structure groups

  • 1: References to structure groups replace existing structure groups

Properties of the options element

Field

Required

Default

Datatype

Parameter description

createNewObjects

no

true

Boolean

If set to true, new objects are created during the import. If set to false, objects that do not already exist are not imported.

updateExistingObjects

no

true

Boolean

If set to true, objects that exist already are updated. If set to false, objects that do not already exist are not imported.

dryRunBeforeImport

no

false

Boolean

A dry run is executed before the actual import. Only if the dry run does not contain any errors, the actual import is executed.

dryRunOnly

no

false

Boolean

Only a dry run is executed, no objects are imported.

errorMode

no

TOLERANT

String

Either TOLERANT (objects containing errors are imported as far as possible) or RESTRICTIVE (objects

numberOfThreads

no

Depends on
server settings

Integer

Number of threads which are used for the import. The number of threads can be reduced to lower the server load.
Currently not supported, will be available in HPM 7.0.01.

useMappingDefault

no

false

boolean

If set to true, the import settings of the import mapping will be used, instead of the options. (since version 8.0.6.05)

Result

An object reference to the import job.

Properties of the returned object

Field

Data type

Description

id

Integer

The job ID

label

String

The label of the job

Cancel Import Job

Cancels a scheduled or running import job. If the job has been finished already, this request has no effect.

URL Pattern

/manage/import/{jobId}/cancel

Method

POST

Content types

application/json

Result

The job-id, the old job state and the new job state.

Result

Properties of the returned object

Field

Data type

Description

id

Integer

The job ID

oldState

String

The old state of the job.

newState

String

The new state of the job.

Examples

Scheduling an import for a certain date and time

curl -u rest:heiler -H "Accept: application/json" -H "Content-Type:application/octet-stream" --data-binary "@Data.xlsx" -X POST http://localhost:1501/rest/V1.0/manage/file?originalFilename=Data.xlsx
{ "executionDate": "2013-04-11T11:00:00",
"files": [
{ "id": "fc645958-b169-44eb-91df-6ce30b3c4b11" }
],
"mapping": { "id": "73" },
"entitySpecificData": [ {
"entityIdentifier" : "Article",
"properties" : {
"parent": "1",
"groupAssignmentMode": "1"
}
} ],
"options": {
"createNewObjects": true,
"updateExistingObjects": true,
"dryRunBeforeImport": false,
"dryRunOnly": false,
"errorMode": "TOLERANT",
"numberOfThreads": 10
}
}

A reference to the import job is returned:

{
"id": "291",
"label": "Import_291"
}

Cancel a running import job

Request to cancel the job with the id 291:

 curl -u rest:heiler -H "Accept: application/json" -X POST http://localhost:1501/rest/V1.0/manage/import/291/cancel

Response containing the old and the new state of the job.

{
"oldState": "scheduled",
"newState": "canceled.ok",
"id": "291"
}