0% found this document useful (0 votes)
125 views

Planetpress Connect Rest API Cookbook

Uploaded by

dindoll5599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views

Planetpress Connect Rest API Cookbook

Uploaded by

dindoll5599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 524

REST API Cookbook with

Working Examples
Version: 1.7.1
REST API Cookbook with Working Examples
Version 1.7.1
Last Revision: 2017-10-30

Objectif Lune, Inc.


2030 Pie-IX, Suite 500
Montréal, QC, Canada, H1V 2C8

+1 (514) 875-5863
www.objectiflune.com

All trademarks displayed are the property of their respective owners.


© Objectif Lune, Inc. 1994-2017. All rights reserved. No part of this documentation may be
reproduced, transmitted or distributed outside of Objectif Lune Inc. by any means whatsoever
without the express written permission of Objectif Lune Inc. Objectif Lune Inc. disclaims
responsibility for any errors and omissions in this documentation and accepts no responsibility
for damages arising from such inconsistencies or their further consequences of any kind.
Objectif Lune Inc. reserves the right to alter the information contained in this documentation
without notice.

Page 4
Table of Contents
Table of Contents 5
Welcome to the PlanetPress Connect REST API Cookbook 11
Technical Overview 12
Workflow & Workflow Processes 13
Data Mapping 14
Content Creation 15
Job Creation 16
Output Creation 17
All-In-One 18
Input Files 20
Data Entities 21
Data Set & Data Record Entities 21
Content Set & Content Item Entities 22
Job Set & Job Entities 23
Workflow Operations 25
Asynchronous Operations 25
Synchronous Operations 26
JSON Structures 27
Common Structures 27
Specific Structures 30
Working Examples 65
Getting Started 66
Requirements & Installation 67
Structure of the Working Examples 69
HTML Input Placeholders & Multiple Value Fields 71
Display of Working Example Results 72
Using the Working Examples with Server Security 74
Server Security & Authentication 75
Authenticating with the Server 76
Working with the File Store 80
Uploading a Data File to the File Store 81
Uploading a Data Mapping Configuration to the File Store 87
Uploading a Design Template to the File Store 93

Page 5
Uploading a Job Creation Preset to the File Store 99
Uploading an Output Creation Preset to the File Store 105
Working with the Entity Services 111
Finding Specific Data Entities in the Server 112
Finding all the Data Sets in the Server 144
Finding the Data Records in a Data Set 147
Finding all the Content Sets in the Server 151
Finding the Content Items in a Content Set 154
Finding all the Job Sets in the Server 158
Finding the Jobs in a Job Set 161
Working with the Workflow Services 164
Running a Data Mapping Operation 165
Running a Data Mapping Operation (Using JSON) 172
Running a Data Mapping Operation for PDF/VT File (to Data Set) 179
Running a Data Mapping Operation for PDF/VT File (to Content Set) 186
Running a Content Creation Operation for Print 193
Running a Content Creation Operation for Print By Data Record (Using JSON) 200
Running a Content Creation Operation for Email By Data Record (Using JSON) 207
Creating Content for Web By Data Record 218
Creating Content for Web By Data Record (Using JSON) 224
Running a Job Creation Operation (Using JSON) 230
Running an Output Creation Operation 237
Running an Output Creation Operation (Using JSON) 245
Running an Output Creation Operation By Job (Using JSON) 253
Running an All-In-One Operation (Using JSON) 261
REST API Reference 277
Authentication Service 282
Service Handshake 283
Authenticate/Login to Server 284
Service Version 286
Content Creation Service 287
Service Handshake 288
Process Content Creation 289
Process Content Creation (By Data Record) (JSON) 291
Create Preview PDF 293
Create Preview PDF (JSON) 295
Create Preview PDF (By Data Record) 297

Page 6
Get All Operations 299
Get Progress of Operation 300
Get Result of Operation 302
Cancel an Operation 304
Service Version 305
Content Item Entity Service 306
Service Handshake 307
Get Data Record for Content Item 308
Get Content Item Properties 310
Update Content Item Properties 312
Update Multiple Content Item Properties 314
Service Version 316
Content Set Entity Service 317
Get All Content Set Entities 318
Get Content Items for Content Set 319
Get Page Details for Content Set 321
Delete Content Set Entity 323
Get Content Set Properties 325
Update Content Set Properties 327
Service Version 329
Data Record Entity Service 330
Service Handshake 331
Add Data Records 332
Get Data Record Values 334
Update Data Record Values 336
Get Data Record Properties 338
Update Data Record Properties 340
Get Multiple Data Record Values 342
Update Multiple Data Record Values 344
Update Multiple Data Record Properties 346
Service Version 348
Data Set Entity Service 349
Get All Data Set Entities 350
Get Data Records for Data Set 351
Delete Data Set Entity 352
Get Data Set Properties 354
Update Data Set Properties 356

Page 7
Service Version 358
Data Mapping Service 359
Service Handshake 360
Process Data Mapping 361
Process Data Mapping (JSON) 363
Process Data Mapping (PDF/VT to Data Set) 366
Process Data Mapping (PDF/VT to Content Set) 368
Get All Operations 370
Get Progress of Operation 371
Get Result of Operation 373
Cancel an Operation 375
Service Version 376
Document Entity Service 377
Service Handshake 378
Get Document Metadata Properties 379
Update Document Metadata Properties 381
Service Version 383
Document Set Entity Service 384
Service Handshake 385
Get Documents for Document Set 386
Get Document Set Metadata Properties 388
Update Document Set Metadata Properties 390
Service Version 392
Content Creation (Email) Service 393
Service Handshake 394
Process Content Creation (By Data Record) (JSON) 395
Get All Operations 397
Get Progress of Operation 398
Get Result of Operation 400
Cancel an Operation 402
Service Version 404
Entity Service 405
Service Handshake 406
Find Data Entity 407
Service Version 409
File Store Service 410
Service Handshake 411

Page 8
Download Managed File or Directory 412
Delete Managed File or Directory 414
Upload Data Mapping Configuration 416
Upload Job Creation Preset 418
Upload Data File 420
Upload Design Template 422
Upload Output Creation Preset 424
Service Version 426
Content Creation (HTML) Service 427
Service Handshake 428
Process Content Creation (By Data Record) 429
Process Content Creation (By Data Record) (JSON) 431
Get Template Resource 433
Service Version 435
Job Creation Service 436
Service Handshake 437
Process Job Creation 438
Process Job Creation (JSON) 440
Process Job Creation (JSON Job Set Structure) 442
Get All Operations 444
Get Progress of Operation 445
Get Result of Operation 447
Cancel an Operation 449
Service Version 450
Job Entity Service 451
Service Handshake 452
Get Content Items for Job 453
Get Job Segments for Job 455
Get Job Metadata Properties 456
Update Job Metadata Properties 458
Get Job Properties 460
Update Job Properties 462
Update Multiple Job Properties 464
Service Version 465
Job Segment Entity Service 466
Service Handshake 467
Get Document Sets for Job Segment 468

Page 9
Get Job Segment Metadata Properties 470
Update Job Segment Metadata Properties 472
Service Version 474
Job Set Entity Service 475
Get All Job Set Entities 476
Get Jobs for Job Set 477
Delete Job Set Entity 478
Get Job Set Metadata Properties 480
Update Job Set Metadata Properties 482
Get Job Set Properties 484
Update Job Set Properties 486
Service Version 488
Output Creation Service 489
Service Handshake 490
Process Output Creation 491
Process Output Creation (JSON) 493
Process Output Creation (By Job) (JSON) 495
Get All Operations 497
Get Progress of Operation 498
Get Result of Operation 500
Get Result of Operation (as Text) 502
Cancel an Operation 504
Service Version 505
All-In-One Service 506
Service Handshake 507
Process All-In-One (JSON) 508
Process All-In-One (Adhoc Data) 510
Get All Operations 514
Get Progress of Operation 515
Get Result of Operation 517
Get Result of Operation (as Text) 519
Cancel an Operation 521
Service Version 522
Copyright Information 523
Legal Notices and Acknowledgments 524

Page 10
Welcome to the PlanetPress Connect
REST API Cookbook
This guide is aimed at technically experienced users who wish to learn and use the REST API
available in PlanetPress Connect version 1.7.1.

The PlanetPress Connect REST API consists of many services that expose access to a
number of areas including workflow, data entity management and file store operations.

These services can be used to perform various interactions with the PlanetPress Connect
server such as:

l Upload & Manage Data Files, Data Mapping Configurations & Design Templates in File
Store
l Create, Manage & Find Data Entities internal to the PlanetPress Connect Server
l Create & Monitor Processing Operations within the Workflow

The REST API also supports added security to restrict unauthorized access to the services.

This guide is broken down into three sections:

l Technical Overview - Overview of the concepts and structures used in PlanetPress


Connect and the REST API
l Working Examples - Working examples of the PlanetPress Connect REST API in action
(HTML5 & JavaScript/jQuery)
l REST API Reference - A complete reference to the PlanetPress Connect REST API &
Services

It is recommended that the technical overview section be read first, followed by the working
examples, using the REST API reference for greater detail on implementing any specific
example.

Page 11
Technical Overview
This section provides an overview of the concepts and structures used within PlanetPress
Connect and the REST API.

l Workflow & Workflow Processes


l Input Files
l Data Entities
l Workflow Operations
l JSON Structures

Page 12
Workflow & Workflow Processes
The primary workflow in PlanetPress Connect consists of four major processes that each
require a number of inputs, and once executed, produce a particular form of output. These
processes are: data mapping, content creation, job creation and output creation.

There is an additional workflow process, named All-In-One, which embodies all four major
workflow processes in a singular process.

The following diagram illustrates the primary workflow in PlanetPress Connect:

Typically an individual workflow process (shown above in blue) will take one or more input files
as input (shown above in green), and will produce either intermediary output in the form of a
data entity (shown above in red), or final output in the form of print, web, or email based content
(depending on the context of the content produced) (shown above in yellow).

Input files to a workflow process include files such as data files, data mapping configurations
and design templates. In most cases an input file needs to be uploaded to the server file store
before it can be used in a workflow process. A file that has been uploaded to the file store is
known as a managed file, and managed files can be referenced via a unique identifier or name.

A data entity is simply a structured data artefact, produced as a result of an instance of a


workflow process known as a workflow operation. Data entities are stored internally to the
server and can also be referenced via a unique identifier.

Where a certain process depends on the output of the process before it, the data entity or
entities produced by the earlier process are used as an input to that process.

Page 13
Data Mapping
The data mapping process involves taking a data file or source, applying a data mapping
configuration to it, and producing a structured set of data or data records (a data set). This
process can also produce a data set or content set from a PDF/VT file using its internal meta
data instead of a data mapping configuration.

The following diagram illustrates the default workflow for the data mapping process:

The following diagram illustrates the alternative workflow for the data mapping process when
using PDF/VT data files specifically:

Page 14
Content Creation
The content creation process involves taking either a data set or one or more data records (from
a data set), combining them with a suitable design template, and producing one or more sets of
content (content sets). If the content is for the Email or Web context then output can be
produced at this stage.

The following diagram illustrates the workflow for the content creation process:

Page 15
Job Creation
The job creation process involves taking one or more content sets and applying a job creation
preset for organizing, sorting and grouping them into a set of logical jobs (a job set). This
includes the application of data filtering and finishing options.

The following diagram illustrates the workflow for the job creation process:

Page 16
Output Creation
The output creation process involves taking either a job set or one or more jobs (from a job set),
applying an output creation preset, and producing the print output (Print context).

The following diagram illustrates the workflow for the output creation process:

Page 17
All-In-One
The All-In-One process embodies all four major workflow processes (data mapping, content
creation, job creation and output creation) in a singular process. It can be configured to run one
or more of the four processes, as long as the processes specified result in a logical sequence
or workflow.

Depending on it's configuration, the All-In-One process can produce either a data set, content
sets, a job set or print output (Print context).

The following diagram illustrates the potential inputs, outputs and workflows for the All-In-One
process:

The following table lists the available processes, input combinations and expected outputs for
the All-In-One process:

Page 18
Processes Input Combination Expected
Output

Data Mapping Only Data File + Data Mapping Configuration Data Set

Data Mapping + Data File + Data Mapping Configuration + Content Set(s)


Content Creation Design Template

Content Creation Only Data Records + Design Template Content Set(s)

Data Mapping + Data File + Data Mapping Configuration + Job Set


Content Creation + Job Design Template
Creation

Content Creation + Job Data Records + Design Template Job Set


Creation

Content Creation + Job Data Records + Design Template + Output Print Output
Creation + Output Creation Preset
Creation

Output Creation Only Jobs + Output Creation Preset Print Output

Data Mapping + Data File + Data Mapping Configuration + Print Output


Content Creation + Job Design Template + Output Creation Preset
Creation + Output
Creation

Data Mapping + Data File + Data Mapping Configuration + Print Output


Content Creation + Job Design Template + Job Creation Preset +
Creation + Output Output Creation Preset
Creation

Page 19
Input Files
Input files are used as input to a specific workflow process. The following table lists the types of
input files used in the PlanetPress Connect workflow:

Name Relevant Workflow File Name Examples


Process

Data File Data Mapping l Promo-EN-10.csv


l Promo-EN-10000.csv
l PDFVT-Data.pdf

Data Mapping Data Mapping l Promo-EN.OL-datamapper


Configuration l Transact-EN.OL-
datamapper

Design Template Content Creation l letter-ol.OL-template


l invoice-ol-transpromo.OL-
template

Job Creation Preset Job Creation l Promo-EN-JC-Config.OL-


jobpreset

Output Creation Preset Output Creation l FX4112_Hold_Config.OL-


outputpreset
l Promo-EN-OC-Config.OL-
outputpreset

Page 20
Data Entities
There are many data entity types used by PlanetPress Connect, but not all data entities can be
accessed through the REST API. The main data entities to be aware of when working with the
API are:

l Data Sets
l Data Records
l Content Sets
l Content Items
l Job Sets
l Jobs

Data Set & Data Record Entities


The data set is the artefact produced by a data mapping operation. It holds the data that was
mapped out of the input data file. A data mapping operation produces a single data set, which
contains as many data records as there are documents.

Each data record contains a collection of data values. The data records in the data set form the
master record, or document record, which typically contains document recipient information.
The master record can also contain a collection of data tables, which form the detail records
that hold data such as invoice line items.

Each data table contains a collection of data records, where each data record contains a
collection of data values and a collection of data tables, and so on.

Page 21
The following diagram illustrates the basic relationship between these entities in the context of
the data mapping process:

The data set and data record entities (shown above in blue) are accessible via the Data Set
Entity and Data Record Entity services.

Content Set & Content Item Entities


The content set is the artefact produced by a content creation operation. It holds all the pages
that were produced by the operation. A content creation operation produces one or more
content sets, which contain as many content items as there were data records given at the start
of the operation.

Because the data records used may have different data set owners, a content set cannot be
linked to a single data set, but rather content items are linked to data records. A content item is
further divided into content sections and content pages.

The following diagram illustrates the basic relationship between these entities in the context of
the content creation process:

Page 22
The content set and content item entities (shown above in blue) are accessible via the Content
Set Entity and Content Item Entity services.

Job Set & Job Entities


The job set is the artefact produced by a job creation operation. It consists of a hierarchical
structure that divides documents into various structures and it basically decides which
documents are to be printed and in what order.

A job creation operation creates a single job set which contains a series of containers where
every level contains one or more of the next level down: jobs, job segments, document sets,
documents and document pages. The last level in the chain, the document pages, contains a
single content item. Hence, at the job creation level, a document may consist of one or more
content items.

The following diagram illustrates the basic relationship between these entities in the context of
the job creation process:

The job set and job entities (shown above in blue) are accessible via the Job Set Entity and
Job Entity services. The job segment, document set and document entities (also shown above
in blue) are accessible via the Job Segment Entity, Document Set Entity and Document Entity
services.

In summary, the following diagram illustrates the basic relationship between all data entities in

Page 23
the overall context of the primary workflow in PlanetPress Connect:

Page 24
Workflow Operations
Each individual process in the overall workflow can potentially be a long running operation.

Accordingly, there are two types of workflow operations possible in the PlanetPress Connect
REST API:

l Asynchronous – the operation is initiated, monitored, and the result returned using
multiple requests (Default)
l Synchronous – the operation is initiated and the result returned using a single request

Asynchronous Operations
Asynchronous workflow operations require the submission of an initial HTTP request to initiate
the operation. Then additional requests are required to monitor progress and retrieve the final
result. All the required detail is included in the HTTP response headers of the initial request,
including the URIs that should be used for further processing.

A successful request will return a response that will include the headers listed in the following
table:

Header Description

operationId The unique id of the operation being processed

Link Contains multiple link headers which provide details on which URI to use to
retrieve further information on the operation:

l Header with rel="progress" - The URL to use to check the progress of


the operation
l Header with rel="result" - The URL to use to retrieve the result of the
operation
l Header with rel="cancel" - The URL to use to cancel the operation

A request made to the progress URI during processing will return a progress percentage value
of 0 to 100, and finally the value of ‘done’ once the operation has completed.

Page 25
A request made to the cancel URI during processing will immediately cancel the operation.

A request made to the result URI after processing has completed will return the final result of
the operation.

This is the default workflow operation type, and this approach is used across most workflow
based services as demonstrated in the Working with the Workflow Services page of the
Working Examples section.

Synchronous Operations
Synchronous workflow operations initiate the operation and retrieve the final result in a single
request.

There are no additional operation related headers returned, and there is no option to either
monitor progress or cancel a running operation.

This approach is only used by specific methods found in the All-In-One workflow service.

Page 26
JSON Structures
The PlanetPress Connect REST API uses various JSON structures to describe certain inputs
and outputs to resource methods.

These structures can be broken down into the following categories:

l Common - Structures that are commonly used throughout the REST API
l Specific - Structures that are used by a specific resource method or service in the REST
API

Common Structures
Common JSON structures used in the PlanetPress Connect REST API include the following:

JSON Identifier

Describes an identifier for a single data entity or managed file in PlanetPress Connect.

The structure consists of an object with a single name/value pair:

l identifier - the data entity or managed file identifier (type of number)

Example:
{
"identifier": 12345
}

JSON Identifier (Named)

Describes a named identifier for a single managed file in PlanetPress Connect.

The structure consists of an object with a single name/value pair:

l identifier - the managed file named identifier (type of string)

Example:
{
"identifier": "Promo-EN-1000.csv"

Page 27
}

JSON Identifier List

Describes a list of identifiers for multiple data entities in PlanetPress Connect.

The structure consists of an object with a single name/value pair:

l identifiers - an array of data entity identifiers (type of number)

Example:
{
"identifiers": [ 12345, 23456, 34567 ]
}

JSON Name/Value List (Properties Only)

Describes a list of properties (each as a name/value pair).

The structure consists of an array of objects each with the following name/value pairs:

l name - the name of the property (type of string)


l value - the value of the property (type of string)

Example:
[
{
"name": "start",
"value": "2015-01-01 00:00:00T-0500"
},
{
"name": "end",
"value": "2015-12-31 23:59:59T-0500"
}
]

JSON Name/Value List

Describes a list of properties (each as a name/value pair) for a data entity of a specific ID.

The structure consists of an object with the following name/value pairs:

Page 28
l id - the data entity identifier (type of number)
l properties - the data entity properties, consisting of an array of objects each with the
following name/value pairs:
l name - the name of the property (type of string)
l value - the value of the property (type of string)

Example:
{
"id": 12345,
"properties": [
{
"name": "start",
"value": "2015-01-01 00:00:00T-0500"
},
{
"name": "end",
"value": "2015-12-31 23:59:59T-0500"
}
]
}

JSON Name/Value Lists

Describes multiple lists of properties (as name/value pairs) for data entities of a specific ID.

The structure consists of an array of JSON Name/Value List structure objects.

Example:
[
{
"id": 12345,
"properties": [
{
"name": "start",
"value": "2015-01-01 00:00:00T-0500"
},
{
"name": "end",
"value": "2015-12-31 23:59:59T-0500"

Page 29
}
]
},
{
"id": 23456,
"properties": [
{
"name": "start",
"value": "2015-01-01 00:00:00T-0500"
},
{
"name": "end",
"value": "2015-12-31 23:59:59T-0500"
}
]
}
]

Specific Structures
Specific JSON structures used in the PlanetPress Connect REST API include the following:

JSON Identifier (with createOnly flag)

Describes an identifier for a single job set entity, along with additional parameters used
specifically in an output creation operation.

The structure consists of an object with the following name/value pairs:

l identifier - the job set entity identifier (type of number)


l createOnly - flag to specify if output is to be only created in the server and not sent to it's
final destination (type of boolean)

Example:
{
"identifier": 12345,
"createOnly": true
}

Page 30
JSON Identifier List (with createOnly flag)

Describes a list of identifiers for multiple job entities, along with additional parameters used
specifically in an output creation operation.

The structure consists of an object with the following name/value pairs:

l identifiers - an array of job entity identifiers (type of number)


l createOnly - flag to specify if output is to be only created in the server and not sent to it's
final destination (type of boolean)

Example:
{
"identifiers": [ 12345, 23456, 34567 ],
"createOnly": true
}

JSON Record Content List

Describes a list of data fields (as name/value pairs), nested data records (if any), along with a
number of additional properties for a data record entity of a specific ID.

Tip
A data record entity (in the record data table) can contain one or more data tables that
each contain one or more data record entities (nested data record entities).
A nested data record entity can itself contain one or more data tables that each contain
one or more nested data record entities, and so on for potentially multiple levels of nested
data tables and data record entities.

A data record entity that contains a data table of nested data record entities is considered
to be the parent of the data record entities contained in that data table (which are
considered to be the children).
See the Data Entities page of the Technical Overview section for further detail on data set
and data record entities.

The structure consists of an object with the following name/value pairs:

Page 31
l id - the data record entity identifier (type of number)
l fields - a list of data fields in the data record entity, consisting of an array of objects
each with the following name/value pairs:
l name - the name of the data field (type of string)
l value - the value of the data field (type of string)
l records - a list of any nested data record entities, consisting of an array of objects each
with the following name/value pairs:
l id - the data record entity identifier (type of number)
l table - the data record entity data table name (type of string)
l parentrecordid - the data record entity identifier of parent entity (type of number)
l fields - a list of data fields in the data record entity, consisting of an array of
objects each with the following name/value pairs:
l name - the name of the data field (type of string)
l value - the value of the data field (type of string)

Specific to data record entities that are children of a data set entity (data record entities in the
record data table), two additional name/value pairs are included:

l table - the data record entity data table name (value of record) (type of string)
l datasetid - the data set entity identifier of parent entity (type of number)

Specific to nested data record entities that are children of a data record entity, two additional
name/value pairs are included:

l table - the data record entity data table name (type of string)
l parentrecordid - the data record entity identifier of parent entity (type of number)

Examples:
{
"id": 12345,
"table": "record",
"datasetid": 34567,
"fields":[
{
"name": "ID",
"value": "CU00048376"

Page 32
},
{
"name": "Gender",
"value": "M."
},
{
"name": "FirstName",
"value": "Benjamin"
},
{
"name": "LastName",
"value": "Verret"
}
]
}
{
"id": 45678,
"table": "detail",
"parentrecordid": 23456,
"fields": [
{
"name": "ItemNumber",
"value": "PSM002"
},
{
"name": "ItemDesc",
"value": "PSM Production (unlimited)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "2"
},
{
"name": "ItemTotal",
"value": "990.00"
}
]
}

Page 33
{
"id": 23456,
"table": "record",
"datasetid": 12345,
"fields": [
{
"name": "ID",
"value": "CU00048376"
},
{
"name": "Date",
"value": "2012-03-29T13:00Z"
},
{
"name": "DueDate",
"value": "2012-04-28T14:00Z"
},
{
"name": "InvNumber",
"value": "INV9441991"
},
{
"name": "Gender",
"value": "M."
},
{
"name": "FirstName",
"value": "Benjamin"
},
{
"name": "LastName",
"value": "Verret"
}
{
"name": "TotalOrdered",
"value": "3"
},
{
"name": "InvSubTotal",
"value": "1485.00"
},
{
"name": "InvTaxTotal",

Page 34
"value": "111.38"
},
{
"name": "InvTotal",
"value": "1596.38"
}
],
"records": [
{
"id": 45678,
"table": "detail",
"parentrecordid": 23456,
"fields": [
{
"name": "ItemNumber",
"value": "PSM002"
},
{
"name": "ItemDesc",
"value": "PSM Production (unlimited)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "2"
},
{
"name": "ItemTotal",
"value": "990.00"
}
]
},
{
"id": 45679,
"table": "detail",
"parentrecordid": 23456,
"fields": [
{
"name": "ItemNumber",
"value": "PSM005"

Page 35
},
{
"name": "ItemDesc",
"value": "Upgrade (Starter to Web)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "1"
}
{
"name": "ItemTotal",
"value": "495.00"
}
]
}
]
}

JSON Record Content Lists

Describes multiple lists of data field values (as name/value pairs), nested data records (if any),
along with a number of additional properties for data record entities of a specific ID.

The structure consists of an array of JSON Record Content List structure objects.

Example:
[
{
"id": 45678,
"table": "detail",
"parentrecordid": 23456,
"fields": [
{
"name": "ItemNumber",
"value": "PSM002"
},
{
"name": "ItemDesc",

Page 36
"value": "PSM Production (unlimited)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "2"
},
{
"name": "ItemTotal",
"value": "990.00"
}
]
},
{
"id": 45679,
"table": "detail",
"parentrecordid": 23456,
"fields": [
{
"name": "ItemNumber",
"value": "PSM005"
},
{
"name": "ItemDesc",
"value": "Upgrade (Starter to Web)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "1"
}
{
"name": "ItemTotal",
"value": "495.00"
}
]
}

Page 37
]

JSON Record Content List (Fields Only)

Describes a list of data field values (as name/value pairs) for a data record, used to update an
existing data record entity of a specific ID.

The structure consists of an object with the following name/value pairs:

l id - the data record entity identifier (type of number)


l fields - a list of data fields in the data record entity, consisting of an array of objects
each with the following name/value pairs:
l name - the name of the data field (type of string)
l value - the value of the data field (type of string)

Example:
{
"id": 12345,
"fields": [
{
"name": "FirstName",
"value": "Benjamin"
},
{
"name": "LastName",
"value": "Verret"
}
]
}

JSON Record Content Lists (Fields Only)

Describes multiple lists of data field values (as name/value pairs) for a data record, used to
update existing data record entities of a specific ID.

The structure consists of an array of JSON Record Content List (Fields Only) structure objects.

Example:
[
{
"id": 12345,

Page 38
"fields": [
{
"name": "FirstName",
"value": "Benjamin"
},
{
"name": "LastName",
"value": "Verret"
}
]
},
{
"id": 23456,
"fields": [
{
"name": "FirstName",
"value": "Dianne"
},
{
"name": "LastName",
"value": "Straka"
}
]
}
]

JSON New Record List

Describes a list of new data records (and their data field values (as name/value pairs)) to be
added as data record entities to either an existing data set or data record entity of a specific ID.

The structure consists of an object with the following name/value pairs:

l records - a list of the new data records to be added, consisting of an array of objects
each with the following name/value pairs:
l fields - a list of data fields for the data record, consisting of an array of objects
each with the following name/value pairs:
l name - the name of the data field (type of string)
l value - the value of the data field (type of string)

Page 39
Specific to the adding of data records to the record data table of an existing data set entity, an
additional name/value pair is included:

l datasetid - the data set entity identifier of parent entity (type of number)

Specific to the adding of nested data records to a data table of an existing data record entity,
two additional name/value pairs are included:

l recordid - the data record entity identifier of parent entity (type of number)
l table - the data record entity data table name (type of string)

Examples:
{
"datasetid": 12345,
"records": [
{
"fields": [
{
"name": "ID",
"value": "CU00048376"
},
{
"name": "Gender",
"value": "M."
},
{
"name": "FirstName",
"value": "Benjamin"
},
{
"name": "LastName",
"value": "Verret"
}
]
},
{
"fields":[
{
"name": "ID",
"value": "CU01499303"
},

Page 40
{
"name": "Gender",
"value": "Miss"
},
{
"name": "FirstName",
"value": "Dianne"
},
{
"name": "LastName",
"value": "Straka"
}
]
}
]
}
{
"recordid": 12345,
"table": "detail",
"records": [
{
"fields": [
{
"name": "ItemNumber",
"value": "PSM002"
},
{
"name": "ItemDesc",
"value": "PSM Production (unlimited)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "2"
},
{
"name": "ItemTotal",
"value": "990.00"
}

Page 41
]
},
{
"fields": [
{
"name": "ItemNumber",
"value": "PSM005"
},
{
"name": "ItemDesc",
"value": "Upgrade (Starter to Web)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "1"
},
{
"name": "ItemTotal",
"value": "495.00"
}
]
}
]
}

JSON New Record Lists

Describes multiple lists of new data records (and their data field values (as name/value pairs))
to be added as data record entities to either existing data set or data record entities of a specific
ID.

The structure consists of an array of JSON New Record List structure objects.

Example:
[
{
"datasetid": 12345,
"records": [

Page 42
{
"fields": [
{
"name": "ID",
"value": "CU00048376"
},
{
"name": "Gender",
"value": "M."
},
{
"name": "FirstName",
"value": "Benjamin"
},
{
"name": "LastName",
"value": "Verret"
}
]
},
{
"fields": [
{
"name": "ID",
"value": "CU01499303"
},
{
"name": "Gender",
"value": "Miss"
},
{
"name": "FirstName",
"value": "Dianne"
},
{
"name": "LastName",
"value": "Straka"
}
]
}
]
},
{

Page 43
"recordid": 12345,
"table": "detail",
"records": [
{
"fields": [
{
"name": "ItemNumber",
"value": "PSM002"
},
{
"name": "ItemDesc",
"value": "PSM Production (unlimited)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",
"value": "2"
},
{
"name": "ItemTotal",
"value": "990.00"
}
]
},
{
"fields": [
{
"name": "ItemNumber",
"value": "PSM005"
},
{
"name": "ItemDesc",
"value": "Upgrade (Starter to Web)"
},
{
"name": "ItemUnitPrice",
"value": "495.00"
},
{
"name": "ItemOrdered",

Page 44
"value": "1"
},
{
"name": "ItemTotal",
"value": "495.00"
}
]
}
]
}
]

JSON Content Item Identifier List

Describes a list of content item/data record entity identifier pairs (as name/value pairs) for a
specific content set entity.

The structure consists of an object with the following name/value pairs:

l identifiers - the data entity identifier pairs, consisting of an array of objects each with
the following name/value pairs:
l item - the content item entity identifier (type of number)
l record - the data record entity identifier (type of number)

Example:
{
"identifiers": [
{
"item": 12345,
"record": 54321
},
{
"item": 23456,
"record": 65432
},
{
"item": 34567,
"record": 76543
}
]
}

