REST Export API
The Rest Export API allows to schedule new export jobs and to cancel running export jobs.
Schedule Export Job
Schedules an export.
URL Pattern |
/manage/export |
Method |
POST |
Content types |
application/json, application/xml |
Media types |
application/json, application/xml |
Result |
The job object of the scheduled export 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 or an exportSchedulingProfile entity which includes the properties listed below.
Properties |
||||
Field |
Required |
Default |
Datatype |
Parameter description |
profileName |
yes |
String |
Export profile name |
|
comment |
no |
String |
Comment for the process overview |
|
executionDate |
no |
now |
DATETIME |
Date and time when the export should be started |
variables(available with 8.0.02) |
no |
Map<String,Object> |
Sets the variables specified in the export template |
|
dataSources(available with 8.0.02) |
no |
Map<String, DataSource> |
Allows to set a report query for each data source |
|
parameters(deprecated with 8.0.02) |
no |
Map<String,String> |
Map of export parameters (key/value pairs) |
Property variables (available with 8.0.02)
The property variables is a set of key / value pairs, whereby the key is the name of the variable. The value has to be valid according to the underlying datatype and the enumeration of the variable.
The datatype and the enumeration (if available) can be obtained by requesting information about an export profile (/manage/export/{ExportProfileName}, see below) . The valid formatting for the data types is described in REST Datatypes.
Example:
{
"profileName"
:
"MyExportProfile"
,
"variables"
: {
"BooleanVar"
:
"true"
,
"CurrencyVar"
:
"USD"
,
"DateAndTimeVar"
:
"2015-11-16T16:06:34"
,
"DateTimeVar"
:
"2015-11-16"
,
"LongVar"
:
"87"
,
"StringVar"
:
"Hello Export"
}
}
Property dataSources (available with 8.0.02)
The property dataSources is a key value map which allows to set a report query for each data source. The key is the name of the data source, the value is an object containing the report query.
The available data sources can be obtained by requesting information about an export profile (/manage/export/{ExportProfileName}, see below).
Internally, the property assortment of the data source in the export profile is used for the report query. This property has to be set to editable in the data source otherwise it is not possible to specify a report query for that data source. Note that the report query allows to specify an assortment, so it is still possible to specify an assortment.
The report query has the following properties:
Properties |
||||
Field |
Required |
Default |
Datatype |
Parameter description |
identifier |
yes |
String |
Identifier of the report |
|
parameters |
no |
Map<String,String> |
Parameters |
|
assortmentFilter |
no |
ENTITY_ITEM |
Reference to an assortment (must be a reference object) |
|
updateAssortment |
no |
false |
Boolean |
Specifies if the assortment should be updated before the |
Examples:
{
"profileName"
:
"MyExportProfile"
,
"dataSources"
: {
"Item list"
: {
"reportQuery"
: {
"identifier"
:
"bySearch"
,
"parameters"
: {
"query"
:
"ArticleLang.DescriptionShort(en) startsWith \"Long live the Export\""
},
"assortmentFilter"
: {
"id"
:
"4"
},
"updateAssortment"
:
true
}
}
}
}
{
"profileName"
:
"MyExportProfile"
,
"dataSources"
: {
"Item list"
: {
"reportQuery"
: {
"identifier"
:
"byCatalog"
,
"parameters"
: {
"catalog"
:
"'mySupplierCatalog'"
}
}
}
}
}
parameters (deprecated since 8.0.02)
Variables can be passed as special parameters. The name of the variable has to end with ##variable, e.g., myVar##variable.
{
"profileName"
:
"REST"
,
"parameters"
:{
"myVar##variable"
:
"sampleValue"
}
}
or
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
standalone
=
"yes"
?>
<
exportSchedulingProfile
>
<
profileName
>REST</
profileName
>
<
parameters
>
<
entry
>
<
key
>myVar##variable</
key
>
<
value
>sampleValue</
value
>
</
entry
>
</
parameters
>
</
exportSchedulingProfile
>
Note that "##variable" has to be appended to the variable name to create a corresponding parameter.
Result
Field |
Data type |
Description |
id |
Integer |
The ID of the export job |
label |
String |
The label of the export job |
Complete example
A complete example with two variables and two data sources
{
"profileName"
:
"MyExportProfile"
,
"comment"
:
"MyComment"
,
"executionDate"
:
"2015-11-06T12:00:00"
,
"variables"
:{
"FirstVar"
:
"Value for first varibale"
,
"SecondVar"
:
"Value for second varibale"
,
},
"dataSources"
: {
"Item list 1"
:{
"reportQuery"
: {
"identifier"
:
"bySearch"
,
"parameters"
: {
"query"
:
"ArticleLang.DescriptionShort(en) startsWith \"Long live the Export\""
},
"assortmentFilter"
: {
"id"
:
"4"
},
"updateAssortment"
:
true
}
},
"Item list 2"
:{
"reportQuery"
: {
"identifier"
:
"bySearch"
,
"parameters"
: {
"query"
:
"Article.SupplierAID startsWith \"A1\""
}
}
}
}
}
Information about an export profile
Returns the available variables and data sources for the specified export profile.
URL Pattern |
/manage/export/{ExportProfileName} |
Method |
GET |
Media types |
application/json, application/xml |
Result |
Available variables and data sources of the specified export profile. |
Result
Field |
Data type |
Description |
profileName |
String |
The name of the export profile |
variables |
Map<String,VarInfo> |
Contains variable names together with information about the data type, the enumeration (if available), if the |
dataSources |
Map<String, DataSourceInfo> |
Contains the available data sources and for each data source the entity |
Example
{
"profileName"
:
"MyExportProfile"
,
"variables"
: {
"BooleanVar"
: {
"dataType"
:
"BOOLEAN"
,
"mandatory"
:
false
,
"defaultValue"
:
"0"
},
"CurrencyVar"
: {
"dataType"
:
"STRING"
,
"enumeration"
:
"Enum.Currency"
,
"mandatory"
:
false
,
"defaultValue"
:
"Euro"
},
},
"dataSources"
: {
"Item list 1"
: {
"entity"
:
"Article"
},
"Item list 2"
: {
"entity"
:
"Article"
}
}
}
Cancel Export Job
Cancels a scheduled or running exportjob. If the job has been finished already, this request has no effect.
URL Pattern |
/manage/export/{jobId}/cancel |
Method |
POST |
Content types |
application/json, application/xml |
Media types |
application/json, application/xml |
Result |
The job-id, the old job state and the new job state. |
URL Parameters
Parameter |
Required |
Default |
Datatype |
Parameter description |
{jobId} |
yes |
Integer |
Unique ID of the job to cancel |
Result
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. |