Configuration Import

This REST API can be used to import configuration files into the Estate Manager. File imports can be done either synchronously or asynchronously through this API. The asynchronous file import will be done using a scheduled job where a new scheduled job will be created, and its’ job reference will be returned as the response. The synchronous file import will return the number of records imported, as the response.

Request URL #

1POST {Enactor Rest API Base URL}/rest/configuration/import/<filename>?async=true

ex: Enactor Rest API Base URL – http://<Leader IP>:<EMS Port>/WebRestApi/

Request Headers #

ParameterAccepted valuesRemarks
AuthorizationStringBase64 encoded userName:password with “Basic”Ex: Basic aW5zdGFsbDppbnN0YWxs
Content-MD5StringOptional.MD5 checksum of the file we are importing.If specified, file’s checksum will be compared against the parameter value and reject the request if checksum fails.If not specified, checksum verification will be skipped.
x-enactor-default-user-passwordStringOptional.Only applicable when importing User entities.If specified, all the passwords of imported user entities will be set to this.
x-enactor-connection-process-idStringOptional.Defaults to “RetailProcessServer”
x-enactor-connection-point-idStringOptional.Defaults to “RetailServerJobResults”
x-enactor-runtime-contextStringOptional.Defaults to “Enactor Web Retail Processing”

Query parameters #

ParameterAccepted valuesRemarks
asynctrue / falseFile import will be done asynchronously if trueFile import will be done synchronously if falsedefault false

Path parameters #

ParameterAccepted valuesRemarks
<filename>StringThe path the file should be saved inside the file repository.Be mindful to use the correct extension as the file import processor will be determined on that.

Request Body #

The body should be the Enactor configuration file as a stream.

Response Body #

If the request is asynchronous, the response will be the scheduled job reference number as shown below.

  jobReference: 1

If the request is synchronous, the response will be the number of imported records as shown below.

  recordsImported: 10

Status Code #

Status CodeStatus DescriptionDescription
200SuccessThe request is successful and will give the above response.
400Bad RequestThe request has incorrect request parameters which are not acceptable
500Server ErrorUnexpected error occurred while processing the request

Guide to Integrate #

JavaScript (NodeJS) Example #

const fetch = require('node-fetch');
const fs = require('fs');
const assert = require('assert').strict;

const BASE_URL = "{Enactor Rest API Base URL}/rest/configuration";

fetch(BASE_URL + '/import/', {
    method: 'post',
    headers: {
        'Authorization': 'Basic aW5zdGFsbDppbnN0YWxs',
        'Content-Type': 'application/zip',
        'Content-MD5': '0b04633be98c35777f72f70d0edde41a',
        'x-enactor-default-user-password': 'new_pw'
    body: fs.createReadStream('')
}).then(res => assert.equal(res.status, 200))
    .catch(err => console.log(err.message))
Go to Top