Page 45
JSON Data Record Identifier

Describes a single data record entity identifier for a specific content item entity.

The structure consists of an object with a single name/value pair:

l record - the data record entity identifier (type of number)

Example:
{
"record": 12345
}

JSON Identifier List (with Email Parameters)

Describes a list of identifiers for multiple data entities (specifically data record entities), along
with additional parameters used specifically in an content creation operation for email.

The structure consists of an object with the following name/value pairs:

l identifiers - an array of data record entity identifiers (type of number)


l host - the network address or name of the SMTP mail server through which emails will be
sent (type of string)
l user - the user name to authenticate with (if using authentication) (type of string)
l password - the password to authenticate with (if using authentication) (type of string)
l sender - the email address to be shown as the sender in the email output (type of string)
l useAuth - parameter to specify if authentication is to be used with the mail server (type of
boolean)
l useStartTLS - parameter to specify if Transport Layer Security (TLS) is to be used when
sending emails (type of boolean)
l useSender - parameter to specify if the sender address will be used as the receiver
address for all emails in the output (type of boolean)
l attachWebPage - parameter to specify if a single HTML web page (with embedded
resources) of the Web context should also be created and attached to the email output
(type of boolean)
l attachPdfPage - parameter to specify if a PDF of the Print context should also be created
and attached to the email output (type of boolean)

Page 46
Example:
{
"identifiers": [
12345,
23456
],
"host": "mail.company.com",
"user": "johns",
"password": "password5",
"sender": "[email protected]",
"useAuth": true,
"useStartTLS": false,
"useSender": true,
"attachWebPage": true,
"attachPdfPage": true
}

JSON HTML Parameters List

Describes a list of parameters used specifically in the creation of web content.

The structure consists of an object with the following name/value pairs:

l section - the section within the Web context of the template to use (type of string)
l inline - the inline mode to be used in the creation of content (value of either NONE, CSS or
ALL) (type of string)

Example:
{
"section": "Section 1",
"inline": "ALL"
}

JSON Job Set Structure

Describes a job set entity structure including the arrangement of job, job segment, document
set, document and content item entities (including the specification of content item identifiers).
Used specifically in a job creation operation.

The structure consists of an object with the following name/value pairs:

Page 47
l jobs - the job entities within the job set, consisting of an array of objects each with the
following name/value pairs:
l segments - the job segment entities within a job, consisting of an array of objects
each with the following name/value pairs:
l documentsets - the document set entities within a job segment, consisting of
an array of objects each with the following name/value pairs:
l documents - the document entities within a document set, consisting of
an array of objects each with the following name/value pairs:
l documentpages - the document pages within a document,
consisting of an array of objects each with a single name/value
pair:
l contentitem - the identifier of the content item entity within a
document page (type of number)

Example:
{
"jobs": [
{
"segments": [
{
"documentsets": [
{
"documents": [
{
"documentpages": [
{
"contentitem": 111
},
{
"contentitem": 222
}
]
},
{
"documentpages": [
{
"contentitem": 456
}
]

Page 48
}
]
}
]
}
]
},
{
"segments": [
{
"documentsets": [
{
"documents": [
{
"documentpages": [
{
"contentitem": 789
}
]
}
]
}
]
}
]
}
]
}

JSON All-In-One Configuration

Describes the configuration of an All-In-One operation as a series of name/value pairs


representing the processes (data mapping, content creation, job creation and output creation) to
be completed as part of the overall operation. The value in each pair contains the parameters
for that specific process.

The structure is variable, allowing for configurations containing one or more specific processes
(as name/value pairs), as long as the processes specified result in a logical sequence or
workflow. Used specifically with the All-In-One service.

The structure consists of an object with the following name/value pairs:

Page 49
l datamining - data mapping configuration parameters, consisting of an object with the
following name/value pairs:
l identifier - the managed file identifier (type of number) or named identifier (type of
string) of the data file
l config - the managed file identifier (type of number) or named identifier (type of
string) of the data mapping configuration

l contentcreation - content creation configuration parameters, consisting of an object with


the following name/value pairs:
l identifiers - an array of data record entity identifiers (type of number) (optional for
configurations containing data mapping parameters)
l config - the managed file identifier (type of number) or named identifier (type of
string) of the input design template

l jobcreation - job creation configuration parameters, consisting of an object with the


following name/value pairs:
l config - the managed file identifier (type of number) or named identifier (type of
string) of the job creation preset (optional)

l outputcreation - output creation configuration parameters, consisting of an object with


the following name/value pairs:
l identifiers - an array of job entity identifiers (type of number) (optional for
configurations containing content creation parameters)
l config - the managed file identifier (type of number) or named identifier (type of
string) of the output creation preset
l createOnly - flag to specify if output is to be only created in the server and not sent
to it's final destination (type of boolean)

Specific to the use of all processes (and their parameters), an additional name/value pair can
be added to restrict the print output to a set of specific records in the input data:

l printRange - print range configuration parameters, consisting of an object with a single


name/value pair:
l printRange - the range of records in the data file to output (type of string).

Page 50
Examples:
{
"datamining":
{
"identifier": "Promo-EN-1000.csv",
"config": "Promo-EN.OL-datamapper"
},
"contentcreation":
{
"config": "letter-ol.OL-template"
},
"jobcreation":
{
"config": "4567"
},
"outputcreation":
{
"config": "5678",
"createOnly": true
},
"printRange":
{
"printRange": "1-3, 6, 10"
}
}
{
"contentcreation":
{
"identifiers": [
34567,
34568
],
"config": "letter-ol.OL-template"
},
"jobcreation": {},
"outputcreation":
{
"config": 5678,
"createOnly": false
}
}

Page 51
{
"datamining":
{
"identifier": 12345,
"config": 23456
}
}

JSON Page Details Summary

Describes a summary of the page details for a specific content set entity.

Page details include the number of pages per media type, along with media specific properties
including the name, size, width and height. Used specifically with the Content Set Entity
service.

The structure consists of an object with the following name/value pairs:

l pages - a list of the total pages per media, consisting of an array of objects each with the
following name/value pairs:
l count - the number of pages using the specific media (type of number)
l media - media specific properties, consisting of an object with the following
name/value pairs:
l name - the name of the media (type of string)
l size - the size of the media (type of string)
l width - the width of the media (type of string)
l height - the height of the media (type of string)

Example:
{
"pages": [
{
"count": 200,
"media": {
"name": "Plain A4 Paper",
"size": "A4",
"width": "210mm",
"height": "297mm"
}
},

Page 52
{
"count": 108,
"media": {
"name": "Plain Letter Paper",
"size": "Letter",
"width": "8.5in",
"height": "11in"
}
}
]
}

JSON Page Details List

Describes a list of the the page details and identifiers for each content item contained within a
specific content set entity.

Page details include the number of pages per media type, along with media specific properties
including the name, size, width and height. Used specifically with the Content Set Entity
service.

The structure consists of an array of objects each with the following name/value pairs:

l id - the content item entity identifier (type of number)


l pages - a list of the pages per media, consisting of an array of objects each with the
following name/value pairs:
l count - the number of pages using the specific media (type of number)
l media - media specific properties, consisting of an object with the following
name/value pairs:
l name - the name of the media (type of string)
l size - the size of the media (type of string)
l width - the width of the media (type of string)
l height - the height of the media (type of string)

Example:
[
{
"id": 12345,
"pages": [

Page 53
{
"count": 2,
"media": {
"name": "Plain A4 Paper",
"size": "A4",
"width": "210mm",
"height": "297mm"
}
},
{
"count": 1,
"media": {
"name": "Plain Letter Paper",
"size": "Letter",
"width": "8.5in",
"height": "11in"
}
}
]
},
{
"id": 23456,
"pages": [
{
"count": 2,
"media": {
"name": "Plain A4 Paper",
"size": "A4",
"width": "210mm",
"height": "297mm"
}
},
{
"count": 2,
"media": {
"name": "Plain Letter Paper",
"size": "Letter",
"width": "8.5in",
"height": "11in"
}
}
]
}

Page 54
]

JSON Data Mapping Validation Result

Describes the result of a request to validate a data mapping operation, including a list of any
errors that occurred (used specifically with the Data Mapping service).

The structure consists of an object with the following name/value pairs:

l result - the overall result of the data mapping operation (value of either ERROR or OK) (type
of string)
l recordcount - the number of data records in the data file (type of number)
l errors - a list of errors that occurred during the mapping process, consisting of an array
of objects each with the following name/value pairs:
l record - the number of the erroneous record in the data file (type of number)
l reason - the mapping error/reason for this particular record (type of string)

Example:
{
"result": "ERROR",
"recordcount": 105,
"errors": [
{
"record": 20,
"reason": "Document: 20 Unparseable date: \"\""
},
{
"record": 45,
"reason": "Document: 45 Unparseable date: \"\""
},
{
"record": 97,
"reason": "Document: 97 Unparseable date: \"\""
}
]
}

JSON Search Parameters

Describes a set of complex search criteria broken into search, sorting and grouping rules. This
structure is used specifically with the Entity service as input to the Find Data Entity resource

Page 55
method.

Search rules can be added to a search rules list and can be used to match data entities based
on specific criteria. This rules list also specifies an operator which determines whether all rules
or only one rule in the list is required to be matched.

Search rules can be based on data record values, data entity properties, finishing options,
document length, template names and whether an entity's identifier is contained or not
contained in a list of identifiers.

Rule groups can also be added to this search rules list, and each rule group contains it's own
sub list of search rules and its' own rule operator. Rule groups can also be added to the search
rule list of an existing rule group which allows for the construction of complex search criteria.

Sorting rules can be also added to a sort rules list and (depending on the data entity type) can
be used to sort data entity entries in the search results by either data record values or data
entity properties.

Every sort rule added will expand the value of the sort key of each entry listed in the resulting
JSON Identifier Lists (with Sort Key) structure.

Grouping rules can be also added to a group rules list and (depending on the data entity type)
can be used to group data entity entries in the search results by either data record values or
data entity properties.

Every group rule added can expand the number of sub lists contained in the resulting JSON
Identifier Lists (with Sort Key) structure.

Note
Certain search, sorting or grouping rules can only be used with specific data entity types.
See the Finding Specific Data Entities in the Server page of the Working Examples
section for further detail on the available rule combinations.

The structure consists of an object with the following name/value pairs:

Page 56
l entity - the data entity type (value of either DATARECORDS, DATASETS, CONTENTITEMS,
CONTENTSETS, JOBS or JOBSETS) (type of string)
l search - search criteria, consisting of an object with the following name/value pairs:
l operator - the search rule operator for the base list of rules (value of either AND or OR)
(type of string)
l rules - a base list of search rules, consisting of an array of objects each with a
specific rule sub-structure depending on the type of rule
l sort - a list of sorting rules, consisting of an array of objects each with the following
name/value pairs:
l name - the name of the data value field or data entity property to sort by (type of
string)
l order - the order that matches to this rule are sorted by (value of either ASC or DESC)
(type of string)
l type - the type of sorting rule (value of either value or property) (type of string)

Sorting rule objects with a type value of value also contain the following additional
name/value pair:

l numeric - whether the data value field is a of a numeric type (type of boolean)

l group - a list of grouping rules, consisting of an array of objects each with the following
name/value pairs:
l name - the name of the data value field or data entity property to group by (type of
string)
l order - the order that matches to this rule are grouped by (value of either ASC or
DESC) (type of string)
l type - the type of grouping rule (value of either value or property) (type of string)

Grouping rule objects with a type value of value also contain the following additional
name/value pair:

l numeric - whether the data value field is a of a numeric type (type of boolean)

The search rule sub-structure consists of an object with rule specific groupings of name/value
pairs as follows.

Page 57
Search rule objects with a type value of value contain the following name/value pairs:

l type - the type of search rule (value of value) (type of string)


l name - the name of the data field (type of string)
l value - the value of the data field (type of string, or array of strings when
condition is value of either IN or NOT IN)
l condition - the comparison condition (value of either EQUAL, NOTEQUAL, LESS, GREAT,
LESSEQUAL, GREATEQUAL, STARTSWITH, ENDSWITH, CONTAINS, LIKE, NLIKE, IN or NOT IN)
(type of string)

Search rule objects with a type value of property contain the following name/value pairs:

l type - the type of search rule (value of property) (type of string)


l name - the name of the data entity property (type of string)
l value - the value of the data entity property (type of string, or array of strings
when condition is value of eitherIN or NOT IN)
l condition - the comparison condition (value of either EQUAL, NOTEQUAL, LESS, GREAT,
LESSEQUAL, GREATEQUAL, STARTSWITH, ENDSWITH, CONTAINS, LIKE, NLIKE, IN or NOT IN)
(type of string)

Search rule objects with a type value of either IN or NOT IN contain the following
name/value pairs:

l type - the type of search rule (value of either IN or NOT IN) (type of string)
l identifiers - an array of data entity identifiers (type of number)

Search rule objects with a type value of finishing contain only one of the following sub-
groups of name/value pairs:

l type - the type of search rule (value of finishing) (type of string)


l medianame - the name of the media used (type of string)
l condition - the comparison condition (value of either EQUAL or NOTEQUAL) (type of
string)

l type - the type of search rule (value of finishing) (type of string)


l duplex - whether the page sheet is duplex (type of boolean)

Page 58
l type - the type of search rule (value of finishing) (type of string)
l frontcoating - the front coating of the media used (value of either UNSPECIFIED,
NONE, COATED, GLOSSY, HIGH_GLOSS, INKJET, MATTE, SATIN or SEMI_GLOSS) (type of
string)
l backcoating - the back coating of the media used (value of either UNSPECIFIED, NONE,
COATED, GLOSSY, HIGH_GLOSS, INKJET, MATTE, SATIN or SEMI_GLOSS) (type of string)
l condition - the comparison condition (value of either EQUAL or NOTEQUAL) (type of
string)

l type - the type of search rule (value of finishing) (type of string)


l bindingstyle - the binding style of the media used (value of either NONE, DEFAULT,
STAPLED, GLUED, STITCHED, ADHESIVE, SPINETAPING, RING, WIREDCOMB, PLASTICCOMB or
COIL) (type of string)
l bindingedge - the binding edge of the media used (value of either DEFAULT, LEFT,
RIGHT, TOP or BOTTOM) (type of string)
l bindingtype - the binding type of the media used (value of either DEFAULT, SADDLE,
SIDE or CORNER) (type of string)
l bindingangle - the binding angle of the media used (value of either DEFAULT,
VERTICAL, HORIZONTAL or ANGLE) (type of string)
l condition - the comparison condition (value of either EQUAL or NOTEQUAL) (type of
string)

Search rule objects with a type value of doclength contain the following name/value
pairs:

l type - the type of search rule (value of doclength) (type of string)


l value - the number of pages in document (type of number)
l condition - the comparison condition (value of either EQUAL, NOTEQUAL, LESS, GREAT,
LESSEQUAL or GREATEQUAL) (type of string)

Search rule objects with a type value of templatename contain the following name/value
pairs:

Page 59
l type - the type of search rule (value of templatename) (type of string)
l template - the name of the design template used for document (type of string)
l condition - the comparison condition (value of either EQUAL or NOTEQUAL) (type of
string)

Search rule group objects contain the following name/value pairs:

l operator - the search rule operator for sub-list of rules in rule group (value of either
AND or OR) (type of string)
l rules - a sub-list of search rules, consisting of an array of objects each with a
certain rule sub-structure depending on the type of rule

Examples:
{
"entity": "CONTENTITEMS",
"search": {
"operator": "AND",
"rules": [
{
"type": "value",
"value": "FR",
"name": "Country"
},
{
"operator": "OR",
"rules": [
{
"type": "finishing",
"frontcoating": "HIGH_GLOSS",
"backcoating": "HIGH_GLOSS",
"condition": "EQUAL"
},
{
"type": "finishing",
"bindingstyle": "DEFAULT",
"bindingedge": "DEFAULT",
"bindingtype": "DEFAULT",
"bindingangle": "VERTICAL",
"condition": "EQUAL"
}

Page 60
]
}
]
},
"sort": [
{
"name": "LastName",
"order": "ASC",
"numeric": false,
"type": "value"
}
],
"group": [
{
"name": "Gender",
"order": "ASC",
"numeric": false,
"type": "value"
}
]
}

JSON Identifier Lists (with Sort Key)

Describes a set of search results as a list of one or more sub lists, each containing a list of data
entity identifiers along with a sorting key value for each entry.

Used specifically with the Entity service as the output from the Find Data Entity resource
method, this structure groups the data entity identifiers returned into sortable sub lists of entries.

The order of the entries (including the sort key produced), and the number of sub lists returned
depends on the sorting and grouping rules specified in the JSON Search Parameters structure
previously submitted as input to the Find Data Entity resource method.

The structure consists of an array of object arrays, with each object containing the following
name/value pairs:

l identifier - the data entity identifier (type of number)


l sortkey - the data entity sort key (type of string)

Page 61
Example:
[
[
{
"identifier": 1604,
"sortkey": "NB|Vilma"
},
{
"identifier": 1282,
"sortkey": "NF|Lenard"
},
{
"identifier": 1443,
"sortkey": "NF|Lenard"
},
{
"identifier": 1000,
"sortkey": "SK|Cathleen"
},
{
"identifier": 1121,
"sortkey": "SK|Rachel"
}
]
]

JSON Operations List

Describes a list of workflow operations (specifically asynchronous workflow operations)


actively running on the server, each containing various properties including the type of
workflow operation, it's starting time and it's current progress value.

This structure is used specifically with workflow based services including the Data Mapping,
Content Creation, Content Creation (Email), Job Creation, Output Creation and All-In-One
services.

Note
See the Workflow Operations page of the Technical Overview section for further detail on

Page 62
workflow operations.

The structure consists of an array of objects each with the following name/value pairs:

l id - the workflow operation identifier (type of string)


l type - the workflow operation type (value of either DataMiningRestService,
ContentCreationRestService, EmailExportRestService, JobCreationRestService,
OutputCreationRestService or PrintRestService) (type of string)
l subTask - the workflow operation sub-task name (type of string)
l startTime - the workflow operation starting time stamp (value of milliseconds since
midnight of January 1, 1970 UTC) (type of number)
l progress - the workflow operation progress percentage (value in range of 0 to 100) (type of
number)

Workflow operation objects with a type value of either ContentCreationRestService or


PrintRestService (usually with a subTask value of Content Creation) can also contain the
following name/value pair:

l template - the name of the design template being used for content creation (type of
string)

Example:
[
{
"id": "1281ef9d-7a74-4448-9adf-175a0166f32e",
"type": "DataMiningRestService",
"subTask": "Extracting data 25%",
"startTime": 1482367446908,
"progress": 100
},
{
"id": "b72e2da5-39ea-48de-85cf-a2be321a71bd",
"type": "ContentCreationRestService",
"subTask": "Content Creation",
"startTime": 1482367988332,
"progress": 12,

Page 63
"template": "business-card-ol"
},
{
"id": "134f55a5-85f5-41d5-a0d3-e033eda45cb5",
"type": "EmailExportRestService",
"startTime": 1482368638197,
"progress": 5
},
{
"id": "d52cf2b6-9ca7-44e6-b548-5b249dedf40d",
"type": "JobCreationRestService",
"subTask": "Job Creation",
"startTime": 1482367723483,
"progress": 77
},
{
"id": "02fa495b-ed56-47ef-ac49-e63df298b10e",
"type": "OutputCreationRestService",
"subTask": "Output Creation",
"startTime": 1482367851340,
"progress": 34
},
{
"id": "fb414be9-4ec5-463a-8429-93153db73783",
"type": "PrintRestService",
"subTask": "Content Creation",
"startTime": 1482366891203,
"progress": 65,
"template": "letter-ol"
}
]

Page 64
Working Examples
This section provides a number of working examples that demonstrate the use of the various
resources and methods available in the PlanetPress Connect REST API.

For help on getting started with the PlanetPress Connect REST API Cookbook and the working
examples, see the Getting Started page.

l Server Security & Authentication


l Working with the File Store
l Working with the Entity Services
l Working with the Workflow Services

Page 65
Getting Started
This guide provides many working examples to help illustrate the correct use of a given
API/method. To achieve this, the guide uses HTML5 & JavaScript/jQuery syntax, and thus,
some basic experience and knowledge of these technologies is assumed.

HTML5: http://www.w3schools.com/html/

jQuery: https://jquery.com/

Help on installing and getting started with the working examples can be found on the
Requirements & Installation and Structure of the Working Examples pages.

Important notes on general use of the working examples can be found in the HTML Input
Placeholders & Multiple Value Fields and Display of Working Example Results pages.

If you have server security settings enabled on your PlanetPress Connect server then the Using
the Working Examples with Server Security page should be read also.

Page 66
Requirements & Installation
Requirements

To use the PlanetPress Connect REST API Cookbook with Working Examples source you will
require the following:

1. A working installation of PlanetPress Connect


2. Any modern web browser able to display HTML51

Warning
If using Internet Explorer, you may find issues when using the working examples with
PlanetPress Connect's Server Security Settings set to enabled.
The working examples use HTML5 Local Storage to facilitate authentication and certain
simplicity / ease-of-use (across browser tabs). Depending on how your Internet Explorer
security settings are configured, you may experience issues if the security level of your
zone is set too high.

Essentially, the security zone needs to have the security option Userdata persistence
(under Miscellaneous) set to enabled. Without this option enabled, the working
examples will not function correctly when using them with PlanetPress Connect's Server
Security Settings set to enabled.
After running the Authenticate/Login to Server working example to re-authenticate, you
should only need to refresh existing pages in order for the authentication credentials
(token) to be picked up. In the case of Internet Explorer, you may need to restart the
browser for the changes to be picked up.

If all else fails, disabling of the Sever Security Settings in the PlanetPress Connect
Server Preferences should avoid issues with running the various examples on Internet
Explorer.
It is recommended that you use a modern web-browser other than Internet Explorer
when running the working examples.

1Any recent version of Mozilla Firefox, Google Chrome, or Opera with support for HTML5 should be
suitable for running the working examples contained in this guide. Versions of Internet Explorer 10+ may
also be suitable in some cases.
Page 67
Installation

The working examples source comes pre-installed with PlanetPress Connect and can be
located in a sub-directory of your existing PlanetPress Connect installation directory.

To locate the source on Windows:

1. Open up Windows Explorer and navigate to the PlanetPress Connect installation


directory followed by its plugins sub-directory.
2. Find the com.objectiflune.serverengine.rest.gui directory and navigate to its www sub-
directory
3. You should now be exploring the following or similar location:
C:\Program Files\Objectif Lune\OL
Connect\plugins\com.objectiflune.serverengine.rest.gui_1.X.XXXXX.XXXXXXXX-
XXXX\www
4. The www directory contains a cookbook sub-directory, which contains all of the working
examples source. You should find a directory structure matching that shown on the
Structure of the Working Examples page.

Note
You can access the PlanetPress Connect REST API Cookbook with Working Examples
source locally by entering the following URL in your web browser:
http://localhost:9340/serverengine/html/cookbook/index.html

Page 68
Structure of the Working Examples
The working examples are designed to be complete examples, and will generally consists of
one HTML5 file paired with a JavaScript/jQuery module which can be found in the
examples/<service-name>/js/ sub-directory.

Where any frequent or boilerplate functionality is commonly used across the examples, this has
been moved to the common/js/common.js JavaScript/jQuery module.

The examples make use of this module for functionality such as setting up the example, and
displaying output results.

Page 69
The examples also make use of some simple CSS classes as defined in
common/css/styles.css and HTML snippets for the presentation of output results.

Page 70
HTML Input Placeholders & Multiple Value Fields
In the working examples, HTML input elements make use of the placeholder attribute to help
provide some indication of the type and format of the value expected to be entered / specified.

The following table lists examples of placeholders commonly used in the working examples:

HTML Expected Type Example Values

Single ID Value l 2341


l 3

Single ID or Name Value (File Name) l 2341


l Promo-EN-1000.csv

One or More ID Values (comma l 2341, 2342


separated) l 3456

Name (Text) Value l ol-admin


l Section 2

Numerical Range l 1, 2, 3
l 1-5
l 1, 2, 3-5, 6

Email Address Value l [email protected]

Server Hostname Value l mailbox.contoso.com

Page 71
Display of Working Example Results
When a working example is run, any results will be displayed in a Results area that will appear
below the working example existing HTML interface.

For example:

Note
In some examples the same result will displayed in both plain and JSON structure based
formats. This is to assist ease-of-use when working with outputs of one example that will
be needed as an input to another example.

Page 72
A working example can be run multiple times, and each time the results will be appended
below allowing you to compare the output of varying inputs. The Clear button can be selected
at any time to clear all existing results.

Page 73
Using the Working Examples with Server Security
If you have the Server Security Settings set to enabled in your PlanetPress Connect Server
Preferences, then you may see the following dialog box initially display when working with the
examples:

In the event of this dialog box, just follow the instructions and either refresh the page or re-
authenticate by running the Authenticating with the Server (Authenticate/Login to Server)
working example covered under the Server Security & Authentication section.

Note
Once re-authenticated, you shouldn’t see this dialog box again for as long as your
session remains active.

Page 74
Server Security & Authentication
This section consists of a number of pages covering various useful working examples:

1. Authenticating with the Server

See the Authentication Service page of the REST API Reference section for further detail.

Note
A complete listing including these examples can be found in the index.html file located
at the root of the working example source code which contains links to all working
examples.

Page 75
Authenticating with the Server
Problem

Your PlanetPress Connect Server is configured to use server security, and you want to
authenticate with the server to obtain the correct access to make future requests.

Solution

The solution is to create a request using the following URI and method type to authenticate with
the server via the Authentication REST service:

Authenticate/Login to Server /rest/serverengine/authentication/login POST

Example

HTML5
auth-login-server.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Authenticate/Login to Server Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/auth-login-server.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Authentication Service - Authenticate/Login to Server
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="username">Username:</label>
<input id="username" type="text"
placeholder="Username" required>
</div>

Page 76
<div>
<label for="password">Password:</label>
<input id="password" type="password"
placeholder="Password" required>
</div>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
auth-login-server.js

/* Authentication Service - Authenticate/Login to Server Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();

var username = $("#username").val(),


password = $("#password").val();

$.ajax({
type: "POST",
url: "/rest/serverengine/authentication/login",
beforeSend: function (xhr) {
var base64 = "Basic " + btoa(username + ":" +
password);
xhr.setRequestHeader("Authorization", base64);
}
})
.done(function (response) {

Page 77
c.displayStatus("User '" + username + "'
Authenticated Successfully");
c.displayResult("Authorization Token",
response);
c.setSessionToken(response);
})
.fail(function (xhr, status, error) {
c.displayStatus("Authentication of User '" +
username + "' failed!");
c.displayResult("Status", xhr.status + " " +
error);
c.displayResult("Error", xhr.responseText);
c.setSessionToken(null);
});
});
});
}(jQuery, Common));

Screenshot & Output

Usage

To run the example simply enter your credentials into the Username and Password fields and
select the Submit button.

Page 78
Once selected, a request containing the credentials will be sent to the server and the result will
be returned and displayed to the Results area.

If authentication was successful then the response will contain an Authorization Token that
can be then used in the submission of future requests to the server.

Discussion

Firstly, we define an event handler that will run in response to the submission of the HTML form
via the selection of the Submit button.

When our event hander function is called, we then obtain the value of the Username and
Password fields. We define two variables, username to hold the value of the Username text
field and password to hold the value of the Password text field.

Next we construct an jQuery AJAX request which will be sent to the Authentication REST
service:

Method type and url arguments are specified as shown earlier.

We specify a beforeSend argument containing a function that will add an additional


Authorization header to the request to facilitate Basic HTTP Authentication. The value of
the Authorization request header is a Base64 digest of the username and password
variables.

When the request is successful or done, a request response is received and the content of that
response is passed as the function parameter response. In the example, we then display the
value of this parameter which should be the new Authorization Token which can then be used
in the submission of future requests to the server.

This is achieved by placing the value of the Authorization Token in the auth_token request
header of a future request. In the example the common function setSessionToken is used to
facilitate this function for all future working example requests.

Further Reading

See the Authentication Service page of the REST API Reference section for further detail.

Page 79
Working with the File Store
This section consists of a number of pages covering various useful working examples:

1. Uploading a Data File to the File Store


2. Uploading a Data Mapping Configuration to the File Store
3. Uploading a Design Template to the File Store
4. Uploading a Job Creation Preset to the File Store
5. Uploading an Output Creation Preset to the File Store

See the File Store Service page of the REST API Reference section for further detail.

Note
A complete listing including these examples can be found in the index.html file located
at the root of the working example source code which contains links to all working
examples.

Page 80
Uploading a Data File to the File Store
Problem

You want to upload a data file to the File Store so that it can be used as part of a Data Mapping
operation.

Solution

The solution is to create a request using the following URI and method type to submit the data
file to the server via the File Store REST service:

Upload Data File /rest/serverengine/filestore/DataFile POST

Example

HTML5
fs-datafile-upload.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Upload Data File Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/fs-datafile-upload.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>File Store Service - Upload Data File Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datafile">Data File:</label>
<input id="datafile" type="file" required>
</div>
</fieldset>
<fieldset>

Page 81
<legend>Options</legend>
<div>
<label for="named">Named:</label>
<input id="named" type="checkbox">
</div>
<div>
<label for="persistent">Persistent:</label>
<input id="persistent" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Actions</legend>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
fs-datafile-upload.js

/* File Store Service - Upload Data File Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var file = $("#datafile")[0].files[0],


named = $("#named").is(":checked"),
persistent = $("#persistent").is(":checked");

var settings = {

Page 82
type: "POST",
url:
"/rest/serverengine/filestore/DataFile?persistent=" + persistent,
data: file,
processData: false,
contentType: "application/octet-stream"
};
if (named) { settings.url += "&filename=" + file.name;
}
$.ajax(settings)
.done(function (response) {
c.displayStatus("Request Successful");
c.displayInfo("Data File '" + file.name + "'
Uploaded Successfully");
c.displayResult("Managed File ID", response);
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 83
Screenshot & Output

Usage

To run the example simply select the Browse button and then select the data file you wish to
upload using the selection dialog box.

Next you can specify the following options to use with the upload of the data file:

l Named - allow this file to be identified/referenced by its Managed File Name as well as its
Managed File ID
l Persistent - make this file persistent in the file store

Note
Only one Managed File in the file store can be associated with a specific name. If two
files are uploaded to the file store under the same name, then only the most recently

Page 84
uploaded file will be associated with (or can be referenced using) that name.

Once the file and options are selected, simply select the Submit button to upload the file to the
server's file store and the resulting Managed File ID for the data file will be returned and
displayed to the Results area.

Discussion

Firstly, we define an event handler that will run in response to the submission of the HTML form
via the selection of the Submit button.

When our event handler function is called, we then obtain a reference to the local data file
previously selected. This is achieved by getting the first value of the files attribute of the HTML
element with the ID of datafile (in this case a file type input HTML element) and storing it in a
variable file.

We also obtain boolean values for the Named and Persistent options (both checkbox type
input HTML elements) and store them in the named and persistent variables respectively.

Next we construct a jQuery AJAX request which will be sent to the File Store REST service.
We use an object called settings to hold the arguments for our request:

Method type and url arguments are specified as shown earlier, with the addition of a
persistent query parameter which specifies whether the file is to be persistent in the file
store when uploaded.

We specify the variable file as the data or contents of the request, a contentType argument
of "application/octet-stream", and because we are sending file data we also specify a
processData argument set to false.

If the Named option is checked in our form, and the named variable is true, then a filename
query parameter is also added which contains the file name of the file selected (file.name).

Lastly, the settings object is passed as an argument to the jQuery AJAX function ajax and the
request is executed.

Page 85
When the request is successful or done, a request response is received and the content of that
response is passed as the function parameter response. In the example, we then display the
value of this parameter which should be the new Managed File ID of the data file in the file
store.

Further Reading

See the File Store Service page of the REST API Reference section for further detail.

Page 86
Uploading a Data Mapping Configuration to the File Store
Problem

You want to upload a data mapping configuration to the File Store so that it can be used as part
of a Data Mapping operation.

Solution

The solution is to create a request using the following URI and method type to submit the data
mapping configuration to the server via the File Store REST service:

Upload Data Mapping /rest/serverengine/filestore/DataMiningConfig POST


Configuration

Example

HTML5
fs-datamapper-upload.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Upload Data Mapping Configuration Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/fs-datamapper-upload.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>File Store Service - Upload Data Mapping Configuration
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datamapper">Data Mapping
Configuration:</label>
<input id="datamapper" type="file" required>

Page 87
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="named">Named:</label>
<input id="named" type="checkbox">
</div>
<div>
<label for="persistent">Persistent:</label>
<input id="persistent" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Actions</legend>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
fs-datamapper-upload.js

/* File Store Service - Upload Data Mapping Configuration Example


*/
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var file = $("#datamapper")[0].files[0],

Page 88
named = $("#named").is(":checked"),
persistent = $("#persistent").is(":checked");

var settings = {
type: "POST",
url:
"/rest/serverengine/filestore/DataMiningConfig?persistent=" +
persistent,
data: file,
processData: false,
contentType: "application/octet-stream"
};
if (named) { settings.url += "&filename=" + file.name;
}
$.ajax(settings)
.done(function (response) {
c.displayStatus("Request Successful");
c.displayInfo("Data Mapping Configuration '" +
file.name + "' Uploaded Successfully");
c.displayResult("Managed File ID", response);
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 89
Screenshot & Output

Usage

To run the example simply select the Browse button and then select the data mapping
configuration you wish to upload using the selection dialog box.

Next you can specify the following options to use with the upload of the data mapping
configuration:

l Named - allow this configuration to be identified/referenced by its Managed File Name as


well as its Managed File ID
l Persistent - make this configuration persistent in the file store

Note
Only one Managed File in the file store can be associated with a specific name. If two

Page 90
files are uploaded to the file store under the same name, then only the most recently
uploaded file will be associated with (or can be referenced using) that name.

Once the configuration and options are selected, simply select the Submit button to upload the
configuration to the server's file store and the resulting Managed File ID for the data mapping
configuration will be returned and displayed to the Results area.

Discussion

Firstly, we define an event handler that will run in response to the submission of the HTML form
via the selection of the Submit button.

When our event handler function is called, we then obtain a reference to the local data mapping
configuration previously selected. This is achieved by getting the first value of the files
attribute of the HTML element with the ID of datamapper (in this case a file type input HTML
element) and storing it in a variable file.

We also obtain boolean values for the Named and Persistent options (both checkbox type
input HTML elements) and store them in the named and persistent variables respectively.

Next we construct a jQuery AJAX request which will be sent to the File Store REST service.
We use an object called settings to hold the arguments for our request:

Method type and url arguments are specified as shown earlier, with the addition of a
persistent query parameter which specifies whether the configuration is to be persistent in
the file store when uploaded.

We specify the variable file as the data or contents of the request, a contentType argument
of "application/octet-stream", and because we are sending file data we also specify a
processData argument set to false.

If the Named option is checked in our form, and the named variable is true, then a filename
query parameter is also added which contains the file name of the configuration selected
(file.name).

Page 91
Lastly, the settings object is passed as an argument to the jQuery AJAX function ajax and the
request is executed.

When the request is successful or done, a request response is received and the content of that
response is passed as the function parameter response. In the example, we then display the
value of this parameter which should be the new Managed File ID of the data mapping
configuration in the file store.

Further Reading

See the File Store Service page of the REST API Reference section for further detail.

Page 92
Uploading a Design Template to the File Store
Problem

You want to upload a design template to the File Store so that it can be used as part of a
Content Creation operation.

Solution

The solution is to create a request using the following URI and method type to submit the
design template to the server via the File Store REST service:

Upload Design Template /rest/serverengine/filestore/template POST

Example

HTML5
fs-designtemplate-upload.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Upload Design Template Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/fs-designtemplate-upload.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>File Store Service - Upload Design Template
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="designtemplate">Design
Template:</label>
<input id="designtemplate" type="file"
required>

Page 93
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="named">Named:</label>
<input id="named" type="checkbox" checked>
</div>
<div>
<label for="persistent">Persistent:</label>
<input id="persistent" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Actions</legend>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
fs-designtemplate-upload.js

/* File Store Service - Upload Design Template Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var file = $("#designtemplate")[0].files[0],


named = $("#named").is(":checked"),

Page 94
persistent = $("#persistent").is(":checked");

var settings = {
type: "POST",
url:
"/rest/serverengine/filestore/template?persistent=" + persistent,
data: file,
processData: false,
contentType: "application/zip"
};
if (named) { settings.url += "&filename=" + file.name;
}
$.ajax(settings)
.done(function (response) {
c.displayStatus("Request Successful");
c.displayInfo("Design Template '" + file.name +
"' Uploaded Successfully");
c.displayResult("Managed File ID", response);
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 95
Screenshot & Output

Usage

To run the example simply select the Browse button and then select the design template you
wish to upload using the selection dialog box.

Next you can specify the following options to use with the upload of the design template:

l Named - allow this template to be identified/referenced by its Managed File Name as well
as its Managed File ID
l Persistent - make this template persistent in the file store

Note
Only one Managed File in the file store can be associated with a specific name. If two
files are uploaded to the file store under the same name, then only the most recently

Page 96
uploaded file will be associated with (or can be referenced using) that name.

Once the template and options are selected, simply select the Submit button to upload the
template to the server's file store and the resulting Managed File ID for the design template will
be returned and displayed to the Results area.

Discussion

Firstly, we define an event handler that will run in response to the submission of the HTML form
via the selection of the Submit button.

When our event handler function is called, we then obtain a reference to the local design
template previously selected. This is achieved by getting the first value of the files attribute of
the HTML element with the ID of designtemplate (in this case a file type input HTML element)
and storing it in a variable file.

We also obtain boolean values for the Named and Persistent options (both checkbox type
input HTML elements) and store them in the named and persistent variables respectively.

Next we construct a jQuery AJAX request which will be sent to the File Store REST service.
We use an object called settings to hold the arguments for our request:

Method type and url arguments are specified as shown earlier, with the addition of a
persistent query parameter which specifies whether the template is to be persistent in the
file store when uploaded.

We specify the variable file as the data or contents of the request, a contentType argument
of "application/zip", and because we are sending file data we also specify a processData
argument set to false.

If the Named option is checked in our form, and the named variable is true, then a filename
query parameter is also added which contains the file name of the template selected
(file.name).

Lastly, the settings object is passed as an argument to the jQuery AJAX function ajax and the
request is executed.

Page 97
When the request is successful or done, a request response is received and the content of that
response is passed as the function parameter response. In the example, we then display the
value of this parameter which should be the new Managed File ID of the design template in the
file store.

Further Reading

See the File Store Service page of the REST API Reference section for further detail.

Page 98
Uploading a Job Creation Preset to the File Store
Problem

You want to upload a job creation preset to the File Store so that it can be used as part of a Job
Creation operation.

Solution

The solution is to create a request using the following URI and method type to submit the job
creation preset to the server via the File Store REST service:

Upload Job Creation /rest/serverengine/filestore/JobCreationConfig POST


Preset

Example

HTML5
fs-jcpreset-upload.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Upload Job Creation Preset Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/fs-jcpreset-upload.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>File Store Service - Upload Job Creation Preset
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="jcpreset">Job Creation
Preset:</label>
<input id="jcpreset" type="file" required>

Page 99
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="named">Named:</label>
<input id="named" type="checkbox">
</div>
<div>
<label for="persistent">Persistent:</label>
<input id="persistent" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Actions</legend>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
fs-jcpreset-upload.js

/* File Store Service - Upload Job Creation Preset Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var file = $("#jcpreset")[0].files[0],


named = $("#named").is(":checked"),

Page 100
persistent = $("#persistent").is(":checked");

var settings = {
type: "POST",
url:
"/rest/serverengine/filestore/JobCreationConfig?persistent=" +
persistent,
data: file,
processData: false,
contentType: "application/xml"
};
if (named) { settings.url += "&filename=" + file.name;
}
$.ajax(settings)
.done(function (response) {
c.displayStatus("Request Successful");
c.displayInfo("Job Creation Preset '" +
file.name + "' Uploaded Successfully");
c.displayResult("Managed File ID", response);
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 101
Screenshot & Output

Usage

To run the example simply select the Browse button and then select the job creation preset you
wish to upload using the selection dialog box.

Next you can specify the following options to use with the upload of the job creation preset:

l Named - allow this preset to be identified/referenced by its Managed File Name as well
as its Managed File ID
l Persistent - make this preset persistent in the file store

Note
Only one Managed File in the file store can be associated with a specific name. If two
files are uploaded to the file store under the same name, then only the most recently

Page 102
uploaded file will be associated with (or can be referenced using) that name.

Once the preset and options are selected, simply select the Submit button to upload the preset
to the server's file store and the resulting Managed File ID for the job creation preset will be
returned and displayed to the Results area.

Discussion

Firstly, we define an event handler that will run in response to the submission of the HTML form
via the selection of the Submit button.

When our event handler function is called, we then obtain a reference to the local job creation
preset previously selected. This is achieved by getting the first value of the files attribute of the
HTML element with the ID of jcpreset (in this case a file type input HTML element) and storing
it in a variable file.

We also obtain boolean values for the Named and Persistent options (both checkbox type
input HTML elements) and store them in the named and persistent variables respectively.

Next we construct a jQuery AJAX request which will be sent to the File Store REST service.
We use an object called settings to hold the arguments for our request:

Method type and url arguments are specified as shown earlier, with the addition of a
persistent query parameter which specifies whether the preset is to be persistent in the file
store when uploaded.

We specify the variable file as the data or contents of the request, a contentType argument
of "application/xml", and because we are sending file data we also specify a processData
argument set to false.

If the Named option is checked in our form, and the named variable is true, then a filename
query parameter is also added which contains the file name of the preset selected
(file.name).

Lastly, the settings object is passed as an argument to the jQuery AJAX function ajax and the
request is executed.

Page 103
When the request is successful or done, a request response is received and the content of that
response is passed as the function parameter response. In the example, we then display the
value of this parameter which should be the new Managed File ID of the job creation preset in
the file store.

Further Reading

See the File Store Service page of the REST API Reference section for further detail.

Page 104
Uploading an Output Creation Preset to the File Store
Problem

You want to upload an output creation preset to the File Store so that it can be used as part of a
Output Creation operation.

Solution

The solution is to create a request using the following URI and method type to submit the output
creation preset to the server via the File Store REST service:

Upload Output Creation /rest/serverengine/filestore/OutputCreationConfig POST


Preset

Example

HTML5
fs-ocpreset-upload.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Upload Output Creation Preset Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/fs-ocpreset-upload.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>File Store Service - Upload Output Creation Preset
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="ocpreset">Output Creation
Preset:</label>
<input id="ocpreset" type="file" required>

Page 105
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="named">Named:</label>
<input id="named" type="checkbox">
</div>
<div>
<label for="persistent">Persistent:</label>
<input id="persistent" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Actions</legend>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
fs-ocpreset-upload.js

/* File Store Service - Upload Output Creation Preset Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var file = $("#ocpreset")[0].files[0],


named = $("#named").is(":checked"),

Page 106
persistent = $("#persistent").is(":checked");

var settings = {
type: "POST",
url:
"/rest/serverengine/filestore/OutputCreationConfig?persistent=" +
persistent,
data: file,
processData: false,
contentType: "application/xml"
};
if (named) { settings.url += "&filename=" + file.name;
}
$.ajax(settings)
.done(function (response) {
c.displayStatus("Request Successful");
c.displayInfo("Output Creation Preset '" +
file.name + "' Uploaded Successfully");
c.displayResult("Managed File ID", response);
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 107
Screenshot & Output

Usage

To run the example simply select the Browse button and then select the output creation preset
you wish to upload using the selection dialog box.

Next you can specify the following options to use with the upload of the output creation preset:

l Named - allow this preset to be identified/referenced by its Managed File Name as well
as its Managed File ID
l Persistent - make this preset persistent in the file store

Note
Only one Managed File in the file store can be associated with a specific name. If two
files are uploaded to the file store under the same name, then only the most recently

Page 108
uploaded file will be associated with (or can be referenced using) that name.

Once the preset and options are selected, simply select the Submit button to upload the preset
to the server's file store and the resulting Managed File ID for the output creation preset will be
returned and displayed to the Results area.

Discussion

Firstly, we define an event handler that will run in response to the submission of the HTML form
via the selection of the Submit button.

When our event handler function is called, we then obtain a reference to the local output
creation preset previously selected. This is achieved by getting the first value of the files
attribute of the HTML element with the ID of ocpreset (in this case a file type input HTML
element) and storing it in a variable file.

We also obtain boolean values for the Named and Persistent options (both checkbox type
input HTML elements) and store them in the named and persistent variables respectively.

Next we construct a jQuery AJAX request which will be sent to the File Store REST service.
We use an object called settings to hold the arguments for our request:

Method type and url arguments are specified as shown earlier, with the addition of a
persistent query parameter which specifies whether the preset is to be persistent in the file
store when uploaded.

We specify the variable file as the data or contents of the request, a contentType argument
of "application/xml", and because we are sending file data we also specify a processData
argument set to false.

If the Named option is checked in our form, and the named variable is true, then a filename
query parameter is also added which contains the file name of the preset selected
(file.name).

Lastly, the settings object is passed as an argument to the jQuery AJAX function ajax and the
request is executed.

Page 109
When the request is successful or done, a request response is received and the content of that
response is passed as the function parameter response. In the example, we then display the
value of this parameter which should be the new Managed File ID of the output creation preset
in the file store.

Further Reading

See the File Store Service page of the REST API Reference section for further detail.

Page 110
Working with the Entity Services
This section consists of a number of pages covering various useful working examples:

1. Finding Specific Data Entities in the Server


2. Finding all the Data Sets in the Server
3. Finding the Data Records in a Data Set
4. Finding all the Content Sets in the Server
5. Finding the Content Items in a Content Set
6. Finding all the Job Sets in the Server
7. Finding the Jobs in a Job Set

See the Entity Service, Data Set Entity Service, Content Set Entity Service and Job Set Entity
Service pages of the REST API Reference section for further detail.

Note
A complete listing including these examples can be found in the index.html file located
at the root of the working example source code which contains links to all working
examples.

Page 111
Finding Specific Data Entities in the Server
Problem

You want to find specific Data Entities stored within the PlanetPress Connect Server based on
a set of search criteria.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Entity REST service:

Find Data Entity /rest/serverengine/entity/find PUT

Example

HTML5
e-find-data-entity.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Find Data Entity Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/e-find-data-entity.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<h2>Entity Service - Find Data Entity Example</h2>
<form>
<fieldset>
<legend>Search Parameters</legend>
<div>
<label for="entity">Entity Type:</label>
<select id="entity">
<option value="DATARECORDS">Data
Records</option>

Page 112
<option value="DATASETS">Data Sets</option>
<option value="CONTENTITEMS">Content
Items</option>
<option value="CONTENTSETS">Content
Sets</option>
<option value="JOBS">Jobs</option>
<option value="JOBSETS">Job Sets</option>
</select>
</div>
</fieldset>
<fieldset id="search">
<legend>Search Rules</legend>
<div>
<label for="rule-type">Rule Type
Selector:</label>
<select id="rule-type">
<option value="value">Data Value</option>
<option value="property">Property
Value</option>
<option value="IN">In List</option>
<option value="NOT IN">Not In List</option>
<option
value="finishing">Finishing</option>
<option value="doclength">Document
Length</option>
<option value="templatename">Template
Name</option>
<option value="group">Rule Group</option>
</select>
</div>
<div id="group" class="rule">
<label for="rule">Rules:</label>
<div id="rule" class="rule-body">
<div class="sub-rules">
<label>No Rules</label>
</div>
<div>
<label for="operator">Rules
Operator:</label>
<select id="operator">
<option value="AND">Match All
Rules</option>
<option value="OR">Match Any

Page 113
Rule</option>
</select>
</div>
<div>
<input id="add-search" type="button"
value="Add Search Rule">
</div>
</div>
</div>
</fieldset>
<fieldset id="sorting">
<legend>Sorting Rules</legend>
<div>
<label for="rule-type">Rule Type
Selector:</label>
<select id="rule-type">
<option value="value">Data Value</option>
<option value="property">Property
Value</option>
</select>
</div>
<div id="group" class="rule">
<label for="rule">Rules:</label>
<div id="rule" class="rule-body">
<div class="sub-rules">
<label>No Rules</label>
</div>
<div>
<input id="add-sorting" type="button"
value="Add Sorting Rule">
</div>
</div>
</div>
</fieldset>
<fieldset id="grouping">
<legend>Grouping Rules</legend>
<div>
<label for="rule-type">Rule Type
Selector:</label>
<select id="rule-type">
<option value="value">Data Value</option>
<option value="property">Property
Value</option>

Page 114
</select>
</div>
<div id="group" class="rule">
<label for="rule">Rules:</label>
<div id="rule" class="rule-body">
<div class="sub-rules">
<label>No Rules</label>
</div>
<div>
<input id="add-grouping" type="button"
value="Add Grouping Rule">
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Actions</legend>
<div>
<input id="reset" type="button" value="Reset">
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

rules.html

<!-- OL Connect REST API Cookbook - Working Examples [Rules HTML


Template] -->
<div id="search-rules">
<div id="group" class="rule">
<label for="rule">Rule Group:</label>
<div id="rule" class="rule-body">
<div class="sub-rules">
<label>No Rules</label>
</div>
<div>
<label for="operator">Rules Operator:</label>
<select id="operator">
<option value="AND">Match All Rules</option>
<option value="OR">Match Any Rule</option>

Page 115
</select>
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Group" />
<input id="add-search" type="button" value="Add
Search Rule" />
</div>
</div>
</div>
<div id="value" class="rule">
<label for="rule">Data Value Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="name">Name:</label>
<input id="name" type="text" placeholder="Name"
required />
</div>
<div>
<label for="condition">Condition:</label>
<select id="condition" data-type="enum-
condition3"/>
</div>
<div>
<label for="value">Value:</label>
<input id="value" type="text" placeholder="Value"
required />
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>
<div id="property" class="rule">
<label for="rule">Property Value Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="name">Name:</label>
<input id="name" type="text" placeholder="Name"
required />
</div>
<div>

Page 116
<label for="condition">Condition:</label>
<select id="condition" data-type="enum-
condition3"/>
</div>
<div>
<label for="value">Value:</label>
<input id="value" type="text" placeholder="Value"
required />
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>
<div id="IN" class="rule">
<label for="rule">In List Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="identifiers">Identifiers:</label>
<input id="identifiers" type="text"
placeholder="1234, 2345, 3456, ..." required />
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>
<div id="NOT IN" class="rule">
<label for="rule">Not In List Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="identifiers">Identifiers:</label>
<input id="identifiers" type="text"
placeholder="1234, 2345, 3456, ..." required />
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>

Page 117
<div id="finishing" class="rule">
<label for="rule">Finishing Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="finishing-type">Type:</label>
<select id="finishing-type">
<option value="medianame">Media Name</option>
<option value="duplex">Duplex</option>
<option value="coating">Coating</option>
<option value="binding">Binding</option>
</select>
</div>
<div class="option">
<label for="condition">Condition:</label>
<select id="condition" data-type="enum-
condition1"/>
</div>
<div class="option">
<label for="medianame">Media Name:</label>
<input id="medianame" type="text"
placeholder="Name" required />
</div>
<div class="option">
<label for="duplex">Duplex:</label>
<input id="duplex" type="checkbox" />
</div>
<div class="option">
<label for="frontcoating">Front Coating:</label>
<div class="input-group">
<select id="frontcoating" data-type="enum-
coating" />
<input class="use-option" type="checkbox"
checked />
</div>
</div>
<div class="option">
<label for="backcoating">Back Coating:</label>
<div class="input-group">
<select id="backcoating" data-type="enum-
coating" />
<input class="use-option" type="checkbox"
checked />
</div>

Page 118
</div>
<div class="option">
<label for="bindingstyle">Binding Style:</label>
<div class="input-group">
<select id="bindingstyle" data-type="enum-
bindingstyle" />
<input class="use-option" type="checkbox"
checked />
</div>
</div>
<div class="option">
<label for="bindingedge">Binding Edge:</label>
<div class="input-group">
<select id="bindingedge" data-type="enum-
bindingedge" />
<input class="use-option" type="checkbox"
checked />
</div>
</div>
<div class="option">
<label for="bindingtype">Binding Type:</label>
<div class="input-group">
<select id="bindingtype" data-type="enum-
bindingtype" />
<input class="use-option" type="checkbox"
checked />
</div>
</div>
<div class="option">
<label for="bindingangle">Binding Angle:</label>
<div class="input-group">
<select id="bindingangle" data-type="enum-
bindingangle" />
<input class="use-option" type="checkbox"
checked />
</div>
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>

Page 119
<div id="doclength" name="document-length-rule" class="rule">
<label for="rule">Document Length Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="condition">Condition:</label>
<select id="condition" data-type="enum-
condition2"/>
</div>
<div>
<label for="value">Value:</label>
<input id="value" type="text" placeholder="Value"
required />
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>
<div id="templatename" class="rule">
<label for="rule">Template Name Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="condition">Condition:</label>
<select id="condition" data-type="enum-
condition1"/>
</div>
<div>
<label for="template">Template:</label>
<input id="template" type="text" placeholder="Name"
required />
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>
</div>
<div id="sorting-grouping-rules">
<div id="value" class="rule">
<label for="rule">Data Value Rule:</label>
<div id="rule" class="rule-body">

Page 120
<div>
<label for="name">Name:</label>
<input id="name" type="text" placeholder="Name"
required />
</div>
<div>
<label for="numeric">Numeric:</label>
<input id="numeric" type="checkbox" />
</div>
<div>
<label for="order">Order:</label>
<select id="order">
<option value="ASC">Ascending</option>
<option value="DESC">Descending</option>
</select>
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>
<div id="property" class="rule">
<label for="rule">Property Value Rule:</label>
<div id="rule" class="rule-body">
<div>
<label for="name">Name:</label>
<input id="name" type="text" placeholder="Name"
required />
</div>
<div>
<label for="order">Order:</label>
<select id="order">
<option value="ASC">Ascending</option>
<option value="DESC">Descending</option>
</select>
</div>
<div>
<input id="remove-rule" type="button" value="Remove
Rule" />
</div>
</div>
</div>

Page 121
</div>
<div id="rule-data-types">
<select id="enum-condition1-options">
<option value="EQUAL" selected="selected">=</option>
<option value="NOTEQUAL">&lt;&gt;</option>
</select>
<select id="enum-condition2-options">
<option value="EQUAL" selected="selected">=</option>
<option value="NOTEQUAL">&lt;&gt;</option>
<option value="LESS">&lt;</option>
<option value="GREAT">&gt;</option>
<option value="LESSEQUAL">&lt;=</option>
<option value="GREATEQUAL">&gt;=</option>
</select>
<select id="enum-condition3-options">
<option value="EQUAL" selected="selected">=</option>
<option value="NOTEQUAL">&lt;&gt;</option>
<option value="LESS">&lt;</option>
<option value="GREAT">&gt;</option>
<option value="LESSEQUAL">&lt;=</option>
<option value="GREATEQUAL">&gt;=</option>
<option value="STARTSWITH">Starts with</option>
<option value="ENDSWITH">Ends with</option>
<option value="CONTAINS">Contains</option>
<option value="LIKE">Like</option>
<option value="NLIKE">Not Like</option>
<option value="IN">In List</option>
<option value="NOT IN">Not In List</option>
</select>
<select id="enum-coating-options">
<option value="UNSPECIFIED" >Unspecified</option>
<option value="NONE" selected="selected">None</option>
<option value="COATED">Coated</option>
<option value="GLOSSY">Glossy</option>
<option value="HIGH_GLOSS">High Gloss</option>
<option value="INKJET">Inkjet</option>
<option value="MATTE">Matte</option>
<option value="SATIN">Satin</option>
<option value="SEMI_GLOSS">Semi Gloss</option>
</select>
<select id="enum-bindingstyle-options">
<option value="NONE">None</option>
<option value="DEFAULT"

Page 122
selected="selected">Default</option>
<option value="STAPLED">Stapled</option>
<option value="GLUED">Glued</option>
<option value="STITCHED">Stitched</option>
<option value="ADHESIVE">Adhesive</option>
<option value="SPINETAPING">Spine Taping</option>
<option value="RING">Ring</option>
<option value="WIREDCOMB">Wired Comb</option>
<option value="PLASTICCOMB">Plastic Comb</option>
<option value="COIL">Coil</option>
</select>
<select id="enum-bindingedge-options">
<option value="DEFAULT"
selected="selected">Default</option>
<option value="LEFT">Left</option>
<option value="RIGHT">Right</option>
<option value="TOP">Top</option>
<option value="BOTTOM">Bottom</option>
</select>
<select id="enum-bindingtype-options">
<option value="DEFAULT"
selected="selected">Default</option>
<option value="SADDLE">Saddle</option>
<option value="SIDE">Side</option>
<option value="CORNER">Corner</option>
</select>
<select id="enum-bindingangle-options">
<option value="DEFAULT"
selected="selected">Default</option>
<option value="VERTICAL">Vertical</option>
<option value="HORIZONTAL">Horizontal</option>
<option value="ANGLE">Angle</option>
</select>
</div>

JavaScript/jQuery
e-find-data-entity.js

/* Entity Service - Find Data Entity Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

Page 123
c.setupExample();

var $allRules;

/** Load Search Rules */


(function () {
var $temp = $("<div>");
$temp.load("snippets/rules.html", function (response,
status, xhr) {
if (status === "success") {
$allRules = $temp;
$("input[type='submit']").removeAttr
("disabled");
$("input[type='button']").removeAttr
("disabled");
} else {
alert("Loading of Search Rules
Unsuccessful!\n\nUnable to load the search rules " +
"from the search rules template. Searching
is currently disabled.");
$("input[type='submit']").attr("disabled",
"disabled");
$("input[type='button']").attr("disabled",
"disabled");
}
});
}());

/** Common Load Rule Function */


function loadRule(ruleCategory, ruleName) {
var $rule = $allRules.find("#" + ruleCategory +
"-rules div.rule[id='" + ruleName + "']").clone();

/** Populate any Data Type References */


$rule.find("select[data-type]").each(function (index,
element) {
var $element = $(element),
dataType = $element.attr("data-type");
var options = $allRules
.find("#rule-data-types")
.find("#" + dataType + "-options")
.children();

Page 124
$element
.empty()
.append(options.clone());
$element.val($element
.find("option[selected]")
.val());
});

/** Allow Rules to be Draggable by Label */


$rule.children("label")
.attr("draggable", "true")
.addClass("draggable");
return $rule;
}

/** Manage the Available Rule Types based on Entity Type */


$("#entity")
.on("click", function (event) {
var $entity = $(event.target);
$entity.data("previous", $entity.val());
})
.on("change", function (event) {
var $entity = $(event.target),
type = $entity.val(),
options = ["property", "IN", "NOT IN",
"group"];
if (type === "DATARECORDS" || type ===
"CONTENTITEMS") {
options.unshift("value");
}
if (type === "CONTENTITEMS") {
options.push("finishing", "doclength");
}
if (type === "CONTENTITEMS" || type ===
"CONTENTSETS") {
options.push("templatename");
}

/** Set Rule Type Selector (Helper Function) */


function setRuleTypeSelector(type, options) {
var $typeSelector = $("fieldset#" + type).find
("#rule-type");
$typeSelector

Page 125
.children()
.each(function (index, element) {
var $element = $(element),
name = $element.val();
if ($.inArray(name, options) < 0) {
$element.attr("hidden", "hidden");
if ($typeSelector.val() === name) {
$typeSelector.val(options[0]);
}
} else {
$element.removeAttr("hidden");
}
});
}

/** Restrict Rule Type Selectors to Entity Specific


Options */
var types = ["search", "sorting", "grouping"],
i;
for (i = 0; i < types.length; i += 1) {
setRuleTypeSelector(types[i], options);
}

/**
* Prompt User & Remove any Existing Rules that are
* incompatible with currently Entity type selected
**/
var $existingRules = $("div.rule"),
incompatible = [];
$existingRules.each(function (index, element) {
if ($.inArray(element.id, options) < 0) {
incompatible.push(index);
}
});
if (incompatible.length > 0) {
if (confirm("The entity type selected isn't
compatible " +
"with some of the existing rules
and these " +
"will need to be removed.\n\nAre "
+
"you sure you wish to continue ?"))
{

Page 126
for (i = 0; i < incompatible.length; i +=
1) {
$($existingRules[incompatible
[i]]).remove();
}
} else {
$entity.val($entity.data("previous"));
}
}
})
.trigger("change");

/** Add the Value & Property "Condition" Change Handler */


var conditionPlaceholder = function (event) {
var $rule = $(event.target).closest(".rule"),
condition = $(event.target).val(),
label = "Value:",
placeholder = "Value";
if (condition === "IN" || condition === "NOT IN") {
label = "Value(s):";
placeholder = "Value1, Value2, Value3, ...";
}
$rule
.find("label[for='value']")
.html(label);
$rule
.find("#value")
.attr("placeholder", placeholder);
};

/** "Select Finishing Type" Change Handler */


var selectFinishingType = function (event) {
var $rule = $(event.target).closest(".rule"),
type = $(event.target).val(),
options;
if (type === "medianame") {
options = ["condition", "medianame"];
} else if (type === "duplex") {
options = ["duplex"];
} else if (type === "coating") {
options = ["condition", "frontcoating",
"backcoating"];
} else if (type === "binding") {

Page 127
options = ["condition", "bindingstyle",
"bindingtype",
"bindingedge", "bindingangle"];
}
if (options) {
$rule
.find("div.rule-body div.option")
.each(function (index, element) {
var $element = $(element),
$input = $element.find("input,
select");
if ($.inArray($input.attr("id"), options) <
0) {
$element.attr("hidden", "hidden");
$input.attr("disabled", "disabled");
} else {
$element.removeAttr("hidden");
$input.removeAttr("disabled");
}
$rule
.find(":visible input.use-option")
.trigger("change", [ false ]);
});
}
};

/** "Toggle Finishing" Options Change Handler */


var useFinishingOption = function (event, validate) {
console.log("Toggle Finishing Options Handler");
event.stopImmediatePropagation();
var $target = $(event.target);
$target
.siblings("select")
.each(function (index, sibling) {
var $sibling = $(sibling);
if ($target.is(":checked")) {
$sibling.removeAttr("disabled");
} else {
$sibling.attr("disabled", "disabled");
}
});
if (validate === undefined || validate) {

Page 128
var $available = $target
.closest("div.rule-body")
.find(":visible input.use-
option"),
checked = 0;
$available.each(function (index, check) {
var $check = $(check);
$check.removeAttr("required");
if ($check.is(":checked")) { checked++; }
});
if (checked < 1) {
$target.attr("required", "required");
}
}
};

/** Process Search Rule Function */


function processSearchRule($rules) {
var rules = [];
$rules
.children("div.rule")
.each(function (index, element) {
var type = element.id,
$body = $(element).children("div.rule-
body"),
rule = { "type": type };
if (type === "IN" || type === "NOT IN") {
var json = c.plainIDListToJson($body
.find
("div>#identifiers")
.val());
rule.identifiers = json.identifiers;
} else if (type === "templatename") {
rule.template = $body
.find("div>#template")
.val();
rule.condition = $body
.find("div>#condition")
.val();
} else if (type === "finishing") {
$body
.find(":visible :input")
.each(function (index, element) {

Page 129
var $child = $(element),
id = $child.attr("id");
if (id !== undefined && $child.attr
("disabled") === undefined) {
if (id === "duplex") {
rule[id] = $child.is
(":checked");
} else if (id !== "finishing-
type" && id !== "remove-rule") {
rule[id] = $child.val();
}
}
});
} else if (type === "group") {
rule = {
"operator": $body
.children("div")
.children("#operator")
.val(),
"rules": processSearchRule
($body.children("div.sub-rules"))
};
} else {
var condition = $body
.find("div>#condition")
.val();
rule.value = $body
.find("div>#value")
.val();
if (type === "doclength") {
rule.value = c.valueToNumber
(rule.value);
} else {
rule.name = $body
.find("div>#name")
.val();
}
if (condition === "IN" || condition ===
"NOT IN") {
rule.value = rule.value.split
(/\s*,\s*/);
}
if (condition !== "EQUAL") {

Page 130
rule.condition = condition;
}
}
if (rule.condition) {
var temp = rule.condition;
delete rule.condition;
rule.condition = temp;
}
rules.push(rule);
});
return rules;
}

/** Add Sorting/Grouping Rule Function */


function addSortGroupRule(event) {
var id = event.target.id,
$rules = $("#" + id.substring(id.indexOf("-") + 1,
id.length)),
type = $rules
.find("#rule-type")
.val();
$rules
.find("div.sub-rules")
.append(loadRule("sorting-grouping", type));
}

$("form")
/** Value, Property & Finishing Rule Change Handlers */
.on("change", "#value.rule #condition",
conditionPlaceholder)
.on("change", "#property.rule #condition",
conditionPlaceholder)
.on("change", "#finishing.rule #finishing-type",
selectFinishingType)
.on("change", "#finishing.rule input.use-option",
useFinishingOption)

/** Remove Rule Handler */


.on("click", "input#remove-rule", function (event) {
var $rule = $(event.target).closest(".rule"),
remove = true;
if ($rule.attr("id") === "group" &&
$rule.find("div.sub-rules div.rule").length

Page 131
> 1) {
if (!confirm("The group rule being removed " +
"contains multiple rules.\n\nAre "
+
"you sure you wish to continue ?"))
{
remove = false;
}
}
if (remove) { $rule.remove(); }
})

/** Add Search Rule Handler */


.on("click", "#add-search", function (event) {
var type = $("#search")
.find("#rule-type")
.val(),
$rule = loadRule("search", type);

$(event.target)
.closest(".rule")
.children("div.rule-body")
.children("div.sub-rules")
.append($rule);

if (type === "finishing") {


$rule
.find("#finishing-type")
.trigger("change");
}
})

/** Add Sorting/Grouping Rule Handler */


.on("click", "#add-sorting", addSortGroupRule)
.on("click", "#add-grouping", addSortGroupRule)

/** Submit Form Rules Handler */


.on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

/** Process & Add Search Rules */

Page 132
var $body = $("#search>div#group").children
("div.rule-body"),
search = {
"entity": $("#entity").val(),
"search": {
"operator": $body
.children("div")
.children("#operator")
.val(),
"rules": processSearchRule
($body.children("div.sub-rules"))
}
};

/** Add Sorting & Grouping Rules */


["sort", "group"].forEach(function (type) {
$("#" + type + "ing div.sub-rules div.rule")
.each(function (index, element) {
var $body = $(element).children
("div.rule-body"),
rule = {
"name": $body
.find("#name")
.val(),
"order": $body
.find("#order")
.val(),
"type": element.id
};
var $numeric = $body.find
("#numeric");
if ($numeric.length) {
rule.numeric = $numeric.is
(":checked");
}
if (!search[type]) { search[type] = [];
}
search[type].push(rule);
});
});

$.ajax({
type: "PUT",

Page 133
url:
"/rest/serverengine/entity/find",
data: JSON.stringify(search),
contentType: "application/json; charset=utf-
8"
})
.done(function (response) {
c.displayStatus("Request Successful");
c.displayHeading("Input Parameters");
c.displaySubResult("JSON Search
Parameters", c.jsonPrettyPrint(search));
c.displayHeading("Search Results");
c.displaySubResult("Plain",
c.jsonIDListsWithSortKeyToTable(response));
c.displaySubResult("JSON Identifier Lists
(with Sort Key)", c.jsonPrettyPrint(response));
})
.fail(c.displayDefaultFailure);
})

/** Reset Form Rules Handler */


.on("click", "#reset", function (event) {
if (confirm("Are you sure you wish to continue ?"))
{
$("div.sub-rules")
.find("div.rule")
.remove();
}
});
});
}(jQuery, Common));

Page 134
Screenshot & Output

Page 135
Page 136
Usage

To run the example first select the Entity Type that you are searching for. The data entity types
available are:

l Data Sets
l Data Records
l Content Sets
l Content Items
l Job Sets
l Jobs

Once a data entity type is selected, various rules can be added to form the search criteria.
There are three categories of rules available: search, sorting and grouping rules.

Search Rules
There are eight types of search rules that can be specified as part of the overall search criteria:

l Data Value - Search for data entities based on the value of a data record field
l Property Value - Search for data entities based on the value of a data entity property
l In List - Restrict the search to the data entity identifiers contained within a list
l Not In List - Restrict the search to data entity identifiers not contained within a list
l Finishing - Search for data entities based on a finishing option:
l Media Name - The name of a media used as defined in the PlanetPress Connect
design template
l Duplex - Whether the page sheet is duplex or not
l Coating - The coating used for the front and back of the page sheet
l Binding - The binding used for the document including style, edge, type & angle
properties
l Document Length - Search for data entities based on the document length (number of
pages)
l Template Name - Search for data entities based on the name of the design template
used during Content Creation

Page 137
l Rule Group - Used to group search rules into logical groups (or sub-groups) and
specifies a group rules operator that can be configured to either match all or any of the
rules in the group

The types of search rules available are specific to the data entity type selected. The following
table lists the available combinations:

Rule Type Data Data Content Content Jobs Job


Records Sets Items Sets Sets

Data Value ✓ ✓

Property Value ✓ ✓ ✓ ✓ ✓ ✓

In List ✓ ✓ ✓ ✓ ✓ ✓

Not In List ✓ ✓ ✓ ✓ ✓ ✓

Finishing ✓

Document Length ✓

Template Name ✓ ✓

Rule Group ✓ ✓ ✓ ✓ ✓ ✓

Search rules can be added using the Add Search Rule button, removed using the Remove
Rule button, and even re-ordered within the form.

Rules can be re-ordered by dragging and dropping a rule by it's name label (e.g. Data Value
Rule: or Property Value Rule:).

Data Value search rules can be configured by specifying the following options:

Page 138
l Name - Name of the data record field to search by
l Condition - Operator for the comparison of the data record field (e.g. Equals (=), Not
Equals (<>), Less Than (<), Greater Than (>), etc.)
l Value - Value of the data record field to match

Property Value search rules can be configured by specifying the following options:

l Name - Name of the data entity property to search by


l Condition - Operator for the comparison of the data entity property (e.g. Equals (=), Not
Equals (<>), Less Than (<), Greater Than (>), etc.)
l Value - Value of the data entity property to match

In List and Not In List search rules can be configured by specifying the following options:

l Identifiers - List of data entity identifiers to match or not match against

Finishing search rules can be configured by specifying the following options:

l Type - Type of finishing option to compare (e.g. Media Name, Duplex, Coating or
Binding)

Finishing search rules with a Type set to Media Name can be further configured by specifying
the following options:

l Condition - Operator for the comparison of the media name (e.g. Equals (=) or Not
Equals (<>))
l Value - Value of the media name to match (e.g. Plain Letter Paper)

Finishing search rules with a Type set to Duplex can be further configured by specifying the
following options:

l Duplex - Whether the page sheet is duplex or not

Finishing search rules with a Type set to Coating can be further configured by specifying the
following options:

Page 139
l Condition - Operator for the comparison of the coating (e.g. Equals (=) or Not Equals
(<>))
l Front Coating - The type of front coating to match (e.g. Semi Gloss, Satin, Matte, Glossy,
None, etc.)
l Back Coating - The type of back coating to match (e.g. Semi Gloss, Satin, Matte, Glossy,
None, etc.)

Finishing search rules with a Type set to Binding can be further configured by specifying the
following options:

l Binding Style - The style of binding to match (e.g. Stapled, Glued, Stitched, Coil, etc.)
l Binding Edge - The edge (or side on which the binding occurs) to match (e.g. Left, Right,
Top or Bottom)
l Binding Type - The type or location of the binding to match (e.g. Saddle, Side or Corner)
l Binding Angle - The binding angle to match (e.g. Vertical, Horizontal or Angle)

Document Length search rules can be configured by specifying the following options:

l Condition - Operator for the comparison of the document length (e.g. Equals (=), Not
Equals (<>), Less Than (<), Greater Than (>), etc.)
l Value - Value of the document length to match

Template Name search rules can be configured by specifying the following options:

l Condition - Operator for the comparison of the template name (e.g. Equals (=) or Not
Equals (<>))
l Value - Value of the template name to match (e.g. letter-ol)

Rule Groups can be configured by specifying the following options:

l Rules Operator - Operator for the matching of search rules contained in the group (e.g.
Match All Rules (AND) or Match Any Rules (OR))

Rule Groups can be removed using the Remove Rule Group button, and in situations where
removing a rule group would remove multiple rules, you will be prompted to confirm the
removal of the rule group.

Page 140
Lastly, select the Rules Operator for the matching of search rules contained in the base rules
list (e.g. Match All Rules (AND) or Match Any Rules (OR))

Sorting Rules
There are also two types of sorting rules that can be used as part of the overall search criteria:

l Data Value - Sort the search results by the value of a data record field
l Property Value - Sort the search results by the value of a data entity property

The types of sorting rules available are also specific to the data entity type selected. The
following table lists the available combinations:

Rule Type Data Data Content Content Jobs Job


Records Sets Items Sets Sets

Data Value ✓ ✓

Property Value ✓ ✓ ✓ ✓ ✓ ✓

Sorting rules can be added using the Add Sorting Rule button, removed using the Remove
Rule button, and even re-ordered within the form.

Rules can be re-ordered by dragging and dropping a rule by it's name label (e.g. Data Value
Rule: or Property Value Rule:).

Data Value sorting rules can be configured by specifying the following options:

l Name - Name of the data record field to sort the search results by
l Numeric - Sort the search results for this data record field numerically
l Order - Sort the search results for this data record field in a specific order (e.g. Ascending
or Descending)

Property Value sorting rules can be configured by specifying the following options:

Page 141
l Name - Name of the data entity property to sort the search results by
l Order - Sort the search results for this data entity property in a specific order (e.g.
Ascending or Descending)

Grouping Rules
There are also two types of grouping rules that can be used as part of the overall search
criteria:

l Data Value - Group the search results by the value of a data record field
l Property Value - Group the search results by the value of a data entity property

The types of grouping rules available are also specific to the data entity type selected. The
following table lists the available combinations:

Rule Type Data Data Content Content Jobs Job


Records Sets Items Sets Sets

Data Value ✓ ✓

Property Value ✓ ✓ ✓ ✓ ✓ ✓

Grouping rules can be added using the Add Grouping Rule button, removed using the
Remove Rule button, and even re-ordered within the form.

Rules can be re-ordered by dragging and dropping a rule by it's name label (e.g. Data Value
Rule: or Property Value Rule:).

Data Value grouping rules can be configured by specifying the following options:

l Name - Name of the data record field to group the search results by
l Numeric - Group the search results for this data record field numerically
l Order - Group the search results for this data record field in a specific order (e.g.
Ascending or Descending)

Property Value grouping rules can be configured by specifying the following options:

Page 142
l Name - Name of the data entity property to group the search results by
l Order - Group the search results for this data entity property in a specific order (e.g.
Ascending or Descending)

Note
By default, comparison conditions in search rules are evaluated alphanumerically,
regardless of the type of value.
Numeric evaluation of comparison conditions is not currently supported in the
PlanetPress Connect REST API.
The only exception to this rule is the ability to numerically sort or group results by
specifying sorting or grouping rules of a Data Value type.

Warning
The Entity Type selected for the search criteria can be changed during or even after
rules have been added. But because certain rules are only available for certain data
entity types, some of the existing rules in the search criteria may become incompatible.
In situations where incompatible rules are found in the existing search criteria, you will be
prompted to confirm the change of entity type. If you then proceed with the change of
entity type, any incompatible rules found in the existing search criteria will be removed.

Once the search criteria is constructed, and the required inputs populated, simply select the
Submit button. This will submit the request to the server and display the search criteria
specified as input to the Results area in JSON Search Parameters format.

The result will then be returned as a list of Data Entity IDs which will be appended to the
Results area in both Plain table and JSON Identifier Lists (with Sort Key) formats.

To construct a new search criteria, the Reset button can be selected. This will reset the form,
removing all existing rules.

Further Reading

See the Entity Service page of the REST API Reference section for further detail.

Page 143
Finding all the Data Sets in the Server
Problem

You want to obtain a list of all the previously created Data Sets contained in the PlanetPress
Connect Server potentially for use in a Content Creation operation.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Data Set Entity REST service:

Get All Data Set Entities /rest/serverengine/entity/datasets GET

Example

HTML5
dse-get-all-datasets.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Get All Data Sets Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/dse-get-all-datasets.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Data Set Entity Service - Get All Data Sets
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="submit">No Input Required</label>
<input id="submit" type="submit"
value="Submit">
</div>

Page 144
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
dse-get-all-datasets.js

/* Data Set Entity Service - Get All Data Sets Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

$.ajax({
type: "GET",
url: "/rest/serverengine/entity/datasets"
})
.done(function (response) {
c.displayStatus("Request Successful");
c.displayHeading("Data Set IDs");
c.displaySubResult("Plain", c.jsonIDListToPlain
(response));
c.displaySubResult("JSON Identifier List",
c.jsonPrettyPrint(response));
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 145
Screenshot & Output

Usage

To run the example simply select the Submit button to request a list of the all the data sets
currently contained within the server.

The resulting list will then be returned and displayed to the Results area in both Plain list and
JSON Identifier List formats.

Further Reading

See the Data Set Entity Service page of the REST API Reference section for further detail.

Page 146
Finding the Data Records in a Data Set
Problem

You want to obtain a list of all the previously created Data Records contained within a specific
Data Set potentially for use in a Content Creation operation.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Data Set Entity REST service:

Get Data Records for Data /rest/serverengine/entity/datasets/{dataSetId} GET


Set

Example

HTML5
dse-get-datarecords.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Get Data Records for Data Set Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/dse-get-datarecords.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Data Set Entity Service - Get Data Records for Data Set
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="dataset">Data Set ID:</label>
<input id="dataset" type="text"
placeholder="1234" required>

Page 147
</div>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
dse-get-datarecords.js

/* Data Set Entity Service - Get Data Records for Data Set Example
*/
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var dataSetId = $("#dataset").val();

$.ajax({
type: "GET",
url: "/rest/serverengine/entity/datasets/" +
dataSetId
})
.done(function (response) {
c.displayStatus("Request Successful");
c.displayHeading("Data Record IDs for Data Set
'" + dataSetId + "'");
c.displaySubResult("Plain", c.jsonIDListToPlain
(response));
c.displaySubResult("JSON Identifier List",
c.jsonPrettyPrint(response));

Page 148
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Screenshot & Output

Usage

To run the example simply enter the Data Set ID and select the Submit button to request a list
of the all the data records contained within the specific data set in the server.

Page 149
The resulting list will then be returned and displayed to the Results area in both Plain list and
JSON Identifier List formats.

Further Reading

See the Data Set Entity Service page of the REST API Reference section for further detail.

Page 150
Finding all the Content Sets in the Server
Problem

You want to obtain a list of all the previously created Content Sets contained in the PlanetPress
Connect Server potentially for use in a Job Creation operation.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Content Set Entity REST service:

Get All Content Set Entities /rest/serverengine/entity/contentsets GET

Example

HTML5
cse-get-all-contentsets.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Get All Content Sets Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/cse-get-all-contentsets.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Content Set Entity Service - Get All Content Sets
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="submit">No Input Required</label>
<input id="submit" type="submit"
value="Submit">
</div>

Page 151
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
cse-get-all-contentsets.js

/* Content Set Entity Service - Get All Content Sets Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

$.ajax({
type: "GET",
url: "/rest/serverengine/entity/contentsets"
})
.done(function (response) {
c.displayStatus("Request Successful");
c.displayHeading("Content Set IDs");
c.displaySubResult("Plain", c.jsonIDListToPlain
(response));
c.displaySubResult("JSON Identifier List",
c.jsonPrettyPrint(response));
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 152
Screenshot & Output

Usage

To run the example simply select the Submit button to request a list of the all the content sets
currently contained within the server.

The resulting list will then be returned and displayed to the Results area in both Plain list and
JSON Identifier List formats.

Further Reading

See the Content Set Entity Service page of the REST API Reference section for further detail.

Page 153
Finding the Content Items in a Content Set
Problem

You want to obtain a list of all the previously created Content Items contained within a specific
Content Set potentially for use in a Job Creation operation.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Content Set Entity REST service:

Get Content Items for /rest/serverengine/entity/contentsets/{contentSetId} GET


Content Set

Example

HTML5
cse-get-contentitems.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Get Content Items for Content Set Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/cse-get-contentitems.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Content Set Entity Service - Get Content Items for
Content Set Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="contentset">Content Set ID:</label>
<input id="contentset" type="text"
placeholder="1234" required>

Page 154
</div>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
cse-get-contentitems.js

/* Content Set Entity Service - Get Content Items for Content Set
Example */
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var contentSetId = $("#contentset").val();

$.ajax({
type: "GET",
url: "/rest/serverengine/entity/contentsets/" +
contentSetId
})
.done(function (response) {
c.displayStatus("Request Successful");
c.displayHeading("Content Item IDs for Content
Set '" + contentSetId + "'");
c.displaySubResult("Plain",
c.jsonContentItemIDListToTable(response));
c.displaySubResult("JSON Content Item
Identifier List", c.jsonPrettyPrint(response));

Page 155
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Screenshot & Output

Page 156
Usage

To run the example simply enter the Content Set ID and select the Submit button to request a
list of the all the content items contained within the specific content set in the server.

The resulting list will then be returned as a list of Content Item and Data Record ID pairs which
will be displayed to the Results area in both Plain table and JSON Content Item Identifier List
formats.

Further Reading

See the Content Set Entity Service page of the REST API Reference section for further detail.

Page 157
Finding all the Job Sets in the Server
Problem

You want to obtain a list of all the previously created Job Sets contained in the PlanetPress
Connect Server potentially for use in a Output Creation operation.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Job Set Entity REST service:

Get All Job Set Entities /rest/serverengine/entity/jobsets GET

Example

HTML5
jse-get-all-jobsets.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Get All Job Sets Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/jse-get-all-jobsets.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Job Set Entity Service - Get All Job Sets Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="submit">No Input Required</label>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>

Page 158
</form>
</body>
</html>

JavaScript/jQuery
jse-get-all-jobsets.js

/* Job Set Entity Service - Get All Job Sets Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

$.ajax({
type: "GET",
url: "/rest/serverengine/entity/jobsets"
})
.done(function (response) {
c.displayStatus("Request Successful");
c.displayHeading("Job Set IDs");
c.displaySubResult("Plain", c.jsonIDListToPlain
(response));
c.displaySubResult("JSON Identifier List",
c.jsonPrettyPrint(response));
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 159
Screenshot & Output

Usage

To run the example simply select the Submit button to request a list of the all the job sets
currently contained within the server.

The resulting list will then be returned and displayed to the Results area in both Plain list and
JSON Identifier List formats.

Further Reading

See the Job Set Entity Service page of the REST API Reference section for further detail.

Page 160
Finding the Jobs in a Job Set
Problem

You want to obtain a list of all the previously created Jobs contained within a specific Job Set
potentially for use in a Output Creation operation.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Job Set Entity REST service:

Get Jobs for Job Set /rest/serverengine/entity/jobsets/{jobSetId} GET

Example

HTML5
jse-get-jobs.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Get Jobs for Job Set Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/jse-get-jobs.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Job Set Entity Service - Get Jobs for Job Set
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="jobset">Job Set ID:</label>
<input id="jobset" type="text"
placeholder="1234" required>
</div>

Page 161
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
jse-get-jobs.js

/* Job Set Entity Service - Get Jobs for Job Set Example */
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var jobSetId = $("#jobset").val();

$.ajax({
type: "GET",
url: "/rest/serverengine/entity/jobsets/" +
jobSetId
})
.done(function (response) {
c.displayStatus("Request Successful");
c.displayHeading("Job IDs for Job Set '" +
jobSetId + "'");
c.displaySubResult("Plain", c.jsonIDListToPlain
(response));
c.displaySubResult("JSON Identifier List",
c.jsonPrettyPrint(response));
})
.fail(c.displayDefaultFailure);

Page 162
});
});
}(jQuery, Common));

Screenshot & Output

Usage

To run the example simply enter the Job Set ID and select the Submit button to request a list of
the all the jobs contained within the specific job set in the server.

The resulting list will then be returned and displayed to the Results area in both Plain list and
JSON Identifier List formats.

Further Reading

See the Job Set Entity Service page of the REST API Reference section for further detail.

Page 163
Working with the Workflow Services
This section consists of a number of pages covering various useful working examples:

1. Running a Data Mapping Operation


2. Running a Data Mapping Operation (Using JSON)
3. Running a Data Mapping Operation for PDF/VT File (to Data Set)
4. Running a Data Mapping Operation for PDF/VT File (to Content Set)
5. Running a Content Creation Operation for Print
6. Running a Content Creation Operation for Print By Data Record (Using JSON)
7. Running a Content Creation Operation for Email By Data Record (Using JSON)
8. Creating Content for Web By Data Record
9. Creating Content for Web By Data Record (Using JSON)
10. Running a Job Creation Operation (Using JSON)
11. Running an Output Creation Operation
12. Running an Output Creation Operation (Using JSON)
13. Running an Output Creation Operation By Job (Using JSON)
14. Running an All-In-One Operation (Using JSON)

See the Data Mapping Service, Content Creation Service, Content Creation (Email) Service,
Content Creation (HTML) Service, Job Creation Service, Output Creation Service and All-In-
One Service pages of the REST API Reference section for further detail.

Note
A complete listing including these examples can be found in the index.html file located
at the root of the working example source code which contains links to all working
examples.

Page 164
Running a Data Mapping Operation
Problem

You want to run a data mapping operation to produce a Data Set using a data file and a data
mapping configuration as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the data mapping operation. There
is also the option of cancelling an operation during processing if required. These requests can
be submitted via the Data Mapping REST service:

Process Data Mapping /rest/serverengine/workflow/datamining/{configId}/ POST


{dataFileId}

Get Progress of /rest/serverengine/workflow/datamining/getProgress/ GET


Operation {operationId}

Get Result of Operation /rest/serverengine/workflow/datamining/getResult/ POST


{operationId}

Cancel an Operation /rest/serverengine/workflow/datamining/cancel/ POST


{operationId}

Example

HTML5

dm-process.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Data Mapping Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/dm-process.js"></script>

Page 165
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Data Mapping Service - Process Data Mapping
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datafile">Data File
ID/Name:</label>
<input id="datafile" type="text"
placeholder="1234 or Filename" required>
</div>
<div>
<label for="datamapper">Data Mapping
Configuration ID/Name:</label>
<input id="datamapper" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="validate">Validate Only:</label>
<input id="validate" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

Page 166
JavaScript/jQuery
dm-process.js

/* Data Mapping Service - Process Data Mapping Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

Page 167
event.preventDefault();
if (!c.checkSessionValid()) { return; }

var configId = $("#datamapper").val(),


dataFileId = $("#datafile").val(),
validate = $("#validate").is(":checked");

var getFinalResult = function () {

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/getResult/" + operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
if (validate) {
c.displaySubResult("JSON Data Mapping
Validation Result",
c.jsonPrettyPrint(response));
} else {
c.displaySubResult("Data Set ID",
response);
}
})
.fail(c.displayDefaultFailure);
};

/* Process Data Mapping */


$.ajax({
type: "POST",
url: "/rest/serverengine/workflow/datamining/" +
configId + "/" + dataFileId +
"?validate=" + validate
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");

Page 168
$cancelButton.removeAttr("disabled");

c.displayStatus("Data Mapping Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/datamining/getProgress/" + operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);

Page 169
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Screenshot & Output

Page 170
Usage

To run the example simply enter the Managed File ID or Name for your data file and your data
mapping configuration (previously uploaded to the file store) into the appropriate text fields, and
then check any options that you may require:

l Validate Only - Only validate the Data Mapping operation to check for mapping errors (no
Data Set is created).

Lastly, select the Submit button to start the data mapping operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the data mapping
operation has completed, the ID of the Data Set created will be returned and displayed to the
Results area.

If the operation was to only validate the data mapping, then a JSON Data Mapping Validation
Result will be returned and displayed instead.

Further Reading

See the Data Mapping Service page of the REST API Reference section for further detail.

Page 171
Running a Data Mapping Operation (Using JSON)
Problem

You want to run a data mapping operation to produce a Data Set using a data file and a data
mapping configuration as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the data mapping operation. There
is also the option of cancelling an operation during processing if required. These requests can
be submitted via the Data Mapping REST service:

Process Data Mapping /rest/serverengine/workflow/datamining/{configId} POST


(JSON)

Get Progress of /rest/serverengine/workflow/datamining/getProgress/ GET


Operation {operationId}

Get Result of Operation /rest/serverengine/workflow/datamining/getResult/ POST


{operationId}

Cancel an Operation /rest/serverengine/workflow/datamining/cancel/ POST


{operationId}

Example

HTML5

dm-process-json.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Data Mapping (JSON) Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/dm-process-json.js"></script>

Page 172
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Data Mapping Service - Process Data Mapping (JSON)
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datafile">Data File
ID/Name:</label>
<input id="datafile" type="text"
placeholder="1234 or Filename" required>
</div>
<div>
<label for="datamapper">Data Mapping
Configuration ID/Name:</label>
<input id="datamapper" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="validate">Validate Only:</label>
<input id="validate" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

Page 173
JavaScript/jQuery
dm-process-json.js

/* Data Mapping Service - Process Data Mapping (JSON) Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

Page 174
event.preventDefault();
if (!c.checkSessionValid()) { return; }

var configId = $("#datamapper").val(),


dataFileId = $("#datafile").val(),
validate = $("#validate").is(":checked");

var getFinalResult = function () {

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/getResult/" + operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
if (validate) {
c.displaySubResult("JSON Data Mapping
Validation Result",
c.jsonPrettyPrint(response));
} else {
c.displaySubResult("Data Set ID",
response);
}
})
.fail(c.displayDefaultFailure);
};

/* Process Data Mapping (JSON) */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/" + configId + "?validate="
+ validate,
data: JSON.stringify(c.plainIDToJson
(dataFileId)),
contentType: "application/json"
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader

Page 175
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Data Mapping Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/datamining/getProgress/" + operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");

Page 176
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Screenshot & Output

Page 177
Usage

To run the example simply enter the Managed File ID or Name for your data file and your data
mapping configuration (previously uploaded to the file store) into the appropriate text fields, and
then check any options that you may require:

l Validate Only - Only validate the Data Mapping operation to check for mapping errors (no
Data Set is created).

Lastly, select the Submit button to start the data mapping operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the data mapping
operation has completed, the ID of the Data Set created will be returned and displayed to the
Results area.

If the operation was to only validate the data mapping, then a JSON Data Mapping Validation
Result will be returned and displayed instead.

Further Reading

See the Data Mapping Service page of the REST API Reference section for further detail.

Page 178
Running a Data Mapping Operation for PDF/VT File (to
Data Set)
Problem

You want to run a data mapping operation to produce a Data Set using only a PDF/VT file as
input.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the data mapping operation. There
is also the option of cancelling an operation during processing if required. These requests can
be submitted via the Data Mapping REST service:

Process Data Mapping /rest/serverengine/workflow/datamining/pdfvtds/ POST


(PDF/VT to Data Set) {dataFileId}

Get Progress of /rest/serverengine/workflow/datamining/getProgress/ GET


Operation {operationId}

Get Result of Operation /rest/serverengine/workflow/datamining/getResult/ POST


{operationId}

Cancel an Operation /rest/serverengine/workflow/datamining/cancel/ POST


{operationId}

Example

HTML5
dm-process-pdfvt-ds.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Data Mapping (PDF/VT to Data Set)
Example</title>
<script src="../../common/lib/js/jquery-

Page 179
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/dm-process-pdfvt-ds.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">

</head>
<body>
<h2>Data Mapping Service - Process Data Mapping (PDF/VT to
Data Set) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datafile">Data File
ID/Name:</label>
<input id="datafile" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
dm-process-pdfvt-ds.js

/* Data Mapping Service - Process Data Mapping (PDF/VT to Data Set)


Example */
(function ($, c) {

Page 180
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var dataFileId = $("#datafile").val();

var getFinalResult = function () {

/* Get Result of Operation */

Page 181
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/getResult/" + operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
c.displaySubResult("Data Set ID",
response);
})
.fail(c.displayDefaultFailure);
};

/* Process Data Mapping (PDF/VT to Data Set) */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/pdfvtds/" + dataFileId
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Data Mapping Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/datamining/getProgress/" + operationId
})
.done(function (response, status,

Page 182
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 183
Screenshot & Output

Usage

To run the example simply enter the Managed File ID or Name for your PDF/VT file (previously
uploaded to the file store) into the appropriate text field, and then select the Submit button to
start the data mapping operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the data mapping
operation has completed, the ID of the Data Set created will be returned and displayed to the
Results area.

Page 184
Further Reading

See the Data Mapping Service page of the REST API Reference section for further detail.

Page 185
Running a Data Mapping Operation for PDF/VT File (to
Content Set)
Problem

You want to run a data mapping operation to produce a Content Set using only a PDF/VT file
as input.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the data mapping operation. There
is also the option of cancelling an operation during processing if required. These requests can
be submitted via the Data Mapping REST service:

Process Data Mapping /rest/serverengine/workflow/datamining/pdfvtcs/ POST


(PDF/VT to Content Set) {dataFileId}

Get Progress of /rest/serverengine/workflow/datamining/getProgress/ GET


Operation {operationId}

Get Result of Operation /rest/serverengine/workflow/datamining/getResult/ POST


{operationId}

Cancel an Operation /rest/serverengine/workflow/datamining/cancel/ POST


{operationId}

Example

HTML5
dm-process-pdfvt-cs.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Data Mapping (PDF/VT to Content Set)
Example</title>
<script src="../../common/lib/js/jquery-

Page 186
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/dm-process-pdfvt-cs.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Data Mapping Service - Process Data Mapping (PDF/VT to
Content Set) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datafile">Data File
ID/Name:</label>
<input id="datafile" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
dm-process-pdfvt-cs.js

/* Data Mapping Service - Process Data Mapping (PDF/VT to Content


Set) Example */
(function ($, c) {
"use strict";

Page 187
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var dataFileId = $("#datafile").val();

var getFinalResult = function () {

/* Get Result of Operation */


$.ajax({

Page 188
type: "POST",
url:
"/rest/serverengine/workflow/datamining/getResult/" + operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
c.displaySubResult("Content Set ID",
response);
})
.fail(c.displayDefaultFailure);
};

/* Process Data Mapping (PDF/VT to Content Set) */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/datamining/pdfvtcs/" + dataFileId
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Data Mapping Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/datamining/getProgress/" + operationId
})
.done(function (response, status,
request) {

Page 189
if (response !== "done") {
if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 190
Screenshot & Output

Usage

To run the example simply enter the Managed File ID or Name for your PDF/VT file (previously
uploaded to the file store) into the appropriate text field, and then select the Submit button to
start the data mapping operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the data mapping
operation has completed, the ID of the Content Set created will be returned and displayed to
the Results area.

Page 191
Further Reading

See the Data Mapping Service page of the REST API Reference section for further detail.

Page 192
Running a Content Creation Operation for Print
Problem

You want to run a content creation operation to produce a Content Set using a design template
and an existing set of Data Records as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the content creation operation.
There is also the option of cancelling an operation during processing if required. These
requests can be submitted via the Content Creation REST service:

Process Content /rest/serverengine/workflow/contentcreation/{templateId}/ POST


Creation {dataSetId}

Get Progress of /rest/serverengine/workflow/contentcreation/getProgress/ GET


Operation {operationId}

Get Result of /rest/serverengine/workflow/contentcreation/getResult/ POST


Operation {operationId}

Cancel an Operation /rest/serverengine/workflow/contentcreation/cancel/ POST


{operationId}

Example

HTML5
cc-process.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Content Creation Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/cc-process.js"></script>

Page 193
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Content Creation Service - Process Content Creation
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="dataset">Data Set ID:</label>
<input id="dataset" type="text"
placeholder="1234" required>
</div>
<div>
<label for="designtemplate">Design Template
ID/Name:</label>
<input id="designtemplate" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery

cc-process.js

/* Content Creation Service - Process Content Creation Example */


(function ($, c) {

Page 194
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var dataSetId = $("#dataset").val(),


templateId = $("#designtemplate").val();

var getFinalResult = function () {

Page 195
/* Get Result of Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/getResult/" +
operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
c.displaySubResult("Content Set IDs",
response);
})
.fail(c.displayDefaultFailure);
};

/* Process Content Creation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/" + templateId + "/" +
dataSetId
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Content Creation Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:

Page 196
"/rest/serverengine/workflow/contentcreation/getProgress/" +
operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 197
Screenshot & Output

Usage

To run the example simply enter the Data Set ID and the Managed File ID or Name of your
design template (previously uploaded to the file store) into the appropriate text fields, and then
select the Submit button to start the content creation operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the content
creation operation has completed, the IDs of the Content Sets created will be returned and
displayed to the Results area.

Page 198
Further Reading

See the Content Creation Service page of the REST API Reference section for further detail.

Page 199
Running a Content Creation Operation for Print By Data
Record (Using JSON)
Problem

You want to run a content creation operation to produce a Content Set using a design template
and an existing set of Data Records as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the content creation operation.
There is also the option of cancelling an operation during processing if required. These
requests can be submitted via the Content Creation REST service:

Process Content /rest/serverengine/workflow/contentcreation/{templateId} POST


Creation (By Data
Record) (JSON)

Get Progress of /rest/serverengine/workflow/contentcreation/getProgress/ GET


Operation {operationId}

Get Result of /rest/serverengine/workflow/contentcreation/getResult/ POST


Operation {operationId}

Cancel an Operation /rest/serverengine/workflow/contentcreation/cancel/ POST


{operationId}

Example

HTML5
cc-process-by-dre-json.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Content Creation (By Data Record) (JSON)
Example</title>

Page 200
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/cc-process-by-dre-json.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Content Creation Service - Process Content Creation (By
Data Record) (JSON) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datarecords">Data Record ID
(s):</label>
<input id="datarecords" type="text"
placeholder="1234, 2345, 3456, ..." required>
</div>
<div>
<label for="designtemplate">Design Template
ID/Name:</label>
<input id="designtemplate" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

Page 201
JavaScript/jQuery
cc-process-by-dre-json.js

/* Content Creation Service - Process Content Creation (By Data


Record) (JSON) Example */
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

event.preventDefault();

Page 202
if (!c.checkSessionValid()) { return; }

var dataRecordIds = $("#datarecords").val(),


templateId = $("#designtemplate").val();

var getFinalResult = function () {

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/getResult/" +
operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
c.displaySubResult("Content Set IDs",
response);
})
.fail(c.displayDefaultFailure);
};

/* Process Content Creation (By Data Record) (JSON) */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/" + templateId,
data: JSON.stringify(c.plainIDListToJson
(dataRecordIds)),
contentType: "application/json"
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Content Creation Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

Page 203
var getProgress = function () {
if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/contentcreation/getProgress/" +
operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}

Page 204
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Screenshot & Output

Usage

To run the example simply enter a comma delimited list of your Data Record IDs and the
Managed File ID or Name of your design template (previously uploaded to the file store) into
the appropriate text fields, and then select the Submit button to start the content creation
operation.

Page 205
Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the content
creation operation has completed, the IDs of the Content Sets created will be returned and
displayed to the Results area.

Further Reading

See the Content Creation Service page of the REST API Reference section for further detail.

Page 206
Running a Content Creation Operation for Email By Data
Record (Using JSON)
Problem

You want to run a content creation operation to create and send email content using a design
template and an existing set of Data Records as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the content creation operation.
There is also the option of cancelling an operation during processing if required. These
requests can be submitted via the Content Creation (Email) REST service:

Process /rest/serverengine/workflow/contentcreation/email/{templateId} POST


Content
Creation (By
Data Record)
(JSON)

Get Progress of /rest/serverengine/workflow/contentcreation/email/getProgress/ GET


Operation {operationId}

Get Result of /rest/serverengine/workflow/contentcreation/email/getResult/ POST


Operation {operationId}

Cancel an /rest/serverengine/workflow/contentcreation/email/cancel/ POST


Operation {operationId}

Example

HTML5
cce-process-by-dre-json.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">

Page 207
<title>Process Content Creation (By Data Record) (JSON)
Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/cce-process-by-dre-json.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Content Creation (Email) Service - Process Content
Creation (By Data Record) (JSON) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datarecords">Data Record ID
(s):</label>
<input id="datarecords" type="text"
placeholder="1234, 2345, 3456, ..." required>
</div>
<div>
<label for="designtemplate">Design Template
ID/Name:</label>
<input id="designtemplate" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Email Parameters</legend>
<div>
<label for="section">Section:</label>
<input id="section" type="text"
placeholder="Section Name">
</div>
<div>
<label for="sender">From:</label>
<input id="sender" type="text"
placeholder="[email protected]" required>
</div>
<div>
<label for="host">Host:</label>
<input id="host" type="text"
placeholder="mail.server.com" required>

Page 208
</div>
<div>
<label for="usesender">Use From as To Email
Address:</label>
<input id="usesender" type="checkbox" checked>
</div>
<div>
<label for="attachpdf">Attach PDF Page to
Email:</label>
<input id="attachpdf" type="checkbox">
</div>
<div>
<label for="attachweb">Attach Web Page to
Email:</label>
<input id="attachweb" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Email Security</legend>
<div>
<label for="useauth">Use
Authentication:</label>
<input id="useauth" type="checkbox" checked>
</div>
<div>
<label for="starttls">Start TLS:</label>
<input id="starttls" type="checkbox">
</div>
<div>
<label for="username">Username:</label>
<input id="username" type="text"
placeholder="Username">
</div>
<div>
<label for="password">Password:</label>
<input id="password" type="password"
placeholder="Password">
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>

Page 209
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery

cce-process-by-dre-json.js

/* Content Creation (Email) Service - Process Content Creation (By


Data Record) (JSON) Example */
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $useAuth = $("#useauth"),


$startTLS = $("#starttls"),
$username = $("#username"),
$password = $("#password"),
$submitButton = $("#submit"),
$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/email/cancel/" +
operationId

Page 210
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$useAuth.on("click", function (event) {


if (event.target.checked) {
$startTLS.removeAttr("disabled");
$username.removeAttr("disabled");
$password.removeAttr("disabled");
} else {
$startTLS.attr("disabled", "disabled");
$username.attr("disabled", "disabled");
$password.attr("disabled", "disabled");
}
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var dataRecordIds = $("#datarecords").val(),


templateId = $("#designtemplate").val(),
section = $("#section").val().trim();

var getFinalResult = function () {

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/email/getResult/" +

Page 211
operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
c.displaySubResult("Email Report",
response);
})
.fail(c.displayDefaultFailure);
};

/* Construct JSON Identifier List (with Email


Parameters) */
var config = {
"sender": $("#sender").val(),
"host": $("#host").val(),
"useAuth" : $useAuth.is(":checked"),
"useSender": $("#usesender").is(":checked"),
"attachWebPage": $("#attachweb").is
(":checked"),
"attachPdfPage": $("#attachpdf").is
(":checked")
},
drids = c.plainIDListToJson(dataRecordIds);

if (config.useAuth) {
config.useStartTLS = $startTLS.is(":checked");
config.user = $username.val();
config.password = $password.val();
} else {
config.user = "";
}
config.identifiers = drids.identifiers;

/* Process Content Creation (By Data Record) (JSON) */


var settings = {
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/email/" + templateId,
data: JSON.stringify(config),
contentType: "application/json; charset=utf-8"
};
if (section.length) { settings.url += "?section=" +
section; }

Page 212
$.ajax(settings)
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Content Creation Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/contentcreation/email/getProgress/" +
operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();

Page 213
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 214
Screenshot & Output

Page 215
Usage

To run the example you first need to enter a comma delimited list of your Data Record IDs and
the Managed File ID or Name of your design template (previously uploaded to the file store)
into the appropriate text fields as your inputs.

Next you need to specify the email parameters to use with the content creation operation:

l Section - the section within the Email context of the template to use
l From - the email address to be shown as the sender in the email output
l Host - the network address or name of your SMTP mail server through which the emails
will be sent
l Use From as To Address - use the sender address as the receiver address for all emails
in the output
l Attach PDF Page to Email - if a Print context exists in the template, create it's output as a
PDF and attach it to the email output
l Attach Web Page to Email - if a Web context exists in the template, create it's output as a
single HTML web page (with embedded resources) and attach it to email output

Then you need to specify how email security is to be used with the content creation operation:

l Use Authentication - if authentication is to be used with the mail server


l Start TLS - if Transport Layer Security (TLS) is to be used when sending emails
l Username - the username to authenticate/login with
l Password - the password to authenticate/login with

Lastly, select the Submit button to start the content creation operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the content
creation operation has completed, a report of the emails successfully sent will be returned and
displayed to the Results area.

Page 216
Further Reading

See the Content Creation (Email) Service page of the REST API Reference section for further
detail.

Page 217
Creating Content for Web By Data Record
Problem

You want to create and retrieve web content using a design template and an existing Data
Record as inputs.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Content Creation (HTML) REST service:

Process Content /rest/serverengine/workflow/contentcreation/html/ GET


Creation (By Data {templateId}/{dataRecordId: [0-9]+}
Record)

Example

HTML5
cch-process-by-dre.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Content Creation (By Data Record)
Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/cch-process-by-dre.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Content Creation (HTML) Service - Process Content
Creation (By Data Record) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datarecord">Data Record ID:</label>

Page 218
<input id="datarecord" type="text"
placeholder="1234" required>
</div>
<div>
<label for="designtemplate">Design Template
ID/Name:</label>
<input id="designtemplate" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>HTML Parameters</legend>
<div>
<label for="section">Section:</label>
<input id="section" type="text"
placeholder="Section Name">
</div>
<div>
<label for="inline">Inline Mode:</label>
<select id="inline">
<option value="NONE">None</option>
<option value="CSS">CSS</option>
<option value="ALL">All</option>
</select>
</div>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
cch-process-by-dre.js

/* Content Creation (HTML) Service - Process Content Creation (By


Data Record) Example */
(function ($, c) {
"use strict";

Page 219
$(document).ready(function () {

c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var dataRecordId = $("#datarecord").val(),


templateId = $("#designtemplate").val(),
section = $("#section").val().trim(),
params = {
inline: $("#inline").val()
};
if (section.length) { params.section = section; }

/* Process Content Creation (By Data Record) */


$.ajax({
type: "GET",
url:
"/rest/serverengine/workflow/contentcreation/html/" +
templateId + "/" + dataRecordId,
data: params
})
.done(function (response, status, request) {
c.displayHeading("Result");
c.displaySubResult("Response",
c.htmlToLinkWindow(response, "Result Link"), false);
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 220
Screenshot & Output

Page 221
Usage

To run the example you first need to enter your Data Record ID and the Managed File ID or
Name of your design template (previously uploaded to the file store) into the appropriate text
fields as your inputs.

Next you need to specify the HTML parameters to use when creating the web content:

Page 222
l Section - the section within the Web context of the template to use
l Inline Mode - the inline mode to be used in the creation of content

Lastly, select the Submit button to create and retrieve the web content. When the response
returns a Results Link will be displayed in the Results area. This link can be selected to view
the resulting web content that was created.

Further Reading

See the Content Creation (HTML) Service page of the REST API Reference section for further
detail.

Page 223
Creating Content for Web By Data Record (Using JSON)
Problem

You want to create and retrieve web content using a design template and an existing Data
Record as inputs.

Solution

The solution is to create a request using the following URI and method type and submit it to the
server via the Content Creation (HTML) REST service:

Process Content Creation /rest/serverengine/workflow/contentcreation/html/ POST


(By Data Record) (JSON) {templateId}/{dataRecordId: [0-9]+}

Example

HTML5
cch-process-by-dre-json.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Content Creation (By Data Record) (JSON)
Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/cch-process-by-dre-json.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Content Creation (HTML) Service - Process Content
Creation (By Data Record) (JSON) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="datarecord">Data Record ID:</label>
<input id="datarecord" type="text"

Page 224
placeholder="1234" required>
</div>
<div>
<label for="designtemplate">Design Template
ID/Name:</label>
<input id="designtemplate" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>HTML Parameters</legend>
<div>
<label for="section">Section:</label>
<input id="section" type="text"
placeholder="Section Name">
</div>
<div>
<label for="inline">Inline Mode:</label>
<select id="inline">
<option value="NONE">None</option>
<option value="CSS">CSS</option>
<option value="ALL">All</option>
</select>
</div>
<div>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
cch-process-by-dre-json.js

/* Content Creation (HTML) Service - Process Content Creation (By


Data Record) (JSON) Example */
(function ($, c) {
"use strict";
$(document).ready(function () {

Page 225
c.setupExample();

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var dataRecordId = $("#datarecord").val(),


templateId = $("#designtemplate").val(),
section = $("#section").val().trim(),
params = {
inline: $("#inline").val()
};
if (section.length) { params.section = section; }

/* Process Content Creation (By Data Record) (JSON) */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/html/" +
templateId + "/" +
dataRecordId,
data: JSON.stringify(params),
contentType: "application/json; charset=utf-8"
})
.done(function (response, status, request) {
c.displayHeading("Result");
c.displaySubResult("Response",
c.htmlToLinkWindow(response, "Result Link"), false);
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 226
Screenshot & Output

Page 227
Usage

To run the example you first need to enter your Data Record ID and the Managed File ID or
Name of your design template (previously uploaded to the file store) into the appropriate text
fields as your inputs.

Next you need to specify the HTML parameters to use when creating the web content:

Page 228
l Section - the section within the Web context of the template to use
l Inline Mode - the inline mode to be used in the creation of content

Lastly, select the Submit button to create and retrieve the web content. When the response
returns a Results Link will be displayed in the Results area. This link can be selected to view
the resulting web content that was created.

Further Reading

See the Content Creation (HTML) Service page of the REST API Reference section for further
detail.

Page 229
Running a Job Creation Operation (Using JSON)
Problem

You want to run a job creation operation to produce a Job Set using a job creation preset and
an existing set of Content Sets as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the job creation operation. There is
also the option of cancelling an operation during processing if required. These requests can be
submitted via the Job Creation REST service:

Process Job Creation /rest/serverengine/workflow/jobcreation/{configId} POST


(JSON)

Get Progress of /rest/serverengine/workflow/jobcreation/getProgress/ GET


Operation {operationId}

Get Result of Operation /rest/serverengine/workflow/jobcreation/getResult/ POST


{operationId}

Cancel an Operation /rest/serverengine/workflow/jobcreation/cancel/ POST


{operationId}

Example

HTML5

jc-process-json.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Job Creation (JSON) Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/jc-process-json.js"></script>

Page 230
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Job Creation Service - Process Job Creation (JSON)
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="contentsets">Content Set ID
(s):</label>
<input id="contentsets" type="text"
placeholder="1234, 2345, 3456, ..." required>
</div>
<div>
<label for="jcpreset">Job Creation Preset
ID/Name:</label>
<input id="jcpreset" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
jc-process-json.js

Page 231
/* Job Creation Service - Process Job Creation (JSON) Example */
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/jobcreation/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var contentSetIds = $("#contentsets").val(),


configId = $("#jcpreset").val();

Page 232
var getFinalResult = function () {

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/jobcreation/getResult/" + operationId
})
.done(function (response, status, request) {
c.displayHeading("Operation Result");
c.displaySubResult("Job Set ID", response);
})
.fail(c.displayDefaultFailure);
};

/* Process Job Creation (JSON) */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/jobcreation/" + configId,
data: JSON.stringify(c.plainIDListToJson
(contentSetIds)),
contentType: "application/json"
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Job Creation Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",

Page 233
cache: false,
url:
"/rest/serverengine/workflow/jobcreation/getProgress/" +
operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 234
Screenshot & Output

Usage

To run the example simply enter a comma delimited list of your Content Set IDs and the
Managed File ID or Name of your job creation preset (previously uploaded to the file store) into
the appropriate text fields, and then select the Submit button to start the job creation operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the job creation
operation has completed, the ID of the Job Set created will be returned and displayed to the
Results area.

Page 235
Further Reading

See the Job Creation Service page of the REST API Reference section for further detail.

Page 236
Running an Output Creation Operation
Problem

You want to run an output creation operation to produce print output using an output creation
preset and an existing Job Set as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the output creation operation.
There is also the option of cancelling an operation during processing if required. These
requests can be submitted via the Output Creation REST service:

Process Output /rest/serverengine/workflow/outputcreation/{configId}/ POST


Creation {jobSetId}

Get Progress of /rest/serverengine/workflow/outputcreation/getProgress/ GET


Operation {operationId}

Get Result of /rest/serverengine/workflow/outputcreation/getResult/ POST


Operation {operationId}

Get Result of /rest/serverengine/workflow/outputcreation/getResultTxt/ POST


Operation (as Text) {operationId}

Cancel an Operation /rest/serverengine/workflow/outputcreation/cancel/ POST


{operationId}

Example

HTML5
oc-process.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Output Creation Example</title>

Page 237
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/oc-process.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Output Creation Service - Process Output Creation
Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="jobset">Job Set ID:</label>
<input id="jobset" type="text"
placeholder="1234" required>
</div>
<div>
<label for="ocpreset">Output Creation Preset
ID/Name:</label>
<input id="ocpreset" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="resultastxt">Get Result as
Text:</label>
<input id="resultastxt" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>

Page 238
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
oc-process.js

/* Output Creation Service - Process Output Creation Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}

Page 239
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var jobSetId = $("#jobset").val(),


configId = $("#ocpreset").val();

var getFinalResult = function () {

var result = ($("#resultastxt").is(":checked")) ?


"getResultTxt" : "getResult";

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/" + result + "/" +
operationId
})
.done(function (response, status, request) {
if (request.getResponseHeader("Content-
Type") === "application/octet-stream") {
response = "&lt;&lt;OCTET-STREAM FILE
DATA&gt;&gt;";
}
c.displayHeading("Operation Result");
c.displaySubResult("Output", response);
})
.fail(c.displayDefaultFailure);
};

/* Process Output Creation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/" + configId + "/" +
jobSetId
})
.done(function (response, status, request) {

Page 240
var progress = null;
operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Output Creation Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/outputcreation/getProgress/" +
operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr

Page 241
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 242
Screenshot & Output

Usage

To run the example simply enter the Job Set ID and the Managed File ID or Name of your
output creation preset (previously uploaded to the file store) into the appropriate text fields, and
then check any options that you may require:

l Get Result as Text - Return the result as text specifically. In this example this would
return the absolute path to the output file(s).

Lastly, select the Submit button to start the Output creation operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

Page 243
The progress of the operation will be displayed in the progress bar, and once the output
creation operation has completed, the output result will be returned and displayed to the
Results area.

Note
If the result returned is expected to be file data, then the value <<OCTET-STREAM FILE
DATA>> will be displayed.

Further Reading

See the Output Creation Service page of the REST API Reference section for further detail.

Page 244
Running an Output Creation Operation (Using JSON)
Problem

You want to run an output creation operation to produce print output using an output creation
preset and an existing Job Set as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the output creation operation.
There is also the option of cancelling an operation during processing if required. These
requests can be submitted via the Output Creation REST service:

Process Output /rest/serverengine/workflow/outputcreation/{configId} POST


Creation (JSON)

Get Progress of /rest/serverengine/workflow/outputcreation/getProgress/ GET


Operation {operationId}

Get Result of /rest/serverengine/workflow/outputcreation/getResult/ POST


Operation {operationId}

Get Result of /rest/serverengine/workflow/outputcreation/getResultTxt/ POST


Operation (as Text) {operationId}

Cancel an Operation /rest/serverengine/workflow/outputcreation/cancel/ POST


{operationId}

Example

HTML5
oc-process-json.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process Output Creation (JSON) Example</title>

Page 245
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/oc-process-json.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Output Creation Service - Process Output Creation
(JSON) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="jobset">Job Set ID:</label>
<input id="jobset" type="text"
placeholder="1234" required>
</div>
<div>
<label for="ocpreset">Output Creation Preset
ID/Name:</label>
<input id="ocpreset" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="createonly">Create Only:</label>
<input id="createonly" type="checkbox">
</div>
<div>
<label for="resultastxt">Get Result as
Text:</label>
<input id="resultastxt" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"

Page 246
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
oc-process-json.js

/* Output Creation Service - Process Output Creation (JSON) Example


*/
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",

Page 247
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var jobSetId = $("#jobset").val(),


configId = $("#ocpreset").val(),
createOnly = $("#createonly").is(":checked");

var getFinalResult = function () {

var result = ($("#resultastxt").is(":checked")) ?


"getResultTxt" : "getResult";

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/" + result + "/" +
operationId
})
.done(function (response, status, request) {
if (request.getResponseHeader("Content-
Type") === "application/octet-stream") {
response = "&lt;&lt;OCTET-STREAM FILE
DATA&gt;&gt;";
}
c.displayHeading("Operation Result");
c.displaySubResult("Output", response);
})
.fail(c.displayDefaultFailure);
};

/* Process Output Creation (JSON) */


$.ajax({
type: "POST",

Page 248
url:
"/rest/serverengine/workflow/outputcreation/" + configId,
data: JSON.stringify(c.plainIDToJson
(jobSetId, createOnly)),
contentType: "application/json"
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Output Creation Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/outputcreation/getProgress/" +
operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {

Page 249
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 250
Screenshot & Output

Usage

To run the example simply enter the Job Set ID and the Managed File ID or Name of your
output creation preset (previously uploaded to the file store) into the appropriate text fields, and
then check any options that you may require:

l Create Only - Create the output in server but do not send spool file to its final destination.
In this example this would mean that the output files(s) would not be sent to the output
directory specified in the output creation preset.
l Get Result as Text - Return the result as text specifically. In this example this would
return the absolute path to the output file(s).

Lastly, select the Submit button to start the Output creation operation.

Page 251
Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the output
creation operation has completed, the output result will be returned and displayed to the
Results area.

Note
If the result returned is expected to be file data, then the value <<OCTET-STREAM FILE
DATA>> will be displayed.

Further Reading

See the Output Creation Service page of the REST API Reference section for further detail.

Page 252
Running an Output Creation Operation By Job (Using
JSON)
Problem

You want to run an output creation operation to produce print output using an output creation
preset and a list of existing Jobs as inputs.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the output creation operation.
There is also the option of cancelling an operation during processing if required. These
requests can be submitted via the Output Creation REST service:

Process Output /rest/serverengine/workflow/outputcreation/ POST


Creation (By Job) {configId}/jobs
(JSON)

Get Progress of /rest/serverengine/workflow/outputcreation/getProgress/ GET


Operation {operationId}

Get Result of /rest/serverengine/workflow/outputcreation/getResult/ POST


Operation {operationId}

Get Result of /rest/serverengine/workflow/outputcreation/getResultTxt/ POST


Operation (as Text) {operationId}

Cancel an Operation /rest/serverengine/workflow/outputcreation/cancel/ POST


{operationId}

Example

HTML5

oc-process-by-je-json.html

<!DOCTYPE html>
<html>
<head>

Page 253
<meta charset="utf-8">
<title>Process Output Creation (By Job) (JSON)
Example</title>
<script src="../../common/lib/js/jquery-
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/oc-process-by-je-json.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>Output Creation Service - Process Output Creation (By
Job) (JSON) Example</h2>
<form>
<fieldset>
<legend>Inputs</legend>
<div>
<label for="jobs">Job ID(s):</label>
<input id="jobs" type="text" placeholder="1234,
2345, 3456, ..." required>
</div>
<div>
<label for="ocpreset">Output Creation Preset
ID/Name:</label>
<input id="ocpreset" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>
<label for="createonly">Create Only:</label>
<input id="createonly" type="checkbox">
</div>
<div>
<label for="resultastxt">Get Result as
Text:</label>
<input id="resultastxt" type="checkbox">
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>

Page 254
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery

oc-process-by-je-json.js

/* Output Creation Service - Process Output Creation (By Job)


(JSON) Example */
(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

var $submitButton = $("#submit"),


$cancelButton = $("#cancel"),
$progressBar = $("progress"),
operationId = null;

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {

Page 255
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);
}
});

$("form").on("submit", function (event) {

event.preventDefault();
if (!c.checkSessionValid()) { return; }

var jobIds = $("#jobs").val(),


configId = $("#ocpreset").val(),
createOnly = $("#createonly").is(":checked");

var getFinalResult = function () {

var result = ($("#resultastxt").is(":checked")) ?


"getResultTxt" : "getResult";

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/" + result + "/" +
operationId
})
.done(function (response, status, request) {
if (request.getResponseHeader("Content-
Type") === "application/octet-stream") {
response = "&lt;&lt;OCTET-STREAM FILE
DATA&gt;&gt;";
}
c.displayHeading("Operation Result");
c.displaySubResult("Output", response);
})
.fail(c.displayDefaultFailure);
};

Page 256
/* Process Output Creation (By Job) (JSON) */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/outputcreation/" + configId + "/jobs",
data: JSON.stringify(c.plainIDListToJson
(jobIds, createOnly)),
contentType: "application/json"
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("Output Creation Operation


Successfully Submitted");
c.displayResult("Operation ID", operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/outputcreation/getProgress/" +
operationId
})
.done(function (response, status,
request) {

if (response !== "done") {


if (response !== progress)
{
progress = response;
$progressBar.attr
("value", progress);
}

Page 257
setTimeout(getProgress,
1000);
} else {
$progressBar.attr("value",
(progress = 100));
c.displayInfo("Operation
Completed");
getFinalResult();
operationId = null;
setTimeout(function () {
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
});
});
}(jQuery, Common));

Page 258
Screenshot & Output

Usage

To run the example simply enter a comma delimited list of your Job IDs and the Managed File
ID or Name of your output creation preset (previously uploaded to the file store) into the
appropriate text fields, and then check any options that you may require:

l Create Only - Create the output in server but do not send spool file to its final destination.
In this example this would mean that the output files(s) would not be sent to the output
directory specified in the output creation preset.

Page 259
l Get Result as Text - Return the result as text specifically. In this example this would
return the absolute path to the output file(s).

Lastly, select the Submit button to start the Output creation operation.

Once the operation has started processing, the Operation ID will be displayed in the Results
area and the Cancel button will become enabled, giving you the option to cancel the running
operation.

The progress of the operation will be displayed in the progress bar, and once the output
creation operation has completed, the output result will be returned and displayed to the
Results area.

Note
If the result returned is expected to be file data, then the value <<OCTET-STREAM FILE
DATA>> will be displayed.

Further Reading

See the Output Creation Service page of the REST API Reference section for further detail.

Page 260
Running an All-In-One Operation (Using JSON)
Problem

You want to run an All-In-One operation to produce either a Data Set, Content Sets, a Job Set
or print output using one of the available process and input combinations.

Solution

The solution is to make a series of requests using the following URIs and method types to
submit, monitor progress and ultimately retrieve the result of the All-In-One operation. There is
also the option of cancelling an operation during processing if required. These requests can be
submitted via the All-In-One REST service:

Process All-In-One /rest/serverengine/workflow/print/submit POST


(JSON)

Get Progress of Operation /rest/serverengine/workflow/print/getProgress/ GET


{operationId}

Get Result of Operation /rest/serverengine/workflow/print/getResult/ POST


{operationId}

Get Result of Operation /rest/serverengine/workflow/print/getResultTxt/ POST


(as Text) {operationId}

Cancel an Operation /rest/serverengine/workflow/print/cancel/ POST


{operationId}

Example

HTML5
aio-process-json.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Process All-In-One (JSON) Example</title>
<script src="../../common/lib/js/jquery-

Page 261
1.11.3.min.js"></script>
<script src="../../common/js/common.js"></script>
<script src="js/aio-process-json.js"></script>
<link rel="stylesheet" href="../../common/css/styles.css">
</head>
<body>
<h2>All-In-One Service - Process All-In-One (JSON)
Example</h2>
<form>
<fieldset id="inputs">
<legend>Inputs</legend>
<div>
<label for="datamining">Data Mapping:</label>
<input id="datamining" type="checkbox">
</div>
<div>
<label for="contentcreation">Content
Creation:</label>
<input id="contentcreation" type="checkbox">
</div>
<div>
<label for="jobcreation">Job Creation:</label>
<input id="jobcreation" type="checkbox">
</div>
<div>
<label for="outputcreation">Output
Creation:</label>
<input id="outputcreation" type="checkbox">
</div>
</fieldset>
<fieldset id="datamining-inputs" disabled>
<legend>Data Mapping</legend>
<div>
<label for="datafile">Data File
ID/Name:</label>
<input id="datafile" type="text"
placeholder="1234 or Filename" required>
</div>
<div>
<label for="datamapper">Data Mapping
Configuration ID/Name:</label>
<input id="datamapper" type="text"
placeholder="1234 or Filename" required>

Page 262
</div>
</fieldset>
<fieldset id="contentcreation-inputs" disabled>
<legend>Content Creation</legend>
<div>
<label for="datarecords">Data Record ID
(s):</label>
<input id="datarecords" type="text"
placeholder="1234, 2345, 3456, ..." required>
</div>
<div>
<label for="designtemplate">Design Template
ID/Name:</label>
<input id="designtemplate" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset id="jobcreation-inputs" disabled>
<legend>Job Creation</legend>
<div>
<label for="jcpreset">Job Creation Preset
ID/Name:</label>
<input id="jcpreset" type="text"
placeholder="1234 or Filename" disabled>
</div>
</fieldset>
<fieldset id="outputcreation-inputs" disabled>
<legend>Output Creation</legend>
<div>
<label for="jobs">Job ID(s):</label>
<input id="jobs" type="text" placeholder="1234,
2345, 3456, ..." required>
</div>
<div>
<label for="ocpreset">Output Creation Preset
ID/Name:</label>
<input id="ocpreset" type="text"
placeholder="1234 or Filename" required>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div>

Page 263
<label for="createonly">Create Only:</label>
<input id="createonly" type="checkbox"
disabled>
</div>
<div>
<label for="resultastxt">Get Result as
Text:</label>
<input id="resultastxt" type="checkbox"
disabled>
</div>
<div>
<label for="printrange">Print Range:</label>
<input id="printrange" type="text"
placeholder="1, 2, 3-5, 6" disabled>
</div>
</fieldset>
<fieldset>
<legend>Progress & Actions</legend>
<div>
<progress value="0" max="100"></progress>
</div>
<div>
<input id="cancel" type="button" value="Cancel"
disabled>
<input id="submit" type="submit"
value="Submit">
</div>
</fieldset>
</form>
</body>
</html>

JavaScript/jQuery
aio-process-json.js

/* All-In-One Service - Process All-In-One (JSON) Example */


(function ($, c) {
"use strict";
$(document).ready(function () {

c.setupExample();

Page 264
var $form = $("form"),
$inputs = $("#inputs input"),

$datafile = $("#datafile"),
$datamapper = $("#datamapper"),
$datarecords = $("#datarecords"),
$template = $("#designtemplate"),
$jcpreset = $("#jcpreset"),
$jobs = $("#jobs"),
$ocpreset = $("#ocpreset"),
$createonly = $("#createonly"),
$resultastxt = $("#resultastxt"),
$printrange = $("#printrange"),

AIOConfig = null,
outputDesc = null,
operationId = null,

$submitButton = $("#submit"),
$cancelButton = $("#cancel"),
$progressBar = $("progress");

$cancelButton.on("click", function () {
if (operationId !== null) {

/* Cancel an Operation */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/print/cancel/" + operationId
})
.done(function (response) {
c.displayInfo("Operation Cancelled!");
operationId = null;
setTimeout(function () {
$progressBar.attr("value", 0);
$submitButton.removeAttr("disabled");
$cancelButton.attr("disabled",
"disabled");
}, 100);
})
.fail(c.displayDefaultFailure);

Page 265
}
});

/**
* @function generateAIOConfig
* @description Validates the workflow selected by the user
* and constructs and an All-In-One Configuration using the
relevant
* input fields in the HTML Form.
* Any invalid inputs or workflow selections will be red-
flagged in
* the HTML Form. Null can also be returned if no workflow
selections
* are made or if the workflow selections made are of an
invalid sequence.
* @private
* @returns {Object} The All-In-One Configuration Object or
Null
*/
function generateAIOConfig() {

var config = {},


required = [],
i = null,

/* Parse Input Value to JSON Identifier List


(Helper Function) */
jsonIDListValue = function ($input) {
return (c.plainIDListToJson($input.val
())).identifiers;
},

/* Parse Input Value to Boolean (Helper Function)


*/
booleanValue = function ($input) {
return $input.is(":checked");
};

/* Get Input Value and add it to the Configuration


(Helper Function) */
function getInputValue($input, process, field, parser)
{
var value = $input.val();

Page 266
if (value !== "") {
if (parser) {
value = parser($input);
}
if (config[process] === undefined) {
config[process] = {};
}
config[process][field] = value;
}
}

/* Get Required & Actual Workflow Selections */


$inputs.each(function () {
if ($(this).prop("checked")) {
config[this.id] = {};
}
$(this).removeAttr("required");
required.push(this.id);
});
var selections = (Object.keys(config)).length;

/* Verify the Workflow Selections and note any


omissions */
var matches = 0,
missing = [];
for (i = 0; i < required.length; i += 1) {
var step = required[i];
if (config[step]) {
if (!matches && step === "jobcreation") {
missing.push("contentcreation");
}
matches += 1;
} else {
if (matches !== 0) {
missing.push(step);
}
}
if (matches === selections) {
break;
}
}

/* Add the inputs to the Workflow Selections to Create

Page 267
the All-In-One Configuration */
if (config.datamining) {
getInputValue($datafile, "datamining",
"identifier");
getInputValue($datamapper, "datamining", "config");
outputDesc = "Data Set ID";
}
if (config.contentcreation) {
getInputValue($template, "contentcreation",
"config");
if (!config.datamining) {
getInputValue($datarecords, "contentcreation",
"identifiers", jsonIDListValue);
$datarecords.removeAttr("disabled");
} else {
$datarecords.attr("disabled", "disabled");
}
outputDesc = "Content Set ID(s)";
}
if (config.jobcreation) {
outputDesc = "Job Set ID";
}
if (config.outputcreation) {
getInputValue($ocpreset, "outputcreation",
"config");
getInputValue($createonly, "outputcreation",
"createOnly", booleanValue);
if (!config.contentcreation) {
getInputValue($jobs, "outputcreation",
"identifiers", jsonIDListValue);
$jobs.removeAttr("disabled");
} else {
$jobs.attr("disabled", "disabled");
}
$createonly.removeAttr("disabled");
$resultastxt.removeAttr("disabled");
outputDesc = "Output";
} else {
$createonly.attr("disabled", "disabled");
$resultastxt.attr("disabled", "disabled");

if (!$resultastxt.is(":checked")) {
$resultastxt.prop("checked", true); }

Page 268
}

if (config.datamining && config.contentcreation &&


config.jobcreation && config.outputcreation) {

getInputValue($jcpreset, "jobcreation", "config");


getInputValue($printrange, "printRange",
"printRange");
$jcpreset.removeAttr("disabled");
$printrange.removeAttr("disabled");
} else {
$jcpreset.attr("disabled", "disabled");
$printrange.attr("disabled", "disabled");
}

/* Red-flag any omissions in Workflow Selections */


if (!selections || missing.length) {
for (i = 0; i < missing.length; i += 1) {
$("#" + missing[i]).attr("required",
"required");
}
return null;
}
return config;
}

$inputs
.on("change", function (event) {
var input = event.target;
var process = $("#" + input.id + "-inputs");
if ($(input).prop("checked")) {
process.removeAttr("disabled");
} else {
process.attr("disabled", "disabled");
}
})
.trigger("change");

$form
.on("change", function (event) {
AIOConfig = generateAIOConfig();
})
.on("submit", function (event) {

Page 269
event.preventDefault();
if (!c.checkSessionValid()) { return; }

if (!AIOConfig) {
alert("Invalid All-In-One
Configuration!\n\nPlease enter a valid " +
"combination of input fields, and try
again.");
return;
}

var getFinalResult = function () {

var result = ($resultastxt.is(":checked")) ?


"getResultTxt" : "getResult";

/* Get Result of Operation */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/print/" + result + "/" + operationId
})
.done(function (response, status, request)
{
if (request.getResponseHeader("Content-
Type") === "application/octet-stream") {
response = "&lt;&lt;OCTET-STREAM
FILE DATA&gt;&gt;";
}
c.displayHeading("Operation Result");
c.displaySubResult(outputDesc,
response);
})
.fail(c.displayDefaultFailure);
};

/* Process All-In-One (JSON) */


$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/print/submit",
data: JSON.stringify(AIOConfig),

Page 270
contentType: "application/json"
})
.done(function (response, status, request) {

var progress = null;


operationId = request.getResponseHeader
("operationId");

$submitButton.attr("disabled", "disabled");
$cancelButton.removeAttr("disabled");

c.displayStatus("All-In-One Operation
Successfully Submitted");
c.displayHeading("Input Configuration");
c.displaySubResult("JSON All-In-One
Configuration", c.jsonPrettyPrint(AIOConfig));
c.displayResult("Operation ID",
operationId);

var getProgress = function () {


if (operationId !== null) {

/* Get Progress of Operation */


$.ajax({
type: "GET",
cache: false,
url:
"/rest/serverengine/workflow/print/getProgress/" + operationId
})
.done(function (response,
status, request) {

if (response !== "done") {


if (response !==
progress) {
progress =
response;
$progressBar.attr
("value", progress);
}
setTimeout(getProgress,
1000);
} else {

Page 271
$progressBar.attr
("value", (progress = 100));
c.displayInfo
("Operation Completed");
getFinalResult();
operationId = null;
setTimeout(function ()
{
$progressBar.attr
("value", 0);

$submitButton.removeAttr("disabled");
$cancelButton.attr
("disabled", "disabled");
}, 100);
}
})
.fail(c.displayDefaultFailure);
}
};
getProgress();
})
.fail(c.displayDefaultFailure);
})
.trigger("change");
});
}(jQuery, Common));

Page 272
Screenshot & Output

Page 273
Page 274
Usage

To run the example simply select the input combination of your choosing, populate the
appropriate input fields and then check any options that you may require.

The following file based input fields can be referenced by Managed File ID or Name:

l Data file
l Data Mapping configuration
l Design template
l Job Creation preset
l Output Creation preset

The following options are only available if the input combination includes output creation:

l Create Only - Create the output in server but do not send spool file to its final destination.
In this example this would mean that the output files(s) would not be sent to the output
directory specified in the output creation preset.
l Get Result as Text - Return the result as text specifically. If our All-In-One Configuration
includes output creation, then in this example this would return the absolute path to the
output file(s).
l Print Range - Restrict the print output to a specific range of records in the input data, not
a specific range of pages (requires input combination with all four processes selected).

Lastly, select the Submit button to start the All-In-One operation.

Once the operation has started processing, the JSON All-In-One Configuration along with the
Operation ID will be displayed in the Results area and the Cancel button will become enabled,
giving you the option to cancel the running operation.

The progress of the operation will be displayed in the progress bar, and once the All-in-One
operation has completed, the result will be returned and displayed to the Results area.

If the All-In-One configuration includes output creation, then the result returned will be the
output files (either their absolute path(s) or the output file itself). If the configuration does not
include output creation, then the result returned will be either a Data Set ID, Content Set IDs or
Job Set ID.

Page 275
Note
If the result returned is expected to be file data, then the value <<OCTET-STREAM FILE
DATA>> will be displayed.

Further Reading

See the All-In-One Service page of the REST API Reference section for further detail.

Page 276
REST API Reference
The PlanetPress Connect REST API defines a number of RESTful services that facilitate
various functionality within the server during workflow processing.

The following table is a summary of the services available in the PlanetPress Connect REST
API:

Service Internal Name Description


Name

Authentication AuthenticationRestService Exposes methods for authenticated


Service access (login & password) to the
PlanetPress Connect REST API. Uses
a combination of basic and token
based authorisation.

Content ContentCreationRestService Exposes methods for the manual


Creation creation, monitoring & cancellation of
Service new Print context based content
creation operations within the
workflow, including a method for
accessing the result of a successful
operation. Also exposes methods for
generating preview PDFs of print
output for single data records.

Content Item ContentItemEntityRestService Exposes methods specific to the


Entity Service Content Item entity type including
property value accessor methods and
an associated data record lookup
method.

Content Set ContentSetEntityRestService Exposes methods specific to the


Entity Service Content Set entity type including
property value accessor methods,
methods to access all content sets and

Page 277
Service Internal Name Description
Name

delete specific content sets, and a


method to access the content item IDs
contained within a specific content set.

Data Record DataRecordEntityRestService Exposes methods specific to the Data


Entity Service Record entity type including accessor
methods for data records and the value
& property values for a specific data
record. Also exposes a method for
adding new records to an existing data
record or data set.

Data Set DataSetEntityRestService Exposes methods specific to the Data


Entity Service Set entity type including property value
accessor methods, methods to access
all data sets and delete specific data
sets, and a method to access the data
record IDs contained within a specific
data set.

Data Mapping DataminingRestService Exposes methods for the manual


Service creation, monitoring & cancellation of
data mapping operations within the
workflow, including a method for
accessing the result of a successful
operation. Also exposes methods for
basic data mapping pass-throughs
specific to PDF VT data files.

Document DocumentEntityRestService Exposes methods specific to the


Entity Service Document entity type including
metadata property value accessor
methods.

Document Set DocumentSetEntityRestService Exposes methods specific to the


Entity Service Document Set entity type including

Page 278
Service Internal Name Description
Name

metadata property value accessor


methods, and a method to access the
document IDs contained within a
specific document set.

Content EmailExportRestService Exposes methods for the manual


Creation creation, monitoring & cancellation of
(Email) new Email context based content
Service creation operations within the
workflow, including a method for
accessing the result of a successful
operation.

Entity Service EntityRestService Exposes a method for the selection of


data (of a specific entity type) using
various search criteria.

File Store FilestoreRestService Exposes methods specific to file store


Service operations in PlanetPress Connect
including the upload of data files, data
mapping configurations, design
templates, job creation presets &
output creation presets. Also exposes
methods for the download and deletion
of existing managed files in the file
store.

Content HTMLMergeRestService Exposes methods for the manual


Creation creation of new Web context based
(HTML) content. Also exposes an additional
Service method to access the resources
withing the Web context of a design
template.

Job Creation JobCreationRestService Exposes methods for the manual


Service creation, monitoring & cancellation of

Page 279
Service Internal Name Description
Name

job creation operations within the


workflow, including a method for
accessing the result of a successful
operation.

Job Entity JobEntityRestService Exposes methods specific to the Job


Service entity type including property and
metadata property value accessor
methods, a method to access the
content items contained within a
specific job, and a method to access
the job segment IDs contained within a
specific job.

Job Segment JobSegmentEntityRestService Exposes methods specific to the Job


Entity Service Segment entity type including
metadata property value accessor
methods, and a method to access the
document set IDs contained within a
specific job segment.

Job Set Entity JobSetEntityRestService Exposes methods specific to the Job


Service Set entity type including property and
metadata property value accessor
methods, methods to access all jobs
sets and delete specific data sets, and
a method to access the job IDs
contained within a specific job set.

Output OutputCreationRestService Exposes methods for the manual


Creation creation, monitoring & cancellation of
Service output creation operations within the
workflow, including methods for
accessing the result of a successful
operation.

Page 280
Service Internal Name Description
Name

All-In-One PrintRestService Exposes methods for the manual


Service creation, monitoring & cancellation of
"All-In-One" operations within the
workflow, including methods for
accessing the result of a successful
operation.

Page 281
Authentication Service
The following table is a summary of the resources and methods available in the Authentication
service:

Method Name Uniform Resource Identifier (URI) Method Type

Service Handshake /authentication GET

Authenticate/Login to Server /authentication/login POST

Service Version /authentication/version GET

Page 282
Service Handshake
Queries the availability of the Authentication service.

Type: GET

URI: /rest/serverengine/authentication

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


AuthenticationRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 283
Authenticate/Login to Server
Submits an authentication request (using credentials) to the PlanetPress Connect server and if
successful provides access to the various other REST API services available.

Request takes no content, but requires an additional Authorization header which contains a
base64 encoded set of credentials (basic user name & password). On success, the response
with return an authorization token which can then be used as an additional auth_token header
in any future requests made to the REST API services.

Warning
If server security settings are enabled and a request is made to any resource of any
service in the REST API, if that request contains no authorization token and no
Authorization header, then the response will come back as Unauthorized and will contain
an additional WWW-Authenticate response header.

Type: POST

URI: /rest/serverengine/authentication/login

Parameters: -

Request:
Add. Authorization – Basic User name & Password
Headers: credentials (Base64 encoded)

Content: -

Content -
Type:

Response:
Add. WWW-Authenticate – BASIC (Prompt for Basic
Headers: Authorization Credentials when no Authorization header
specified)

Page 284
Content: Authorization Token

Content text/plain
Type:

Status: l 200 OK – Server authentication successful, new


token generated
l 401 Unauthorized – Server authentication has failed
or no credentials have been provided/specified in
request header

Page 285
Service Version
Returns the version of the Authentication service.

Type: GET

URI: /rest/serverengine/authentication/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 286
Content Creation Service
The following table is a summary of the resources and methods available in the Content
Creation service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /workflow/contentcreation GET

Process Content Creation /workflow/contentcreation/{templateId}/ POST


{dataSetId}

Process Content Creation (By /workflow/contentcreation/{templateId} POST


Data Record) (JSON)

Create Preview PDF /workflow/contentcreation/pdfpreview/ POST


{templateId}/{dmConfigId}

Create Preview PDF (JSON) /workflow/contentcreation/pdfpreview/ POST


{templateId}

Create Preview PDF (By Data /workflow/contentcreation/pdfpreviewdirect GET


Record)

Get All Operations /workflow/contentcreation/getOperations GET

Get Progress of Operation /workflow/contentcreation/getProgress/ GET


{operationId}

Get Result of Operation /workflow/contentcreation/getResult/ POST


{operationId}

Cancel an Operation /workflow/contentcreation/cancel/ POST


{operationId}

Service Version /workflow/contentcreation/version GET

Page 287
Service Handshake
Queries the availability of the Content Creation service.

Type: GET

URI: /rest/serverengine/workflow/contentcreation

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


ContentCreationRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 288
Process Content Creation
Submits a request to initiate a new Content Creation operation.

Request takes no content, and on success returns a response containing additional headers
that specify the ID of the new operation as well as link URLs that can be used to retrieve further
information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/{templateId}/{dataSetId}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store
l dataSetId – the ID of the Data Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. l operationId – Operation ID of new Content
Headers: Creation operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -

Page 289
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 400 Bad Request – Design template or Data Set
entity not found in File Store/Server
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 290
Process Content Creation (By Data Record) (JSON)
Submits a request to initiate a new Content Creation operation.

Request takes a JSON Identifier List of Data Record IDs as content, and on success returns a
response containing additional headers that specify the ID of the new operation as well as link
URLs that can be used to retrieve further information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/{templateId}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Identifier List specifying a list of Data Record entity


IDs

Content application/json
Type:

Response:
Add. l operationId – Operation ID of new Content
Headers: Creation operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -

Page 291
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 400 Bad Request – Design template or Data
Record entity not found in File Store/Server
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 292
Create Preview PDF
Submits a request to create a preview PDF of the print output for a single data record.

Request takes binary file data as content, and on success returns a response containing the
Managed File ID for the newly created preview PDF file.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/pdfpreview/{templateId}/
{dmConfigId}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store
l dmConfigId – the Managed File ID (or Name) of the Data Mapping
configuration in File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Data File (File)

Content application/octet-stream
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Page 293
Status: l 200 OK – Creation of preview PDF in File Store
successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Design template or Data Mapping
configuration not found in File Store

Page 294
Create Preview PDF (JSON)
Submits a request to create a preview PDF of the print output for a single data record.

Request takes JSON file data as content, and on success returns a response containing the
Managed File ID for the newly created preview PDF file.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/pdfpreview/{templateId}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Data File (File)

Content application/json
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Status: l 200 OK – Creation of preview PDF in File Store


successful
l 401 Unauthorized – Server authentication required

Page 295
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Design template not found in File
Store
l 500 Internal Server Error – JSON data is not in the
expected format/structure

Page 296
Create Preview PDF (By Data Record)
Submits a request to create a preview PDF of the print output for a single data record.

Request takes no content, and on success returns a response containing the Managed File ID
for the newly created preview PDF file.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/pdfpreviewdirect

Parameters: Query:

l templateId – the Managed File ID (or Name) of the design template in


File Store
l dataRecordId – the ID of the Data Record entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Status: l 200 OK – Creation of preview PDF in File Store


successful

Page 297
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Design template or Data Record
entity not found in File Store/Server

Page 298
Get All Operations
Returns a list of all the workflow operations actively running on the Server.

Request takes no content, and on success returns a response containing a JSON Operations
List of all the actively running operations.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/getOperations

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Operations List of all the actively running


operations in Server

Content application/json
Type:

Status: l 200 OK – List of actively running operations


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 299
Get Progress of Operation
Retrieves the progress of a running Content Creation operation of a specific operation ID.

Request takes no content, and on success returns a response containing the current value of
operation progress (values ranging from 0 – 100, followed by the value of 'done' on
completion).

Type: GET

URI: /rest/serverengine/workflow/contentcreation/getProgress/{operationId}

Parameters: Path:

l operationId – Operation ID of Content Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Progress value of Content Creation operation

Content text/plain
Type:

Status: l 200 OK – Progress of operation successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 300
l 403 Forbidden – Server authentication has failed
or expired

Page 301
Get Result of Operation
Retrieves the final result of a completed Content Creation operation of a specific operation ID.

Request takes no content, and on success returns a response containing the IDs of the Content
Sets produced.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/getResult/{operationId}

Parameters: Path:

l operationId – Operation ID of Content Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Content Set IDs

Content text/plain
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 302
l 403 Forbidden – Server authentication has failed
or expired

Page 303
Cancel an Operation
Requests the cancellation of a running Content Creation operation of a specific operation ID.

Request takes no content, and on success returns a response with no content.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/cancel/{operationId}

Parameters: Path:

l operationId – Operation ID of Content Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 204 No Content – Operation cancellation


requested
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 304
Service Version
Returns the version of the Content Creation service.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 305
Content Item Entity Service
The following table is a summary of the resources and methods available in the Content Item
Entity service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /entity/contentitems GET

Get Data Record for Content Item /entity/contentitems/ GET


{contentItemId}/datarecord

Get Content Item Properties /entity/contentitems/ GET


{contentItemId}/properties

Update Content Item Properties /entity/contentitems/ PUT


{contentItemId}/properties

Update Multiple Content Item /entity/contentitems/properties PUT


Properties

Service Version /entity/contentitems/version GET

Page 306
Service Handshake
Queries the availability of the Content Item Entity service.

Type: GET

URI: /rest/serverengine/entity/contentitems

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


ContentItemEntityRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 307
Get Data Record for Content Item
Returns the ID of the corresponding Data Record for a specific Content Item entity.

Request takes no content, and on success returns a response containing a JSON Data Record
Identifier for the Data Record of the Content Item.

Type: GET

URI: /rest/serverengine/entity/contentitems/{contentItemId}/datarecord

Parameters: Path:

l contentItemId – the ID of the Content Item entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Data Record Identifier for the Data Record of


Content Item

Content application/json
Type:

Status: l 200 OK – Data Record Identifier returned


l 401 Unauthorized – Server authentication required

Page 308
l 403 Forbidden – Server authentication has failed
or expired

Page 309
Get Content Item Properties
Returns a list of the properties for a specific Content Item entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the properties for the Content Item.

Type: GET

URI: /rest/serverengine/entity/contentitems/{contentItemId}/properties

Parameters: Path:

l contentItemId – the ID of the Content Item entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of properties for


Content Item

Content application/json
Type:

Status: l 200 OK – Content Item entity properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 310
l 403 Forbidden – Server authentication has failed or
expired

Page 311
Update Content Item Properties
Submits a request to update (and replace) the properties for a specific Content Item entity in the
Server.

Request takes a JSON Name/Value List as content (the Content Item ID and the new
properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/contentitems/{contentItemId}/properties

Parameters: Path:

l contentItemId – the ID of the Content Item entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of properties for Content Item

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Content Item

Content text/plain
Type:

Status: l 200 OK – Update of Content Item properties


successfully requested (response of “true” for

Page 312
success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Content
Item ID mismatch in JSON

Page 313
Update Multiple Content Item Properties
Submits a request to update one or more properties for one or more Content Item entities in the
Server.

Request takes multiple JSON Name/Value Lists as content (each with the Content Item ID and
the new properties), and on success returns a response containing no content.

Type: PUT

URI: /rest/serverengine/entity/contentitems/properties

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value Lists of the properties of the Content


Items

Content application/json
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 200 OK – Properties of Content Item entities


successfully updated
l 401 Unauthorized – Server authentication required

Page 314
l 403 Forbidden – Server authentication has failed
or expired

Page 315
Service Version
Returns the version of the Content Item Entity service.

Type: GET

URI: /rest/serverengine/entity/contentitems/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 316
Content Set Entity Service
The following table is a summary of the resources and methods available in the Content Set
Entity service:

Method Name Uniform Resource Identifier (URI) Method


Type

Get All Content Set Entities /entity/contentsets GET

Get Content Items for Content /entity/contentsets/{contentSetId} GET


Set

Get Page Details for Content /entity/contentsets/{contentSetId}/pages GET


Set

Delete Content Set Entity /entity/contentsets/{contentSetId}/delete POST

Get Content Set Properties /entity/contentsets/ GET


{contentSetId}/properties

Update Content Set Properties /entity/contentsets/ PUT


{contentSetId}/properties

Service Version /entity/contentsets/version GET

Page 317
Get All Content Set Entities
Returns a list of all the Content Set entities currently contained within the Server.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Content Sets.

Type: GET

URI: /rest/serverengine/entity/contentsets

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Content Sets in Server

Content application/json
Type:

Status: l 200 OK – Identifier List of Content Sets returned


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 318
Get Content Items for Content Set
Returns a list of all the Content Item entities (and their corresponding Data Record entities)
contained within a specific Content Set entity.

Request takes no content, and on success returns a response containing a JSON Content Item
Identifier List of all the Content Items in the Content Set.

Type: GET

URI: /rest/serverengine/entity/contentsets/{contentSetId}

Parameters: Path:

l contentSetId – the ID of the Content Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Content Item Identifier List of all the Content Items
in Content Set

Content application/json
Type:

Status: l 200 OK – Content Item Identifier List returned


l 401 Unauthorized – Server authentication required

Page 319
l 403 Forbidden – Server authentication has failed or
expired

Page 320
Get Page Details for Content Set
Returns a list of the page details for a specific Content Set entity.

Request takes no content, and on success returns a response containing either:

l a JSON Page Details Summary, or


l a JSON Page Details List (page details broken down by Content Items)

Type: GET

URI: /rest/serverengine/entity/contentsets/{contentSetId}/pages

Parameters: Path:

l contentSetId – the ID of the Content Set entity in Server

Query:

l detail – Return a full list of details instead of a summary (Possible


values: true or false. Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Page Details Summary or JSON Page Details List


containing page details for Content Set

Page 321
Content application/json
Type:

Status: l 200 OK – Content Set entity page details


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 322
Delete Content Set Entity
Submits a request for a specific Content Set entity to be marked for deletion from the Server.

Request takes no content, and on success returns a response containing the result of the
request for deletion (“true” or “false”).

Type: POST

URI: /rest/serverengine/entity/contentsets/{contentSetId}/delete

Parameters: Path:

l contentSetId – the ID of the Content Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Result of request for Content Set removal

Content text/plain
Type:

Status: l 200 OK – Deletion of Content Set successfully


requested from Server (response of “true” for
success or “false” for failure)
l 401 Unauthorized – Server authentication required

Page 323
l 403 Forbidden – Server authentication has failed or
expired

Page 324
Get Content Set Properties
Returns a list of the properties for a specific Content Set entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the properties for the Content Set.

Type: GET

URI: /rest/serverengine/entity/contentsets/{contentSetId}/properties

Parameters: Path:

l contentSetId – the ID of the Content Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of properties


for Content Set

Content application/json
Type:

Status: l 200 OK – Content Set entity properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 325
l 403 Forbidden – Server authentication has failed
or expired

Page 326
Update Content Set Properties
Submits a request to update (and replace) the properties for a specific Content Set entity in the
Server.

Request takes a JSON Name/Value List as content (the Content Set ID and the new
properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/contentsets/{contentSetId}/properties

Parameters: Path:

l contentSetId – the ID of the Content Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of properties for Content Set

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Content Set

Content text/plain
Type:

Status: l 200 OK – Update of Content Set properties


successfully requested (response of “true” for

Page 327
success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Content
Set ID mismatch in JSON

Page 328
Service Version
Returns the version of the Content Set Entity service.

Type: GET

URI: /rest/serverengine/entity/contentsets/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 329
Data Record Entity Service
The following table is a summary of the resources and methods available in the Data Record
Entity service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /entity/datarecords GET

Add Data Records /entity/datarecords POST

Get Data Record Values /entity/datarecords/ GET


{dataRecordId}/values

Update Data Record Values /entity/datarecords/ PUT


{dataRecordId}/values

Get Data Record Properties /entity/datarecords/ GET


{dataRecordId}/properties

Update Data Record Properties /entity/datarecords/ PUT


{dataRecordId}/properties

Get Multiple Data Record Values /entity/datarecords/values GET

Update Multiple Data Record /entity/datarecords PUT


Values

Update Multiple Data Record /entity/datarecords/properties PUT


Properties

Service Version /entity/datarecords/version GET

Page 330
Service Handshake
Queries the availability of the Data Record Entity service.

Type: GET

URI: /rest/serverengine/entity/datarecords

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


DataRecordEntityRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 331
Add Data Records
Submits a request to add one or more Data Record entities to one or more entities in the Server
as either:

l a Data Record of an existing Data Set entity in the Server, or


l a nested Data Record in a Data Table of an existing Data Record entity in the Server

Request takes multiple JSON New Record Lists as content (each with the Data Set/Data
Record ID, Data Table and the new records/values), and on success returns a response
containing no content.

Type: POST

URI: /rest/serverengine/entity/datarecords

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON New Record Lists of the new Data Records

Content application/json
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 200 OK – Data Records for Data Set/Data Record

Page 332
entities successfully added
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – JSON New Record Lists
invalid or missing required structure

Page 333
Get Data Record Values
Returns a list of the values for a specific Data Record entity, and potentially the values of any
nested Data Records (if recursive).

Request takes no content, and on success returns a response containing a JSON Record
Content List of all the values in the Data Record.

Type: GET

URI: /rest/serverengine/entity/datarecords/{dataRecordId}/values

Parameters: Path:

l dataRecordId – the ID of the Data Record entity in Server

Query:

l recursive – recurse all Data Tables within the Data Record and
retrieve the values of any nested Data Records also (Default Value:
"false")

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Record Content List of the values in Data Record

Page 334
Content application/json
Type:

Status: l 200 OK – Data Record entity values successfully


retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or invalid
Data Record ID specified

Page 335
Update Data Record Values
Submits a request to update one or more values for a specific Data Record entity in the Server.

Request takes a JSON Record Content List (Fields Only) as content (the Data Record ID and
the new values), and on success returns a response containing no content.

Type: PUT

URI: /rest/serverengine/entity/datarecords/{dataRecordId}/values

Parameters: Path:

l dataRecordId – the ID of the Data Record entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Record Content List (Fields Only) of the values for
Data Record

Content application/json
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 200 OK – Data Record entity values successfully


updated
l 401 Unauthorized – Server authentication required

Page 336
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Data
Record ID mismatch in JSON

Page 337
Get Data Record Properties
Returns a list of the properties for a specific Data Record entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the properties for the Data Record.

Type: GET

URI: /rest/serverengine/entity/datarecords/{dataRecordId}/properties

Parameters: Path:

l dataRecordId – the ID of the Data Record entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of properties for


Data Record

Content application/json
Type:

Status: l 200 OK – Data Record entity properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 338
l 403 Forbidden – Server authentication has failed or
expired

Page 339
Update Data Record Properties
Submits a request to update (and replace) the properties for a specific Data Record entity in the
Server.

Request takes a JSON Name/Value List as content (the Data Record ID and the new
properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/datarecords/{dataRecordId}/properties

Parameters: Path:

l dataRecordId – the ID of the Data Record entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of properties for Data Record

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Data Record

Content text/plain
Type:

Status: l 200 OK – Update of Data Record properties


successfully requested (response of “true” for

Page 340
success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Data
Record ID mismatch in JSON

Page 341
Get Multiple Data Record Values
Returns a list of the values for one or more Data Record entities, and potentially the values of
any nested Data Records (if recursive).

Request takes no content, and on success returns a response containing multiple JSON
Record Content Lists of all the values in each Data Record.

Type: GET

URI: /rest/serverengine/entity/datarecords/values

Parameters: Query:

l id – the ID of each Data Record entity in Server


l recursive – recurse all Data Tables within each Data Record and
retrieve the values of any nested Data Records also (Default Value:
"false")

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Record Content Lists of the values in each Data


Record

Content application/json
Type:

Page 342
Status: l 200 OK – Data Record entity values successfully
retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or invalid
Data Record ID specified

Page 343
Update Multiple Data Record Values
Submits a request to update one or more values for one or more Data Record entities in the
Server.

Request takes multiple JSON Record Content Lists (Fields Only) as content (each with the
Data Record ID and the new values), and on success returns a response containing no content.

Type: PUT

URI: /rest/serverengine/entity/datarecords

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Record Content Lists (Fields Only) of the values


for the Data Records

Content application/json
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 200 OK – Values of Data Record entities


successfully updated
l 401 Unauthorized – Server authentication required

Page 344
l 403 Forbidden – Server authentication has failed
or expired

Page 345
Update Multiple Data Record Properties
Submits a request to update one or more properties for one or more Data Record entities in the
Server.

Request takes multiple JSON Name/Value Lists as content (each with the Data Record ID and
the new properties), and on success returns a response containing no content.

Type: PUT

URI: /rest/serverengine/entity/datarecords/properties

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value Lists of the properties of the Data


Records

Content application/json
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 200 OK – Properties of Data Record entities


successfully updated
l 401 Unauthorized – Server authentication required

Page 346
l 403 Forbidden – Server authentication has failed
or expired

Page 347
Service Version
Returns the version of the Data Record Entity service.

Type: GET

URI: /rest/serverengine/entity/datarecords/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 348
Data Set Entity Service
The following table is a summary of the resources and methods available in the Data Set Entity
service:

Method Name Uniform Resource Identifier (URI) Method Type

Get All Data Set Entities /entity/datasets GET

Get Data Records for Data Set /entity/datasets/{dataSetId} GET

Delete Data Set Entity /entity/datasets/{dataSetId}/delete POST

Get Data Set Properties /entity/datasets/{dataSetId}/properties GET

Update Data Set Properties /entity/datasets/{dataSetId}/properties PUT

Service Version /entity/datasets/version GET

Page 349
Get All Data Set Entities
Returns a list of all the Data Set entities currently contained within the Server.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Data Sets.

Type: GET

URI: /rest/serverengine/entity/datasets

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Data Sets in Server

Content application/json
Type:

Status: l 200 OK – Identifier List of Data Sets returned


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 350
Get Data Records for Data Set
Returns a list of all the Data Record entities contained within a specific Data Set entity.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Data Records in the Data Set.

Type: GET

URI: /rest/serverengine/entity/datasets/{dataSetId}

Parameters: Path:

l dataSetId – the ID of the Data Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Data Records in Data Set

Content application/json
Type:

Status: l 200 OK – Identifier List of Data Records returned


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 351
Delete Data Set Entity
Submits a request for a specific Data Set entity to be marked for deletion from the Server.

Request takes no content, and on success returns a response containing the result of the
request for deletion (“true” or “false”).

Type: POST

URI: /rest/serverengine/entity/datasets/{dataSetId}/delete

Parameters: Path:

l dataSetId – the ID of the Data Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Result of request for Data Set removal

Content text/plain
Type:

Status: l 200 OK – Deletion of Data Set successfully


requested from Server (response of “true” for
success or “false” for failure)
l 401 Unauthorized – Server authentication required

Page 352
l 403 Forbidden – Server authentication has failed or
expired

Page 353
Get Data Set Properties
Returns a list of the properties for a specific Data Set entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the properties for the Data Set.

Type: GET

URI: /rest/serverengine/entity/datasets/{dataSetId}/properties

Parameters: Path:

l dataSetId – the ID of the Data Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of properties


for Data Set

Content application/json
Type:

Status: l 200 OK – Data Set entity properties successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 354
l 403 Forbidden – Server authentication has failed
or expired

Page 355
Update Data Set Properties
Submits a request to update (and replace) the properties for a specific Data Set entity in the
Server.

Request takes a JSON Name/Value List as content (the Data Set ID and the new properties),
and on success returns a response containing the result of the request for update/replacement
(“true”).

Type: PUT

URI: /rest/serverengine/entity/datasets/{dataSetId}/properties

Parameters: Path:

l dataSetId – the ID of the Data Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of properties for Data Set

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Data Set

Content text/plain
Type:

Status: l 200 OK – Update of Data Set properties


successfully requested (response of “true” for

Page 356
success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Data Set
ID mismatch in JSON

Page 357
Service Version
Returns the version of the Data Set Entity service.

Type: GET

URI: /rest/serverengine/entity/datasets/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 358
Data Mapping Service
The following table is a summary of the resources and methods available in the Data Mapping
service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /workflow/datamining GET

Process Data Mapping /workflow/datamining/{configId}/ POST


{dataFileId}

Process Data Mapping (JSON) /workflow/datamining/{configId} POST

Process Data Mapping (PDF/VT to /workflow/datamining/pdfvtds/ POST


Data Set) {dataFileId}

Process Data Mapping (PDF/VT to /workflow/datamining/pdfvtcs/ POST


Content Set) {dataFileId}

Get All Operations /workflow/datamining/getOperations GET

Get Progress of Operation /workflow/datamining/getProgress/ GET


{operationId}

Get Result of Operation /workflow/datamining/getResult/ POST


{operationId}

Cancel an Operation /workflow/datamining/cancel/ POST


{operationId}

Service Version /workflow/datamining/version GET

Page 359
Service Handshake
Queries the availability of the Data Mapping service.

Type: GET

URI: /rest/serverengine/workflow/datamining

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


DataMiningRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 360
Process Data Mapping
Submits a request to initiate a new Data Mapping operation.

Request takes no content, and on success returns a response containing additional headers
that specify the ID of the new operation as well as link URLs that can be used to retrieve further
information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/datamining/{configId}/{dataFileId}

Parameters: Path:

l configId – the Managed File ID (or Name) of the Data Mapping


configuration in File Store
l dataFileId – the Managed File ID (or Name) of the data file in File
Store

Query:

l validate – Only validate the Data Mapping operation to check for


mapping errors (Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. l operationId – Operation ID of new Data Mapping
Headers: operation
l Link – Contains multiple link URLs that can be

Page 361
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 400 Bad Request – Data file or Data Mapping
Configuration not found in File Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Response
Add. l operationId – Operation ID of new Data Mapping
(Validate):
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Data file or Data
Mapping Configuration not found in File Store

Page 362
Process Data Mapping (JSON)
Submits a request to initiate a new Data Mapping operation.

As content the request takes one of either:

l a JSON Identifier of the data file’s Managed File ID, or


l a JSON Identifier (Named) of the data file’s Managed File Name

On success, it returns a response containing additional headers that specify the ID of the new
operation as well as link URLs that can be used to retrieve further information/cancel the
operation.

Type: POST

URI: /rest/serverengine/workflow/datamining/{configId}

Parameters: Path:

l configId – the Managed File ID (or Name) of the Data Mapping


configuration in File Store

Query:

l validate – Only validate the Data Mapping operation to check for


mapping errors (Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Identifier specifying Managed File ID or JSON


Identifier (Named) specifying Managed File Name in File
Store

Content application/json
Type:

Page 363
Response:
Add. l operationId – Operation ID of new Data Mapping
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 400 Bad Request – Data file or Data Mapping
Configuration not found in File Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – JSON Identifier bad or
missing

Response
Add. l operationId – Operation ID of new Data Mapping
(Validate):
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful

Page 364
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – JSON Identifier bad or
missing, or Data file or Data Mapping Configuration
not found in File Store

Page 365
Process Data Mapping (PDF/VT to Data Set)
Submits a request to initiate a new Data Mapping operation using a PDF/VT data file
specifically.

No Data Mapping configuration is specified, and a Data Set will be created based on the
default properties extracted from the metadata of the PDF/VT data file.

Request takes no content, and on success returns a response containing additional headers
that specify the ID of the new operation as well as link URLs that can be used to retrieve further
information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/datamining/pdfvtds/{dataFileId}

Parameters: Path:

l dataFileId – the Managed File ID (or Name) of the PDF/VT data file in
File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. l operationId – Operation ID of new Data Mapping
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Page 366
Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 400 Bad Request – PDF/VT data file not found in
File Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 367
Process Data Mapping (PDF/VT to Content Set)
Submits a request to initiate a new Data Mapping operation using a PDF/VT data file
specifically.

No Data Mapping configuration or design template are specified, and a Content Set will be
created based on the default properties extracted from the metadata of the PDF/VT data file.

Request takes no content, and on success returns a response containing additional headers
that specify the ID of the new operation as well as link URLs that can be used to retrieve further
information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/datamining/pdfvtcs/{dataFileId}

Parameters: Path:

l dataFileId – the Managed File ID (or Name) of the PDF/VT data file in
File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. l operationId – Operation ID of new Data Mapping
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Page 368
Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 400 Bad Request – PDF/VT data file not found in
File Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 369
Get All Operations
Returns a list of all the workflow operations actively running on the Server.

Request takes no content, and on success returns a response containing a JSON Operations
List of all the actively running operations.

Type: GET

URI: /rest/serverengine/workflow/datamining/getOperations

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Operations List of all the actively running


operations in Server

Content application/json
Type:

Status: l 200 OK – List of actively running operations


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 370
Get Progress of Operation
Retrieves the progress of a running Data Mapping operation of a specific operation ID.

Request takes no content, and on success returns a response containing the current value of
operation progress (values ranging from 0 – 100, followed by the value of 'done' on
completion).

Type: GET

URI: /rest/serverengine/workflow/datamining/getProgress/{operationId}

Parameters: Path:

l operationId – Operation ID of Data Mapping operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Progress value of Data Mapping operation

Content text/plain
Type:

Status: l 200 OK – Progress of operation successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 371
l 403 Forbidden – Server authentication has failed
or expired

Page 372
Get Result of Operation
Retrieves the final result of a completed Data Mapping operation of a specific operation ID.

Request takes no content, and on success returns a response containing the ID of the Data Set
produced (or Content Set for a PDF/VT to Content Set specific data mapping operation).

Alternatively, if the operation was to only validate the data mapping, then a response
containing a JSON Data Mapping Validation Result will be returned instead.

Type: POST

URI: /rest/serverengine/workflow/datamining/getResult/{operationId}

Parameters: Path:

l operationId – Operation ID of Data Mapping operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Data Set ID (or Content Set ID)

Content text/plain
Type:

Status: l 200 OK – Result of completed operation

Page 373
successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Response
Add. -
(Validate):
Headers:

Content: JSON Data Mapping Validation Result

Content text/plain
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 374
Cancel an Operation
Requests the cancellation of a running Data Mapping operation of a specific operation ID.

Request takes no content, and on success returns a response with no content.

Type: POST

URI: /rest/serverengine/workflow/datamining/cancel/{operationId}

Parameters: Path:

l operationId – Operation ID of Data Mapping operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 204 No Content – Operation cancellation


requested
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 375
Service Version
Returns the version of the Data Mapping service.

Type: GET

URI: /rest/serverengine/workflow/datamining/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 376
Document Entity Service
The following table is a summary of the resources and methods available in the Document
Entity service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /entity/documents GET

Get Document Metadata Properties /entity/documents/ GET


{documentId}/metadata

Update Document Metadata /entity/documents/ PUT


Properties {documentId}/metadata

Service Version /entity/documents/version GET

Page 377
Service Handshake
Queries the availability of the Document Entity service.

Type: GET

URI: /rest/serverengine/entity/documents

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


DocumentEntityRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 378
Get Document Metadata Properties
Returns a list of the metadata properties for a specific Document entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the metadata properties for the Document.

Type: GET

URI: /rest/serverengine/entity/documents/{documentId}/metadata

Parameters: Path:

l documentId – the ID of the Document entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of metadata


properties for Document

Content application/json
Type:

Status: l 200 OK – Document entity metadata properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 379
l 403 Forbidden – Server authentication has failed or
expired

Page 380
Update Document Metadata Properties
Submits a request to update (and replace) the metadata properties for a specific Document
entity in the Server.

Request takes a JSON Name/Value List as content (the Document ID and the new metadata
properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/documents/{documentId}/metadata

Parameters: Path:

l documentId – the ID of the Document entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of metadata properties for


Document

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Document

Content text/plain
Type:

Status: l 200 OK – Update of Document metadata properties

Page 381
successfully requested (response of “true” for
success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or
Document ID mismatch in JSON

Page 382
Service Version
Returns the version of the Document Entity service.

Type: GET

URI: /rest/serverengine/entity/documents/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 383
Document Set Entity Service
The following table is a summary of the resources and methods available in the Document Set
Entity service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /entity/documentsets GET

Get Documents for Document Set /entity/documentsets/{documentSetId} GET

Get Document Set Metadata /entity/documentsets/ GET


Properties {documentSetId}/metadata

Update Document Set Metadata /entity/documentsets/ PUT


Properties {documentSetId}/metadata

Service Version /entity/documentsets/version GET

Page 384
Service Handshake
Queries the availability of the Document Set Entity service.

Type: GET

URI: /rest/serverengine/entity/documentsets

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


DocumentSetEntityRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 385
Get Documents for Document Set
Returns a list of all the Document entities contained within a specific Document Set entity.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Documents in the Document Set.

Type: GET

URI: /rest/serverengine/entity/documentsets/{documentSetId}

Parameters: Path:

l documentSetId – the ID of the Document Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Documents in Document


Set

Content application/json
Type:

Status: l 200 OK – Identifier List of Documents returned


l 401 Unauthorized – Server authentication required

Page 386
l 403 Forbidden – Server authentication has failed
or expired

Page 387
Get Document Set Metadata Properties
Returns a list of the metadata properties for a specific Document Set entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the metadata properties for the Document Set.

Type: GET

URI: /rest/serverengine/entity/documentsets/{documentSetId}/metadata

Parameters: Path:

l documentSetId – the ID of the Document Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of metadata


properties for Document Set

Content application/json
Type:

Status: l 200 OK – Document Set entity metadata properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 388
l 403 Forbidden – Server authentication has failed or
expired

Page 389
Update Document Set Metadata Properties
Submits a request to update (and replace) the metadata properties for a specific Document Set
entity in the Server.

Request takes a JSON Name/Value List as content (the Document Set ID and the new
metadata properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/documentsets/{documentSetId}/metadata

Parameters: Path:

l documentSetId – the ID of the Document Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of metadata properties for


Document Set

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Document Set

Content text/plain
Type:

Status: l 200 OK – Update of Document Set metadata

Page 390
properties successfully requested (response of
“true” for success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or
Document Set ID mismatch in JSON

Page 391
Service Version
Returns the version of the Document Set Entity service.

Type: GET

URI: /rest/serverengine/entity/documentsets/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 392
Content Creation (Email) Service
The following table is a summary of the resources and methods available in the Content
Creation (Email) service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /workflow/contentcreation/email GET

Process Content Creation (By /workflow/contentcreation/email/{templateId} POST


Data Record) (JSON)

Get All Operations /workflow/contentcreation/email/getOperations GET

Get Progress of Operation /workflow/contentcreation/email/getProgress/ GET


{operationId}

Get Result of Operation /workflow/contentcreation/email/getResult/ POST


{operationId}

Cancel an Operation /workflow/contentcreation/email/cancel/ POST


{operationId}

Service Version /workflow/contentcreation/email/version GET

Page 393
Service Handshake
Queries the availability of the Content Creation (Email) service.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/email

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

/workflow/contentcreation/email is available

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 394
Process Content Creation (By Data Record) (JSON)
Submits a request to initiate a new Content Creation (Email) operation.

Request takes a JSON Identifier List (with Email Parameters) of Data Record IDs as content,
and on success returns a response containing additional headers that specify the ID of the new
operation as well as link URLs that can be used to retrieve further information/cancel the
operation.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/email/{templateId}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store

Query:

l section – the Section of the Email context to export (No Default


Value)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Identifier List (with Email Parameters) of Data


Record IDs specifying a list of Data Record entity IDs and
parameters to be used for content creation.

Content application/json
Type:

Response:
Add. l operationId – Operation ID of new Content
Headers: Creation (Email) operation

Page 395
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Design template or Data Record
entity not found in File Store/Server

Page 396
Get All Operations
Returns a list of all the workflow operations actively running on the Server.

Request takes no content, and on success returns a response containing a JSON Operations
List of all the actively running operations.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/email/getOperations

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Operations List of all the actively running


operations in Server

Content application/json
Type:

Status: l 200 OK – List of actively running operations


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 397
Get Progress of Operation
Retrieves the progress of a running Content Creation (Email) operation of a specific operation
ID.

Request takes no content, and on success returns a response containing the current value of
operation progress (values ranging from 0 – 100, followed by the value of 'done' on
completion).

Type: GET

URI: /rest/serverengine/workflow/contentcreation/email/getProgress/
{operationId}

Parameters: Path:

l operationId – Operation ID of Content Creation (Email) operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Progress value of Content Creation (Email) operation

Content text/plain
Type:

Status: l 200 OK – Progress of operation successfully

Page 398
retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 399
Get Result of Operation
Retrieves the final result of a completed Content Creation (Email) operation of a specific
operation ID.

Request takes no content, and on success returns a response containing a report on the
number of emails that were successfully sent.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/email/getResult/{operationId}

Parameters: Path:

l operationId – Operation ID of Content Creation (Email) operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Result of Content Creation (Email) Operation (with


successful email count) (e.g. "3 of 3 emails sent")

Content text/plain
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved

Page 400
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 401
Cancel an Operation
Requests the cancellation of a running Content Creation (Email) operation of a specific
operation ID.

Request takes no content, and on success returns a response with no content.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/email/cancel/{operationId}

Parameters: Path:

l operationId – Operation ID of Content Creation (Email) operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 204 No Content – Operation cancellation


requested
l 401 Unauthorized – Server authentication required

Page 402
l 403 Forbidden – Server authentication has failed
or expired

Page 403
Service Version
Returns the version of the Content Creation (Email) service.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/email/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 404
Entity Service
The following table is a summary of the resources and methods available in the Entity service:

Method Name Uniform Resource Identifier (URI) Method Type

Service Handshake /entity GET

Find Data Entity /entity/find PUT

Service Version /entity/version GET

Page 405
Service Handshake
Queries the availability of the Entity service.

Type: GET

URI: /rest/serverengine/entity

Parameters: -

Requs
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


EntityRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 406
Find Data Entity
Submits data entity search criteria to the PlanetPress Connect Server.

Request takes a JSON Search Parameters structure as content and on success returns a
response containing JSON Identifier Lists (with Sort Key) of the data entity IDs matching the
search criteria.

Type: PUT

URI: /rest/serverengine/entity/find

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Search Parameters containing search


criteria/rules

Content application/json
Type:

Response:
Add. -
Headers:

Content: JSON Identifier Lists (with Sort Key) containing all the
entities matching the search criteria

Content application/json
Type:

Status: l 200 OK – Search request successfully executed


l 401 Unauthorized – Server authentication required

Page 407
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Invalid
JSON structure specified

Page 408
Service Version
Returns the version of the Entity service.

Type: GET

URI: /rest/serverengine/entity/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 409
File Store Service
The following table is a summary of the resources and methods available in the File Store
service:

Method Name Uniform Resource Identifier Method


(URI) Type

Service Handshake /filestore GET

Download Managed File or /filestore/file/{fileId} GET


Directory

Delete Managed File or Directory /filestore/delete/{fileId} GET

Upload Data Mapping Configuration /filestore/DataMiningConfig POST

Upload Job Creation Preset /filestore/JobCreationConfig POST

Upload Data File /filestore/DataFile POST

Upload Design Template /filestore/template POST

Upload Output Creation Preset /filestore/OutputCreationConfig POST

Service Version /filestore/version GET

Page 410
Service Handshake
Queries the availability of the File Store service.

Type: GET

URI: /rest/serverengine/filestore

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


FilestoreRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 411
Download Managed File or Directory
Obtains an existing file or directory of a specific Managed File ID (or Name) from the File Store.

Request takes no content, and on success returns a response containing the file or directory
data (as zipped file).

Type: GET

URI: /rest/serverengine/filestore/file/{fileId}

Parameters: Path:

l fileId – the Managed File ID (or Name) of the file or directory in File
Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. Content-Disposition
Headers:
l File - "attachment; filename={OrigFileName}"
l Directory - "attachment; filename=
{OrigDirName}.zip"

Content: File or Directory (zipped as file)

Content l File - application/octet-stream


Type: l Directory - application/zip

Page 412
Status: l 200 OK – File or directory successfully
downloaded from File Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 413
Delete Managed File or Directory
Removes an existing file or directory of a specific Managed File ID (or Name) from the File
Store.

Request takes no content, and on success returns a response containing the result of the
request for removal (“true” or “false”).

Type: GET

URI: /rest/serverengine/filestore/delete/{fileId}

Parameters: Path:

l fileId – the Managed File ID (or Name) of the file or directory in File
Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Result of request for removal

Content text/plain
Type:

Status: l 200 OK – Removal of file or directory successfully


requested from File Store (response of “true” for

Page 414
success or “false” for failure)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 415
Upload Data Mapping Configuration
Submits a Data Mapping configuration to the File Store.

Request takes binary file data as content, and on success returns a response containing the
new Managed File ID for the configuration.

Type: POST

URI: /rest/serverengine/filestore/DataMiningConfig

Parameters: Query:

l filename – the file name of the configuration to be uploaded (No


Default Value)
l persistent – whether the configuration to be uploaded will be
persistent in File Store (Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Data Mapping Configuration (File)

Content application/octet-stream
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Status: l 200 OK – Configuration successfully uploaded to

Page 416
File Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 417
Upload Job Creation Preset
Submits a Job Creation preset to the File Store.

Request takes XML file data as content, and on success returns a response containing the new
Managed File ID for the preset.

Type: POST

URI: /rest/serverengine/filestore/JobCreationConfig

Parameters: Query:

l filename – the file name of the preset to be uploaded (No Default


Value)
l persistent – whether the preset to be uploaded will be persistent in
File Store (Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Job Creation Preset (File)

Content application/xml
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Status: l 200 OK – Preset successfully uploaded to File

Page 418
Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 419
Upload Data File
Submits a data file to the File Store.

Request takes binary file data as content, and on success returns a response containing the
new Managed File ID for the data file.

Type: POST

URI: /rest/serverengine/filestore/DataFile

Parameters: Query:

l filename – the file name of the data file to be uploaded (No Default
Value)
l persistent – whether the data file to be uploaded will be persistent in
File Store (Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Data File (File)

Content application/octet-stream
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Status: l 200 OK – Data file successfully uploaded to File

Page 420
Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 421
Upload Design Template
Submits a design template to the File Store.

Request takes zipped file data as content, and on success returns a response containing the
new Managed File ID for the design template.

Type: POST

URI: /rest/serverengine/filestore/template

Parameters: Query:

l filename – the file name of the design template to be uploaded (No


Default Value)
l persistent – whether the design template to be uploaded will be
persistent in File Store (Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Design Template (File)

Content application/zip
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Status: l 200 OK – Template successfully uploaded to File

Page 422
Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 423
Upload Output Creation Preset
Submits an Output Creation preset to the File Store.

Request takes XML file data as content, and on success returns a response containing the new
Managed File ID for the preset.

Type: POST

URI: /rest/serverengine/filestore/OutputCreationConfig

Parameters: Query:

l filename – the file name of the preset to be uploaded (No Default


Value)
l persistent – whether the preset to be uploaded will be persistent in
File Store (Default Value: false)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Output Creation Preset (File)

Content application/xml
Type:

Response:
Add. -
Headers:

Content: Managed File ID

Content text/plain
Type:

Status: l 200 OK – Preset successfully uploaded to File

Page 424
Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 425
Service Version
Returns the version of the File Store service.

Type: GET

URI: /rest/serverengine/filestore/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 426
Content Creation (HTML) Service
The following table is a summary of the resources and methods available in the Content
Creation (HTML) service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /workflow/contentcreation/html GET

Process Content Creation (By /workflow/contentcreation/html/ GET


Data Record) {templateId}/{dataRecordId: [0-9]+}

Process Content Creation (By /workflow/contentcreation/html/ POST


Data Record) (JSON) {templateId}/{dataRecordId: [0-9]+}

Get Template Resource /workflow/contentcreation/html/ GET


{templateId}/{relPath: .+}

Service Version /workflow/contentcreation/html/version GET

Page 427
Service Handshake
Queries the availability of the Content Creation (HTML) service.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/html

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Merge engine available

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 428
Process Content Creation (By Data Record)
Submits a request to create new HTML content for the Web context.

Request takes no content, and on success returns a response containing the HTML output
produced, specific to the Data Record ID and section specified.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/html/{templateId}/
{dataRecordId: [0-9]+}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store
l dataRecordId – the ID of the Data Record entity in Server

Query:

l section – the section within the Web context to create (No Default
Value)
l inline – the inline mode to be used in the creation of content (Possible
values: NONE, CSS or ALL. No Default Value)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Page 429
Content: The HTML output for the Data Record ID

Content text/html
Type:

Status: l 200 OK – Output created successfully


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Design template or Data Record
entity not found in File Store/Server
l 500 Internal Server Error – Content Creation Error:
Data Record Not Found / Web Context in Template
Not found

Page 430
Process Content Creation (By Data Record) (JSON)
Submits a request to create new HTML content for the Web context.

Request takes a JSON HTML Parameters List as content, and on success returns a response
containing the HTML output produced, specific to the Data Record ID specified.

Type: POST

URI: /rest/serverengine/workflow/contentcreation/html/{templateId}/
{dataRecordId: [0-9]+}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store
l dataRecordId – the ID of the Data Record entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON HTML Parameters List listing section and inline


mode.

Content application/json
Type:

Response:
Add. -
Headers:

Content: The HTML output for the Data Record ID

Content text/html
Type:

Page 431
Status: l 200 OK – Output created successfully
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Design template or Data Record
entity not found in File Store/Server
l 500 Internal Server Error – Content Creation Error:
Data Record Not Found / Web Context in Template
Not found

Page 432
Get Template Resource
Submits a request to retrieve a resource from a design template stored in the File Store.

Request takes no content, and on success returns a response containing the resource from the
design template.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/html/{templateId}/{relPath: .+}

Parameters: Path:

l templateId – the Managed File ID (or Name) of the design template in


File Store
l relPath – the relative path to the resource within template

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: The resource located at the relative path within the


template

Content (Depends on Resource requested)


Type:

Status: l 200 OK – Resource successfully retrieved

Page 433
l 400 Bad Request - Unable to open resource within
template or resource doesn’t exist
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Design template or Data Record
entity not found in File Store/Server
l 500 Internal Server Error - Unable to open template
or template doesn’t exist

Page 434
Service Version
Returns the version of the Content Creation (HTML) service.

Type: GET

URI: /rest/serverengine/workflow/contentcreation/html/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 435
Job Creation Service
The following table is a summary of the resources and methods available in the Job Creation
service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /workflow/jobcreation GET

Process Job Creation /workflow/jobcreation/{configId} POST

Process Job Creation (JSON) /workflow/jobcreation/{configId} POST

Process Job Creation (JSON Job Set /workflow/jobcreation POST


Structure)

Get All Operations /workflow/jobcreation/getOperations GET

Get Progress of Operation /workflow/jobcreation/getProgress/ GET


{operationId}

Get Result of Operation /workflow/jobcreation/getResult/ POST


{operationId}

Cancel an Operation /workflow/jobcreation/cancel/ POST


{operationId}

Service Version /workflow/jobcreation/version GET

Page 436
Service Handshake
Queries the availability of the Job Creation service.

Type: GET

URI: /rest/serverengine/workflow/jobcreation

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


JobCreationRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 437
Process Job Creation
Submits a request to initiate a new Job Creation operation.

Request takes no content, and on success returns a response containing additional headers
that specify the ID of the new operation as well as link URLs that can be used to retrieve further
information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/jobcreation/{configId}

Parameters: Path:

l configId – the Managed File ID (or Name) of the Job Creation Preset
in File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. l operationId – Operation ID of new Job Creation
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Page 438
Status: l 202 Accepted – Creation of new operation
successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Job Creation Preset not found in
File Store

Page 439
Process Job Creation (JSON)
Submits a request to initiate a new Job Creation operation.

Request takes a JSON Identifier List of Content Set IDs as content, and on success returns a
response containing additional headers that specify the ID of the new operation as well as link
URLs that can be used to retrieve further information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/jobcreation/{configId}

Parameters: Path:

l configId – the Managed File ID (or Name) of the Job Creation Preset
in File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Identifier List specifying a list of Content Set entity


IDs

Content application/json
Type:

Response:
Add. l operationId – Operation ID of new Job Creation
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -

Page 440
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Job Creation Preset or Content
Set entity not found in File Store/Server

Page 441
Process Job Creation (JSON Job Set Structure)
Submits a request to initiate a new Job Creation operation.

Request takes a JSON Job Set Structure containing a list of Content Items as content, and on
success returns a response containing additional headers that specify the ID of the new
operation as well as link URLs that can be used to retrieve further information/cancel the
operation.

Type: POST

URI: /rest/serverengine/workflow/jobcreation

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Job Set Structure describing Job Set (and Content
Items)

Content application/json
Type:

Response:
Add. l operationId – Operation ID of new Job Creation
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Page 442
Status: l 202 Accepted – Creation of new operation
successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 443
Get All Operations
Returns a list of all the workflow operations actively running on the Server.

Request takes no content, and on success returns a response containing a JSON Operations
List of all the actively running operations.

Type: GET

URI: /rest/serverengine/workflow/jobcreation/getOperations

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Operations List of all the actively running


operations in Server

Content application/json
Type:

Status: l 200 OK – List of actively running operations


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 444
Get Progress of Operation
Retrieves the progress of a running Job Creation operation of a specific operation ID.

Request takes no content, and on success returns a response containing the current value of
operation progress (values ranging from 0 – 100, followed by the value of 'done' on
completion).

Type: GET

URI: /rest/serverengine/workflow/jobcreation/getProgress/{operationId}

Parameters: Path:

l operationId – Operation ID of Job Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Progress value of Job Creation operation

Content text/plain
Type:

Status: l 200 OK – Progress of operation successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 445
l 403 Forbidden – Server authentication has failed
or expired

Page 446
Get Result of Operation
Retrieves the final result of a completed Job Creation operation of a specific operation ID.

Request takes no content, and on success returns a response containing the ID of the Job Set
produced.

Type: POST

URI: /rest/serverengine/workflow/jobcreation/getResult/{operationId}

Parameters: Path:

l operationId – Operation ID of Job Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Job Set ID

Content text/plain
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 447
l 403 Forbidden – Server authentication has failed
or expired

Page 448
Cancel an Operation
Requests the cancellation of a running Job Creation operation of a specific operation ID.

Request takes no content, and on success returns a response with no content.

Type: POST

URI: /rest/serverengine/workflow/jobcreation/cancel/{operationId}

Parameters: Path:

l operationId – Operation ID of Job Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 204 No Content – Operation cancellation


requested
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 449
Service Version
Returns the version of the Job Creation service.

Type: GET

URI: /rest/serverengine/workflow/jobcreation/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 450
Job Entity Service
The following table is a summary of the resources and methods available in the Job Entity
service:

Method Name Uniform Resource Identifier (URI) Method Type

Service Handshake /entity/jobs GET

Get Content Items for Job /entity/jobs/{jobId}/contents GET

Get Job Segments for Job /entity/jobs/{jobId} GET

Get Job Metadata Properties /entity/jobs/{jobId}/metadata GET

Update Job Metadata Properties /entity/jobs/{jobId}/metadata PUT

Get Job Properties /entity/jobs/{jobId}/properties GET

Update Job Properties /entity/jobs/{jobId}/properties PUT

Update Multiple Job Properties /entity/jobs/properties PUT

Service Version /entity/jobs/version GET

Page 451
Service Handshake
Queries the availability of the Job Entity service.

Type: GET

URI: /rest/serverengine/entity/jobs

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


JobEntityRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 452
Get Content Items for Job
Returns a list of all the Content Item entities (and their corresponding Data Record entities)
contained within a specific Job entity.

Request takes no content, and on success returns a response containing a JSON Content Item
Identifier List of all the Content Items for the Job.

Type: GET

URI: /rest/serverengine/entity/jobs/{jobId}/contents

Parameters: Path:

l jobId – the ID of the Job entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Content Item Identifier List of all the Content Items
in Job

Content application/json
Type:

Status: l 200 OK – Content Item Identifier List returned


l 401 Unauthorized – Server authentication required

Page 453
l 403 Forbidden – Server authentication has failed
or expired

Page 454
Get Job Segments for Job
Returns a list of all the Job Segment entities contained within a specific Job entity.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Job Segments in the Job.

Type: GET

URI: /rest/serverengine/entity/jobs/{jobId}

Parameters: Path:

l jobId – the ID of the Job entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Job Segments in Job

Content application/json
Type:

Status: l 200 OK – Identifier List of Job Segments returned


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 455
Get Job Metadata Properties
Returns a list of the metadata properties for a specific Job entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the metadata properties for the Job.

Type: GET

URI: /rest/serverengine/entity/jobs/{jobId}/metadata

Parameters: Path:

l jobId – the ID of the Job entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of metadata


properties for Job

Content application/json
Type:

Status: l 200 OK – Job entity metadata properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 456
l 403 Forbidden – Server authentication has failed or
expired

Page 457
Update Job Metadata Properties
Submits a request to update (and replace) the metadata properties for a specific Job entity in
the Server.

Request takes a JSON Name/Value List as content (the Job ID and the new metadata
properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/jobs/{jobId}/metadata

Parameters: Path:

l jobId – the ID of the Job entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of metadata properties for Job

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Job

Content text/plain
Type:

Status: l 200 OK – Update of Job metadata properties


successfully requested (response of “true” for

Page 458
success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Job ID
mismatch in JSON

Page 459
Get Job Properties
Returns a list of the properties for a specific Job entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the properties for the Job.

Type: GET

URI: /rest/serverengine/entity/jobs/{jobId}/properties

Parameters: Path:

l jobId – the ID of the Job entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of properties


for Job

Content application/json
Type:

Status: l 200 OK – Job entity properties successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 460
l 403 Forbidden – Server authentication has failed
or expired

Page 461
Update Job Properties
Submits a request to update (and replace) the properties for a specific Job entity in the Server.

Request takes a JSON Name/Value List as content (the Job ID and the new properties), and on
success returns a response containing the result of the request for update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/jobs/{jobId}/properties

Parameters: Path:

l jobId – the ID of the Job entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of properties for Job

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Job

Content text/plain
Type:

Status: l 200 OK – Update of Job properties successfully


requested (response of “true” for success)
l 401 Unauthorized – Server authentication required

Page 462
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Job ID
mismatch in JSON

Page 463
Update Multiple Job Properties
Submits a request to update one or more properties for one or more Job entities in the Server.

Request takes multiple JSON Name/Value Lists as content (each with the Job ID and the new
properties), and on success returns a response containing no content.

Type: PUT

URI: /rest/serverengine/entity/jobs/properties

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value Lists of the properties of the Jobs

Content application/json
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 200 OK – Properties of Job entities successfully


updated
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 464
Service Version
Returns the version of the Job Entity service.

Type: GET

URI: /rest/serverengine/entity/jobs/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 465
Job Segment Entity Service
The following table is a summary of the resources and methods available in the Job Segment
Entity service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /entity/jobsegments GET

Get Document Sets for Job /entity/jobsegments/{jobSegmentId} GET


Segment

Get Job Segment Metadata /entity/jobsegments/ GET


Properties {jobSegmentId}/metadata

Update Job Segment Metadata /entity/jobsegments/ PUT


Properties {jobSegmentId}/metadata

Service Version /entity/jobsegments/version GET

Page 466
Service Handshake
Queries the availability of the Job Segment Entity service.

Type: GET

URI: /rest/serverengine/entity/jobsegments

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


JobSegmentEntityRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired

Page 467
Get Document Sets for Job Segment
Returns a list of all the Document Set entities contained within a specific Job Segment entity.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Document Sets in the Job Segment.

Type: GET

URI: /rest/serverengine/entity/jobsegments/{jobSegmentId}

Parameters: Path:

l jobSegmentId – the ID of the Job Segment entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Document Sets in Job


Segment

Content application/json
Type:

Status: l 200 OK – Identifier List of Document Sets returned


l 401 Unauthorized – Server authentication required

Page 468
l 403 Forbidden – Server authentication has failed
or expired

Page 469
Get Job Segment Metadata Properties
Returns a list of the metadata properties for a specific Job Segment entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the metadata properties for the Job Segment.

Type: GET

URI: /rest/serverengine/entity/jobsegments/{jobSegmentId}/metadata

Parameters: Path:

l jobSegmentId – the ID of the Job Segment entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of metadata


properties for Job Segment

Content application/json
Type:

Status: l 200 OK – Job Segment entity metadata properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 470
l 403 Forbidden – Server authentication has failed or
expired

Page 471
Update Job Segment Metadata Properties
Submits a request to update (and replace) the metadata properties for a specific Job Segment
entity in the Server.

Request takes a JSON Name/Value List as content (the Job Segment ID and the new metadata
properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/jobsegments/{jobSegmentId}/metadata

Parameters: Path:

l jobSegmentId – the ID of the Job Segment entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of metadata properties for Job


Segment

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Job Segment

Content text/plain
Type:

Status: l 200 OK – Update of Job Segment metadata

Page 472
properties successfully requested (response of
“true” for success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Job
Segment ID mismatch in JSON

Page 473
Service Version
Returns the version of the Job Segment Entity service.

Type: GET

URI: /rest/serverengine/entity/jobsegments/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 474
Job Set Entity Service
The following table is a summary of the resources and methods available in the Job Set Entity
service:

Method Name Uniform Resource Identifier Method


(URI) Type

Get All Job Set Entities /entity/jobsets GET

Get Jobs for Job Set /entity/jobsets/{jobSetId} GET

Delete Job Set Entity /entity/jobsets/{jobSetId}/delete POST

Get Job Set Metadata Properties /entity/jobsets/{jobSetId}/metadata GET

Update Job Set Metadata /entity/jobsets/{jobSetId}/metadata PUT


Properties

Get Job Set Properties /entity/jobsets/{jobSetId}/properties GET

Update Job Set Properties /entity/jobsets/{jobSetId}/properties PUT

Service Version /entity/jobsets/version GET

Page 475
Get All Job Set Entities
Returns a list of all the Job Set entities currently contained within the Server.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Job Sets.

Type: GET

URI: /rest/serverengine/entity/jobsets

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Job Sets in Server

Content application/json
Type:

Status: l 200 OK – Identifier List of Job Sets returned


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 476
Get Jobs for Job Set
Returns a list of all the Job entities contained within a specific Job Set entity.

Request takes no content, and on success returns a response containing a JSON Identifier List
of all the Jobs in the Job Set.

Type: GET

URI: /rest/serverengine/entity/jobsets/{jobSetId}

Parameters: Path:

l jobSetId – the ID of the Job Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Identifier List of all the Jobs in Job Set

Content application/json
Type:

Status: l 200 OK – Identifier List of Jobs returned


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 477
Delete Job Set Entity
Submits a request for a specific Job Set entity to be marked for deletion from the Server.

Request takes no content, and on success returns a response containing the result of the
request for deletion (“true” or “false”).

Type: POST

URI: /rest/serverengine/entity/jobsets/{jobSetId}/delete

Parameters: Path:

l jobSetId – the ID of the Job Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Result of request for Job Set removal

Content text/plain
Type:

Status: l 200 OK – Deletion of Job Set successfully


requested from Server (response of “true” for
success or “false” for failure)
l 401 Unauthorized – Server authentication required

Page 478
l 403 Forbidden – Server authentication has failed or
expired

Page 479
Get Job Set Metadata Properties
Returns a list of the metadata properties for a specific Job Set entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the metadata properties for the Job Set.

Type: GET

URI: /rest/serverengine/entity/jobsets/{jobSetId}/metadata

Parameters: Path:

l jobSetId – the ID of the Job Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of metadata


properties for Job Set

Content application/json
Type:

Status: l 200 OK – Job Set entity metadata properties


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 480
l 403 Forbidden – Server authentication has failed or
expired

Page 481
Update Job Set Metadata Properties
Submits a request to update (and replace) the metadata properties for a specific Job Set entity
in the Server.

Request takes a JSON Name/Value List as content (the Job Set ID and the new metadata
properties), and on success returns a response containing the result of the request for
update/replacement (“true”).

Type: PUT

URI: /rest/serverengine/entity/jobsets/{jobSetId}/metadata

Parameters: Path:

l jobSetId – the ID of the Job Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of metadata properties for Job


Set

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Job Set

Content text/plain
Type:

Status: l 200 OK – Update of Job Set metadata properties

Page 482
successfully requested (response of “true” for
success)
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Job Set
ID mismatch in JSON

Page 483
Get Job Set Properties
Returns a list of the properties for a specific Job Set entity.

Request takes no content, and on success returns a response containing a JSON Name/Value
List (Properties Only) of all the properties for the Job Set.

Type: GET

URI: /rest/serverengine/entity/jobsets/{jobSetId}/properties

Parameters: Path:

l jobSetId – the ID of the Job Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Name/Value List (Properties Only) of properties


for Job Set

Content application/json
Type:

Status: l 200 OK – Job Set entity properties successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 484
l 403 Forbidden – Server authentication has failed
or expired

Page 485
Update Job Set Properties
Submits a request to update (and replace) the properties for a specific Job Set entity in the
Server.

Request takes a JSON Name/Value List as content (the Job Set ID and the new properties),
and on success returns a response containing the result of the request for update/replacement
(“true”).

Type: PUT

URI: /rest/serverengine/entity/jobsets/{jobSetId}/properties

Parameters: Path:

l jobSetId – the ID of the Job Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Name/Value List of properties for Job Set

Content application/json
Type:

Response:
Add. -
Headers:

Content: Result of request to update Job Set

Content text/plain
Type:

Status: l 200 OK – Update of Job Set properties successfully


requested (response of “true” for success)

Page 486
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – Server error or Job Set
ID mismatch in JSON

Page 487
Service Version
Returns the version of the Job Set Entity service.

Type: GET

URI: /rest/serverengine/entity/jobsets/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 488
Output Creation Service
The following table is a summary of the resources and methods available in the Output
Creation service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /workflow/outputcreation GET

Process Output Creation /workflow/outputcreation/{configId}/ POST


{jobSetId}

Process Output Creation (JSON) /workflow/outputcreation/{configId} POST

Process Output Creation (By /workflow/outputcreation/{configId}/jobs POST


Job) (JSON)

Get All Operations /workflow/outputcreation/getOperations GET

Get Progress of Operation /workflow/outputcreation/getProgress/ GET


{operationId}

Get Result of Operation /workflow/outputcreation/getResult/ POST


{operationId}

Get Result of Operation (as Text) /workflow/outputcreation/getResultTxt/ POST


{operationId}

Cancel an Operation /workflow/outputcreation/cancel/ POST


{operationId}

Service Version /workflow/outputcreation/version GET

Page 489
Service Handshake
Queries the availability of the Output Creation service.

Type: GET

URI: /rest/serverengine/workflow/outputcreation

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


OutputCreationRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 490
Process Output Creation
Submits a request to initiate a new Output Creation operation.

Request takes no content, and on success returns a response containing additional headers
that specify the ID of the new operation as well as link URLs that can be used to retrieve further
information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/outputcreation/{configId}/{jobSetId}

Parameters: Path:

l configId – the Managed File ID (or Name) of the Output Creation


Preset in File Store
l jobSetId – the ID of the Job Set entity in Server

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. l operationId – Operation ID of new Output Creation
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -

Page 491
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Output Creation Preset or Job Set
entity not found in File Store/Server

Page 492
Process Output Creation (JSON)
Submits a request to initiate a new Output Creation operation.

Request takes a JSON Identifier (with createOnly flag) of the Job Set ID as content, and on
success returns a response containing additional headers that specify the ID of the new
operation as well as link URLs that can be used to retrieve further information/cancel the
operation.

Type: POST

URI: /rest/serverengine/workflow/outputcreation/{configId}

Parameters: Path:

l configId – the Managed File ID (or Name) of the Output Creation


Preset in File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Identifier (with createOnly flag) specifying the Job


Set entity's ID

Content application/json
Type:

Response:
Add. l operationId – Operation ID of new Output Creation
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Page 493
Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Output Creation Preset or Job Set
entity not found in File Store/Server
l 500 Internal Server Error – JSON Identifier invalid
or missing required structure

Page 494
Process Output Creation (By Job) (JSON)
Submits a request to initiate a new Output Creation operation.

Request takes a JSON Identifier List (with createOnly flag) of the Job IDs as content, and on
success returns a response containing additional headers that specify the ID of the new
operation as well as link URLs that can be used to retrieve further information/cancel the
operation.

Type: POST

URI: /rest/serverengine/workflow/outputcreation/{configId}/jobs

Parameters: Path:

l configId – the Managed File ID (or Name) of the Output Creation


Preset in File Store

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON Identifier List (with createOnly flag) specifying the


Job entity IDs

Content application/json
Type:

Response:
Add. l operationId – Operation ID of new Output Creation
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Page 495
Content -
Type:

Status: l 202 Accepted – Creation of new operation


successful
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 404 Not Found – Output Creation Preset or Job
entity not found in File Store/Server
l 500 Internal Server Error – JSON Identifier List
invalid or missing required structure

Page 496
Get All Operations
Returns a list of all the workflow operations actively running on the Server.

Request takes no content, and on success returns a response containing a JSON Operations
List of all the actively running operations.

Type: GET

URI: /rest/serverengine/workflow/outputcreation/getOperations

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Operations List of all the actively running


operations in Server

Content application/json
Type:

Status: l 200 OK – List of actively running operations


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 497
Get Progress of Operation
Retrieves the progress of a running Output Creation operation of a specific operation ID.

Request takes no content, and on success returns a response containing the current value of
operation progress (values ranging from 0 – 100, followed by the value of 'done' on
completion).

Type: GET

URI: /rest/serverengine/workflow/outputcreation/getProgress/{operationId}

Parameters: Path:

l operationId – Operation ID of Output Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Progress value of Output Creation operation

Content text/plain
Type:

Status: l 200 OK – Progress of operation successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 498
l 403 Forbidden – Server authentication has failed
or expired

Page 499
Get Result of Operation
Retrieves the final result of a completed Output Creation operation of a specific operation ID.

Request takes no content, and on success returns a response containing either the absolute
paths of the final output files produced (multiple spool files) or the content of a final output file
(single spool file).

Type: POST

URI: /rest/serverengine/workflow/outputcreation/getResult/{operationId}

Parameters: Path:

l operationId – Operation ID of Output Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Absolute Paths of the Output Files or the Output File


itself

Content application/octet-stream
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved

Page 500
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 501
Get Result of Operation (as Text)
Retrieves the final result of a completed Output Creation operation of a specific operation ID.

Request takes no content, and on success returns a response containing the absolute path or
paths of the final output file or files produced (single or multiple spool files respectively).

Type: POST

URI: /rest/serverengine/workflow/outputcreation/getResultTxt/{operationId}

Parameters: Path:

l operationId – Operation ID of Output Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Absolute Path(s) of the Output File(s)

Content text/plain
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved
l 401 Unauthorized – Server authentication required

Page 502
l 403 Forbidden – Server authentication has failed
or expired

Page 503
Cancel an Operation
Requests the cancellation of a running Output Creation operation of a specific operation ID.

Request takes no content, and on success returns a response with no content.

Type: POST

URI: /rest/serverengine/workflow/outputcreation/cancel/{operationId}

Parameters: Path:

l operationId – Operation ID of Output Creation operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 204 No Content – Operation cancellation


requested
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 504
Service Version
Returns the version of the Output Creation service.

Type: GET

URI: /rest/serverengine/workflow/outputcreation/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 505
All-In-One Service
The following table is a summary of the resources and methods available in the All-In-One
service:

Method Name Uniform Resource Identifier (URI) Method


Type

Service Handshake /workflow/print GET

Process All-In-One /workflow/print/submit POST


(JSON)

Process All-In-One /workflow/print/{dmConfigId}/{templateId}/ POST


(Adhoc Data) {jcConfigId}/{ocConfigId}

Get All Operations /workflow/print/getOperations GET

Get Progress of /workflow/print/getProgress/{operationId} GET


Operation

Get Result of Operation /workflow/print/getResult/{operationId} POST

Get Result of Operation /workflow/print/getResultTxt/{operationId} POST


(as Text)

Cancel an Operation /workflow/print/cancel/{operationId} POST

Service Version /workflow/print/version GET

Page 506
Service Handshake
Queries the availability of the All-In-One service.

Type: GET

URI: /rest/serverengine/workflow/print

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Handshake message:

Server Engine REST Service available:


PrintRestService

Content text/plain
Type:

Status: l 200 OK – REST Service available


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 507
Process All-In-One (JSON)
Submits a request to initiate a new All-In-One operation.

Request takes a JSON All-In-One Configuration as content, and on success returns a response
containing additional headers that specify the ID of the new operation as well as link URLs that
can be used to retrieve further information/cancel the operation.

Type: POST

URI: /rest/serverengine/workflow/print/submit

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: JSON All-In-One Configuration containing workflow


processes/parameters

Content application/json
Type:

Response:
Add. l operationId – Operation ID of new All-In-One
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Status: l 202 Accepted – Creation of new operation

Page 508
successful
l 400 Bad Request – Required Input resource/file not
found in File Store
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed or
expired
l 500 Internal Server Error – General error with
running the All-In-One Process or a Specific error
relating to an individual workflow process (see error
description)

Page 509
Process All-In-One (Adhoc Data)
Submits a request to initiate a new All-In-One operation using pre-existing inputs, with the
exception of input data, which is submitting along with the request.

Request takes binary file data as content, and on success will return one of two responses
depending on the type of operation:

l Asynchronous – response containing additional headers that specify the ID of the new
operation as well as link URLs that can be used to retrieve further information/cancel the
operation (Default)
l Synchronous – response (depending on the parameters specified) containing either:
l the absolute paths of the final output files produced (multiple spool files) or the
content of a final output file (single spool file)
l the absolute path or paths of the final output file or files produced (single or multiple
spool files respectively) (Get Result as Text Only)

Type: POST

URI: /rest/serverengine/workflow/print/{dmConfigId}/{templateId}/{jcConfigId}/
{ocConfigId}

Parameters: Path:

l dmConfigId – the Managed File ID (or Name) of the Data


Mapping configuration in File Store
l templateId – the Managed File ID (or Name) of the design
template in File Store
l jcConfigId – the Managed File ID (or Name) of the Job Creation
Preset in File Store (Optional - the value of "0" can be specified if
no preset is to be used)
l ocConfigId – the Managed File ID (or Name) of the Output
Creation Preset in File Store

Query:

l async – whether to run the operation asynchronously (Default:

Page 510
true)
l resultAsTxt – whether to retrieve the result as text (Synchronous
Only) (Default: false)
l createOnly – flag to specify if output is to be only created in the
server and not sent to it's final destination (Default: false)
l printRange – a specific range of records in the input data file to
restrict the print output to (No Default Value)
l filename – the file name of the data file to be uploaded (No
Default Value)

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: Data File (File)

Content application/octet-stream
Type:

Response:
Add. l operationId – Operation ID of new All-In-One
Headers: operation
l Link – Contains multiple link URLs that can be
used to retrieve further information/cancel the
operation.

Content: -

Content -
Type:

Status: l 202 Accepted – Data file successfully uploaded


to File Store and creation of new operation
successful
l 400 Bad Request – Unable to locate one or more
inputs in File Store with Managed File ID(s)

Page 511
and/or Name(s) specified
l 401 Unauthorized – Server authentication
required
l 403 Forbidden – Server authentication has failed
or expired
l 500 Internal Server Error – General error with
running the All-In-One Process or a Specific
error relating to the uploading of the data file or
an individual workflow process (see error
description)

Response
Add. -
(Synchronous):
Headers:

Content: Absolute Paths of the Output Files or the Output File


itself

Content application/octet-stream
Type:

Status: l 200 OK – Data file uploaded to File Store, and a


new operation was created and completed
successfully with the result returned
l 400 Bad Request – Unable to locate one or more
inputs in File Store with Managed File ID(s)
and/or Name(s) specified
l 401 Unauthorized – Server authentication
required
l 403 Forbidden – Server authentication has failed
or expired
l 500 Internal Server Error – General error with
running the All-In-One Process or a Specific
error relating to the uploading of the data file or
an individual workflow process (see error
description)

Page 512
Response
Add. -
(Synchronous
Headers:
+ Get Result as
Text):
Content: Absolute Path(s) of the Output File(s)

Content text/plain
Type:

Status: l 200 OK – Data file uploaded to File Store, and a


new operation was created and completed
successfully with the result returned
l 400 Bad Request – Unable to locate one or more
inputs in File Store with Managed File ID(s)
and/or Name(s) specified
l 401 Unauthorized – Server authentication
required
l 403 Forbidden – Server authentication has failed
or expired
l 500 Internal Server Error – General error with
running the All-In-One Process or a Specific
error relating to the uploading of the data file or
an individual workflow process (see error
description)

Page 513
Get All Operations
Returns a list of all the workflow operations actively running on the Server.

Request takes no content, and on success returns a response containing a JSON Operations
List of all the actively running operations.

Type: GET

URI: /rest/serverengine/workflow/print/getOperations

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: JSON Operations List of all the actively running


operations in Server

Content application/json
Type:

Status: l 200 OK – List of actively running operations


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 514
Get Progress of Operation
Retrieves the progress of a running All-In-One operation of a specific operation ID.

Request takes no content, and on success returns a response containing the current value of
operation progress (values ranging from 0 – 100, followed by the value of 'done' on
completion).

Type: GET

URI: /rest/serverengine/workflow/print/getProgress/{operationId}

Parameters: Path:

l operationId – Operation ID of All-In-One operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Progress value of All-In-One operation

Content text/plain
Type:

Status: l 200 OK – Progress of operation successfully


retrieved
l 401 Unauthorized – Server authentication required

Page 515
l 403 Forbidden – Server authentication has failed
or expired

Page 516
Get Result of Operation
Retrieves the final result of a completed All-In-One operation of a specific operation ID.

Request takes no content, and on success returns a response (depending on the All-In-One
configuration) containing either:

l the ID of the Data Set, Content Set or Job Set entity produced, or
l the absolute paths of the final output files produced (multiple spool files) or the content of
a final output file (single spool file).

Type: POST

URI: /rest/serverengine/workflow/print/getResult/{operationId}

Parameters: Path:

l operationId – Operation ID of All-In-One operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Either:

l the ID of the Data Set, Content Set or Job Set, or


l the Absolute Paths of the Output Files or the
Output File itself

Page 517
Content application/octet-stream
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 518
Get Result of Operation (as Text)
Retrieves the final result of a completed All-In-One operation of a specific operation ID.

Request takes no content, and on success returns a response (depending on the All-In-One
configuration) containing either:

l the ID of the Data Set, Content Set or Job Set entity produced, or
l the absolute path or paths of the final output file or files produced (single or multiple spool
files respectively).

Type: POST

URI: /rest/serverengine/workflow/print/getResultTxt/{operationId}

Parameters: Path:

l operationId – Operation ID of All-In-One operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Either:

l the ID of the Data Set, Content Set or Job Set, or


l the Absolute Path(s) of the Output File(s)

Page 519
Content text/plain
Type:

Status: l 200 OK – Result of completed operation


successfully retrieved
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 520
Cancel an Operation
Requests the cancellation of a running All-In-One operation of a specific operation ID.

Request takes no content, and on success returns a response with no content.

Type: POST

URI: /rest/serverengine/workflow/print/cancel/{operationId}

Parameters: Path:

l operationId – Operation ID of All-In-One operation

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: -

Content -
Type:

Status: l 204 No Content – Operation cancellation


requested
l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 521
Service Version
Returns the version of the All-In-One service.

Type: GET

URI: /rest/serverengine/workflow/print/version

Parameters: -

Request:
Add. auth_token – Authorization Token (if server security
Headers: settings enabled)

Content: -

Content -
Type:

Response:
Add. -
Headers:

Content: Version of Service

Content text/plain
Type:

Status: l 200 OK – Version of REST Service retrieved


l 401 Unauthorized – Server authentication required
l 403 Forbidden – Server authentication has failed
or expired

Page 522
Copyright Information
Copyright © 1994-2017 Objectif Lune Inc. All Rights Reserved.

No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval


system, or translated into any other language or computer language in whole or in part, in any
form or by any means, whether it be electronic, mechanical, magnetic, optical, manual or
otherwise, without prior written consent of Objectif Lune Inc.

Objectif Lune Inc. disclaims all warranties as to this software, whether expressed or implied,
including without limitation any implied warranties of merchantability, fitness for a particular
purpose, functionality, data integrity or protection.

PlanetPress and PReS are registered trademarks of Objectif Lune Inc.

Page 523
Legal Notices and Acknowledgments
PlanetPress Connect, Copyright © 2017, Objectif Lune Inc. All rights reserved.

This guide uses the following third party components:

l jQuery Library Copyright © 2005 - 2014, jQuery Foundation, Inc. and other contributors.
This is distributed under the terms of the Massachusetts Institute of Technology (MIT)
license.
l QUnit Library Copyright © jQuery Foundation, Inc. and other contributors. This is
distributed under the terms of the Massachusetts Institute of Technology (MIT) license.

Page 524

You might also like