OpenText Documentum D2FS REST Services Development Guide
OpenText Documentum D2FS REST Services Development Guide
Services
1
Abstract
This document is a guide to using OpenText Documentum D2FS REST Services to utilize the
D2 Configurations on Documentum Repositories.
Copyright © 2019 Open Text. All rights reserved. Trademarks owned by Open Text.
OpenText believes the information in this publication is accurate as of its publication date.
The information is subject to change without notice.
The information in this publication is provided “as is.” OpenText makes no representations
or warranties of any kind with respect to the information in this publication, and specifically
disclaims implied warranties of merchantability or fitness for a particular purpose.
Use, copying, and distribution of any OpenText software described in this publication
requires an applicable software license.
For the most up-to-date listing of OpenText product names, see OpenText Trademarks on
opentext.com.
2
Table of Contents
What’s changed in 23.2? .............................................................................................. 9
Overview ..................................................................................................................... 9
What are D2FS REST Services? ...................................................................................................... 9
Consuming D2FS REST Services................................................................................................... 10
Relationship with other Documentum Platform APIs................................................................. 11
General REST Definitions ............................................................................................ 11
Common Definition - HTTP Headers ........................................................................................... 11
Common Definition – Query Parameters ................................................................................... 12
HTTP Status Codes ...................................................................................................................... 12
Supported MIME Types............................................................................................................... 12
HTTP Methods............................................................................................................................. 12
Link Relations ............................................................................................................ 13
Public Link Relation Registry ....................................................................................................... 13
D2FS Link Relations .................................................................................................... 14
Explore the D2FS REST services .................................................................................. 17
Common Tasks ............................................................................................................................ 17
Resources .................................................................................................................. 17
Organization of Resource Reference Documentation ................................................................ 17
Profiles ...................................................................................................................... 17
URI Template............................................................................................................................... 17
Feed............................................................................................................................................. 18
Link Relation................................................................................................................................ 18
Operations .................................................................................................................................. 18
Get Profiles-D2 ............................................................................................................................ 18
HTTP Method .............................................................................................................................. 18
Server Accepted Request Media Types ...................................................................................... 19
Query Parameters ....................................................................................................................... 19
Request Headers ......................................................................................................................... 19
Request Body .............................................................................................................................. 19
Response Headers....................................................................................................................... 19
Supported Response Media Types.............................................................................................. 19
Response Status .......................................................................................................................... 19
Profile........................................................................................................................ 20
URI Template............................................................................................................................... 20
3
Link Relation................................................................................................................................ 20
Operations .................................................................................................................................. 20
Get a Profile ................................................................................................................................ 20
HTTP Method .............................................................................................................................. 20
Server Accepted Request Media Types ...................................................................................... 20
Query Parameters ....................................................................................................................... 20
Request Headers ......................................................................................................................... 21
Request Body .............................................................................................................................. 21
Response Headers....................................................................................................................... 21
Supported Response Media Types.............................................................................................. 21
Response Status .......................................................................................................................... 21
Search Configurations ................................................................................................ 21
URI Template............................................................................................................................... 21
Feed............................................................................................................................................. 22
Link Relation................................................................................................................................ 22
Operations .................................................................................................................................. 22
Get Search Configurations .......................................................................................................... 22
HTTP Method .............................................................................................................................. 22
Server Accepted Request Media Types ...................................................................................... 23
Query Parameters ....................................................................................................................... 23
Request Headers ......................................................................................................................... 23
Request Body .............................................................................................................................. 23
Response Headers....................................................................................................................... 23
Supported Response Media Types.............................................................................................. 23
Response Status .......................................................................................................................... 23
Search Configuration.................................................................................................. 24
URI Template............................................................................................................................... 24
Link Relation................................................................................................................................ 24
Operations .................................................................................................................................. 24
Get a Search Config ..................................................................................................................... 24
HTTP Method .............................................................................................................................. 24
Server Accepted Request Media Types ...................................................................................... 24
Query Parameters ....................................................................................................................... 24
Request Headers ......................................................................................................................... 25
Request Body .............................................................................................................................. 25
Response Headers....................................................................................................................... 25
Supported Response Media Types.............................................................................................. 25
Response Status .......................................................................................................................... 25
4
Types ......................................................................................................................... 25
URI Template............................................................................................................................... 25
Feed............................................................................................................................................. 26
Link Relation................................................................................................................................ 26
Operations .................................................................................................................................. 26
Get Types-D2............................................................................................................................... 26
HTTP Method .............................................................................................................................. 26
Server Accepted Request Media Types ...................................................................................... 26
Query Parameters ....................................................................................................................... 27
Request Headers ......................................................................................................................... 27
Request Body .............................................................................................................................. 27
Response Headers....................................................................................................................... 27
Supported Response Media Types.............................................................................................. 27
Response Status .......................................................................................................................... 27
Type .......................................................................................................................... 28
URI Template............................................................................................................................... 28
Link Relation................................................................................................................................ 28
Operations .................................................................................................................................. 28
Get a Type ................................................................................................................................... 28
HTTP Method .............................................................................................................................. 28
Server Accepted Request Media Types ...................................................................................... 28
Query Parameters ....................................................................................................................... 28
Request Headers ......................................................................................................................... 29
Request Body .............................................................................................................................. 29
Response Headers....................................................................................................................... 29
Supported Response Media Types.............................................................................................. 29
Response Status .......................................................................................................................... 29
Templates .................................................................................................................. 29
URI Template............................................................................................................................... 29
Link Relation................................................................................................................................ 30
Operations .................................................................................................................................. 30
Get Templates ............................................................................................................................. 30
HTTP Method .............................................................................................................................. 30
Server Accepted Request Media Types ...................................................................................... 30
Query Parameters ....................................................................................................................... 30
Request Headers ......................................................................................................................... 30
Request Body .............................................................................................................................. 30
Response Headers....................................................................................................................... 30
5
Supported Response Media Types.............................................................................................. 31
Response Status .......................................................................................................................... 31
Create Object Content using Templates...................................................................... 31
URI Template............................................................................................................................... 31
This URI template will be replaced with /repositories/{repositoryName}/objects/{objectId}... 31
Operations .................................................................................................................................. 31
HTTP Method .............................................................................................................................. 31
Server Accepted Request Media Types ...................................................................................... 32
Query Parameters ....................................................................................................................... 32
Request Headers ......................................................................................................................... 32
Request Body .............................................................................................................................. 32
Response Headers....................................................................................................................... 32
Supported Response Media Types.............................................................................................. 32
Response Status .......................................................................................................................... 32
Preview URLS ............................................................................................................. 33
URI Template............................................................................................................................... 33
Link Relation................................................................................................................................ 33
Operations .................................................................................................................................. 33
Get Preview Urls ......................................................................................................................... 33
HTTP Method .............................................................................................................................. 33
Server Accepted Request Media Types ...................................................................................... 33
Query Parameters ....................................................................................................................... 33
Request Headers ......................................................................................................................... 33
Request Body .............................................................................................................................. 34
Response Headers....................................................................................................................... 34
Supported Response Media Types.............................................................................................. 34
Response Status .......................................................................................................................... 34
Examples ..................................................................................................................................... 35
Object Creation.......................................................................................................... 36
URI Template............................................................................................................................... 36
Link Relation................................................................................................................................ 37
Operations .................................................................................................................................. 37
HTTP Method .............................................................................................................................. 37
Server Accepted Request Media Types ...................................................................................... 37
Query Parameters ....................................................................................................................... 37
Request Headers ......................................................................................................................... 37
Request Body .............................................................................................................................. 37
6
Examples ..................................................................................................................................... 38
Object Versioning ...................................................................................................... 38
URI Template............................................................................................................................... 39
Link Relation................................................................................................................................ 39
Other Details ............................................................................................................................... 39
Sample Steps ............................................................................................................. 39
Viewing profiles, types ............................................................................................... 39
Content creation ........................................................................................................ 44
Create Object without content ................................................................................................... 44
Create Object with content......................................................................................................... 47
C2-View & C2-Print .................................................................................................... 47
HTTP Method .............................................................................................................................. 48
Server Accepted Request Media Types ...................................................................................... 48
Query Parameters ....................................................................................................................... 48
HTTP Sample Request: ................................................................................................................ 48
HTTP Method .............................................................................................................................. 49
Server Accepted Request Media Types ...................................................................................... 50
Query Parameters ....................................................................................................................... 50
HTTP Sample Request: ................................................................................................................ 50
Parameters: ................................................................................................................................. 51
Parameters: ................................................................................................................................. 51
TaskNotes EndPoint ................................................................................................... 52
HTTP Method .............................................................................................................................. 52
Server Accepted Request Media Types ...................................................................................... 52
Sample request ........................................................................................................................... 52
Digital Signature ........................................................................................................ 52
Zip and Download ...................................................................................................... 57
Advanced Search ....................................................................................................... 59
View Permission ........................................................................................................ 61
Installation Guide ...................................................................................................... 62
WebLogic 12.1.3.......................................................................................................................... 62
WebSphere Installation instructions........................................................................................... 62
About OpenText .......................................................................................................................... 63
7
8
What’s changed in 23.2?
Please refer to the below sections and their content for what’s changed in 23.2.
Overview
This document is a guide to using OpenText D2FS REST services.
Documentum D2 provides two clients: D2 Client and D2-Config. D2 Client is a web-based
application that gives users the ability to interact with content in one or more repositories.
D2-Config is the administration client of Documentum D2.
D2FS REST services allows a REST client to utilize configurations that are defined in D2-
Config. This document is intended for developers and architects who are building clients for
D2FS REST Services.
9
defines specific media types to represent resources and drives application state transfers by
using link relations. It uses a limited number of HTTP standard methods (GET, PUT, POST,
and DELETE) to manipulate resources over the HTTP protocol. D2FS REST Services supports
the JSON and XML format for resource representation. D2FS REST Services does not
introduce any new media types and only uses the existing types that are available as part of
the Documentum REST services.
10
Relationship with other Documentum Platform APIs
D2 REST Services rely on the D2FS library to perform operations based on the D2 Configurations
available in the Documentum Content Server. The D2FS library uses DFC and communication between
the REST server and Content Server is conducted over Netwise RPC. D2 REST Services is a lightweight
alternative to the existing D2FS SOAP Services. However, it is not intended to provide the equivalent
functionalities in the initial release. You can leverage the simplicity of RESTful services to achieve
highly productive programming.
11
body, /Response
in decimal number
of
OCTETs, sent to the
recipient
Please refer to the “Common Definition - Query Parameters” section of the Documentum
Platform REST services – Developer Guide for detailed information on query parameters.
Their purpose and meaning are described in the Developer Guide.
HTTP Methods
Documentum D2FS REST Services supports the following HTTP methods:
• GET
12
Use this method to retrieve a representation of a resource.
• POST
Use this method to create new resources or update existing resources.
• DELETE
Use this method to delete a resource.
Link Relations
The D2FS REST service is a hypermedia driven API. Link relation forms the basis of
hypermedia driven APIs. The key purpose of a link relation type is to identify the semantics
associated with the link. The client chooses one of the available link relations for a state
transition—either an application or a resource.
D2FS introduces new link relations to access the D2 specific resources and to consume the
existing D2 Configurations.
Clients are always required to use the link relations that are provided by the server for state
transition. The link relations are immutable and the links(“href”) are constructed at
runtime, depending on the client’s application state.
Link relations are not URIs. The URI that they refer to provide information on how to use
these link relations. Clients need to refer to the actual links “href” associated with the link
relations to achieve state transition of resources.
13
D2FS Link Relations
The following table includes link relations defined within OpenText for use by D2FS REST
Services.
http://identifiers.opentext.com/link Provides a href to the Creation Profile After the user gets
rel/ creation-profile resource. This resource allows you into the list of
access to a specific profile configured creation profiles.
in D2-Config.
http://identifiers.opentext.com/link Provides a href to the list of types After the user gets
rel/ type-configurations defined within the selected creation into a specific
profile in D2 Config. creation profile.
14
http://identifiers.opentext.com/link Provides a href to the Comments After the user gets
rel/comments resource. This resource allows you into a specific
access the list of comments on the document/object.
document.
The link relations appear in the relevant application state within the context of the client.
The below link relations will exist until the Core REST extensibility is in place. Once,
extensibility is used in D2FS REST services, then the below link relations will cease to exist.
15
major version.
http://identifiers.opentext.com/linkr Provides a href to checkin next minor After the user gets
el/checkin-next-minor version of this object. This will be into a specific
overriding core REST link relation document/object.
which is applicable for check-in next
minor version.
http://identifiers.opentext.com/linkr Provides a href to checkin branch After the user gets
el/checkin-branch version of this object. This will be into a specific
overriding core REST link relation document/object.
which is applicable for check-in
branch version.
16
Explore the D2FS REST services
This section provides a sample which guides you through how to use the D2FS REST
services.
This sample uses JSON representation and collection pattern to represent feeds. This
assumes that the D2FS REST service is deployed in localhost:8080 and the client is a web-
browser capable of rendering JSON results.
Common Tasks
The common tasks that are currently available in the D2FS REST services is to:
A) Understand the list of creation profiles that are available for a user.
B) Understand the list of types that are available within a specific profile.
C) Understand the configurations present on a specific type.
D) Create an object of a specific type that honors the D2-Configurations.
E) Understand the list of templates available for an object.
E) View/add new/delete existing comments to an existing object in the repository.
Resources
Organization of Resource Reference Documentation
These guidelines apply to each resource reference documentation entry:
• All method parameters are optional unless otherwise noted.
• DELETE and GET methods do not have a request body.
Profiles
The profiles resource represents a collection of all the profiles that are available in the
context of the user.
URI Template
/repositories/ {repositoryName}/ profile-configuration
repositoryName Name of the repository
17
Feed
Link Relation
Operations
Method Description
GET Lists all the creation profiles in the repository for
the current user’s context.
Get Profiles-D2
Lists all the creation profiles in the repository for the current user’s context.
HTTP Method
GET
18
Server Accepted Request Media Types
None
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None
Response Headers
• Content-Length
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
403 - Permission denied
500 - Other unexpected server error
Response Body
This is a XML or JSON representation of the D2 Creation Profiles collection.
• The body contains a list of D2 Creation Profiles.
• Each object may contain all properties of the creation profile, depending on the setting of the query
parameter (inline = true).
• The returned child objects collection only contains those that the user has access to.
• Each profile entry must contain link that point to a specific profile.
19
Profile
The profile resource represents a creation profile in the repository.
URI Template
/repositories/ { repositoryName }/ profile-configuration /{profileId}
repositoryName Name of the repository
profileId Object ID of the Creation Profile
Link Relation
[1] This link relation is defined by Documentum. The fully qualified Documentum link relation
path is prefixed with the following string: http://identifiers.opentext.com/linkrel/
Operations
Method Description
GET Retrieves properties, and other information of the
Creation profile resource.
Get a Profile
Gets properties and other information of this Creation Profile. Properties are returned as embedded
elements in the response message body. Other information, such as types, is referenced from the link
relations of the response message body.
HTTP Method
GET
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
20
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None.
Response Headers
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
404 – D2 Creation Profile not found.
500 - Other unexpected server error
Response Body
This is a XML or JSON representation of the D2 Creation Profile.
Search Configurations
The search configurations resource represents a collection of all the search configurations
that are available in the context of the user.
URI Template
/repositories/ {repositoryName}/ search-configuration
21
repositoryName Name of the repository
Feed
Link Relation
Operations
Method Description
GET Lists all the search configurations in the repository
for the current user’s context.
HTTP Method
GET
22
Server Accepted Request Media Types
None
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None.
Response Headers
• Content-Length
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
403 - Permission denied
500 - Other unexpected server error
Response Body
This is a XML or JSON representation of the D2 Search Configurations collection.
• The body contains a list of D2 Search Configurations.
• Each object may contain all properties of the search configuration, depending on the setting of the
query parameter (inline = true).
• The returned child objects collection only contains those that the user has access to.
• Each search configuration entry must contain link that point to a specific configuration.
23
Search Configuration
The search configuration resource represents a search configuration in the repository.
URI Template
/repositories/ { repositoryName }/ search-configuration /{configId}
repositoryName Name of the repository
configId Object ID of the Search Configuration
Link Relation
Operations
Method Description
GET Retrieves the types names, attribute names, facets
and other data associated with a D2 Search
Configuration.
HTTP Method
GET
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
24
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None.
Response Headers
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
404 – D2 Creation Profile not found.
500 - Other unexpected server error
Response Body
This is a XML or JSON representation of the D2 Creation Profile.
Types
The types resource represents a collection of all the types that are defined in a specific D2
Creation profile.
URI Template
/repositories/ {repositoryName}/ type-configuration?profile={profileId}
repositoryName Name of the repository
profileId Object ID of the Creation Profile (mandatory)
25
Feed
Link Relation
Operations
Method Description
GET Lists all the D2 Types in the repository for this
creation profile.
Get Types-D2
Lists all the types configured for the specific creation profile.
HTTP Method
GET
26
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None.
Response Headers
• Content-Length
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
403 - Permission denied
500 - Other unexpected server error
Response Body
This is a XML or JSON representation of the D2 Types collection.
• The body contains a list of types configured for this creation profile.
• Each object may contain all configured properties of this type, depending on the setting of the query
parameter (inline = true).
• The returned child objects collection only contains those that the user has access to.
• Each type entry must contain link that point to a specific type.
27
Type
The type resource represents the configuration of a type in a specific creation profile.
URI Template
/repositories/{repositoryName }/type-configuration/{typeId}?profile={profileId}
repositoryName Name of the repository
profileId Object ID of the Creation Profile to which this type
belongs (mandatory)
typeId Object ID of the type
Link Relation
Operations
Method Description
GET Retrieves properties, and other information of the
type resource.
Get a Type
Gets properties and other information of this Type. Properties are returned as embedded
elements in the response message body.
HTTP Method
GET
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
28
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None.
Response Headers
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
500 - Other unexpected server error
Response Body
This is a XML or JSON representation of the type configured in a specific D2 Creation Profile.
Templates
The templates resource represents the list of available templates for this object.
URI Template
/repositories/{ repositoryName }/objects/{objectId}/ document-templates
repositoryName Name of the repository
objectId Object ID
29
Link Relation
Operations
Method Description
GET Retrieves the list of content templates applicable
for this object.
Get Templates
Gets the list of available templates for this object. The template properties are returned as
embedded elements in the response message body. Other information, such as the link to the actual
template, is referenced from the link relations of the response message body.
HTTP Method
GET
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None.
Response Headers
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
30
Supported Response Media Types
• application/vnd.emc.documentum+xml
• application/vnd.emc.documentum+json
• application/xml (For compatible viewing)
• application/json (For compatible viewing)
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
500 - Other unexpected server error
Response Body
This is a XML or JSON representation of the list of templates available for this object.
URI Template
/repositories/{ repositoryName }/objects-d2/{objectId}
repositoryName Name of the repository
objectId Object ID
Operations
Method Description
POST Specify the template name to be attached to the
object.
HTTP Method
POST
31
Server Accepted Request Media Types
• application/vnd.emc.documentum+xml
• application/vnd.emc.documentum+json
Query Parameters
None
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
XML or JSON representation of the properties of template to be set on the object.
Example:
{ “properties”: {“template_name”: “AOP Document”, “folder_id”:” 0c01e2408004ee4e”}}
Response Headers
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
500 - Other unexpected server error
Response Body
This is an XML or JSON representation of the object to which template was bound.
32
Preview URLS
The templates resource represents the list of available preview URLs for this object.
BOCS/ACS and O2/C2 plugins are supported.
URI Template
/repositories/{repositoryName}/objects/{objectId}/preview-urls-d2
repositoryName Name of the repository
objectId Object ID
Link Relation
Operations
Method Description
GET Retrieves the list of preview URLs applicable for
this object.
HTTP Method
GET
Query Parameters
Inline – Refer to Common Definition – Query Parameters for more info.
Request Headers
• Accept
33
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
None.
Response Headers
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Response Status
200 - Information retrieved successfully
400 - Bad request; invalid property name or value
401 - Authentication failed
500 - Other unexpected server error
Response Body
This is an XML or JSON representation of the list of URLs available for this object.
Configuration
connection.remote.url=http[s]://[proxy|server][:[port]]/[D2_Ctx]
34
C2 and O2 plugins installation
Examples
JSON result :
{
"entries": [
{
"content": {
"links": [
{
"href": "http://<server>/d2fs-
rest/repositories/<docbase>/objects/<id>/preview-urls-d2/",
"rel": "self"
},
{
"href": "http://<server>/d2fs-rest/repositories/<docbase>/objects/",
"rel": "parent"
}
],
"url":
"http://<server>/D2/servlet/Download?uid=context_rest_XXXXXXXX&_docbase=<docbase>&_userna
me=XXXX&_password=XXXXXX&_locale=en&id=<id>&format=pdf&event_name=d2_view_inline&c2_confi
g_name=C2+QA+View"
},
"id": "http://<server>/d2fs-rest/repositories/<docbase>/objects/<id>/preview-urls-
d2/",
"links": [
{
"href": "http://<server>/d2fs-
rest/repositories/<docbase>/objects/<id>/preview-urls-d2/",
"rel": "self"
}
],
35
"title":
"http://<server>/D2/servlet/Download?uid=context_rest_XXXXXXXX&_docbase=<docbase>&_userna
me=XXXX&_password=XXXXXX&_locale=en&id=<id>&format=pdf&event_name=d2_view_inline&c2_confi
g_name=C2+QA+View",
"updated": "2014-08-25T15:36:22.882+02:00"
}
],
"id": "http://<server>/d2fs-rest/repositories/<docbase>/objects/<id>/preview-urls-d2",
"links": [
{
"href": "http://<server>/d2fs-rest/repositories/<docbase>/objects/<id>/preview-
urls-d2/",
"rel": "self"
}
],
"title": "Preview urls on object: <id>",
"updated": "2014-08-25T15:36:22.882+02:00"
}
Object Creation
Unlike Core REST APIs, where the creation of objects happens within a folder, in the D2
REST Server Space, the object creation can happen at the “repository” level. Created objects
are automatically placed into the user’s home directory or auto-linked to a specific folder,
depending on the D2 configuration. Hence, the object creation URI template resides at the
repository level.
As in Core REST, objects can be created in one or two steps. In a single-step creation
process, the objects are created by passing both content and properties together. In a two-
step creation, an object without content is created and then content is attached to the
created object.
While attaching content, templates can be bound as detailed in the Templates section. The
other way to attach content is by using the link relation “contents” on the object. For more
details on how to do this, see https://community.opentext.com/docs/DOC-33250 .
URI Template
/repositories/ { repositoryName }/object-creation
repositoryName Name of the repository
36
Link Relation
All the link relations that is applicable for a newly created object. See the “Link
Relation” section, in the SysObject resource of the Core REST Developer Guide, which provides
information on what kind of links are available for a certain type of object.
Operations
Method Description
POST Creates a new object
HTTP Method
POST
Query Parameters
None.
Request Headers
• Accept
• Authorization
• Content-Type
For more details about HTTP headers, see Common Definition - HTTP Headers.
Request Body
XML or JSON representation of the object to create.
• The object type is specified in the r_object_type property of the request body.
• Any other properties of the object can also be specified in the request body. The value of input date
attributes should be in ISO format with time zone suffixed. The format should be yyyy-MM-
dd'T'HH:mm:ss.SSSXXX (e.g.: 2023-02-09T10:15:00.000+0530). Other date time formats are not supported.
• The D2 Configurations that are applicable for this object creation is passed in the request body along
with other properties such as object_name.
• D2 Configuration takes precedence over supplied properties, such as object_name or folder_id, if
there are auto-naming rules and auto-linking rules specified.
37
• During creation, it is not possible to pass the template information. Template information can only
be set after the object is created because the lists of available templates that can be bound to the object
depend on the created object. So, the template is not a valid d2 configuration during creation.
• In case of mulitpart, it is necessary to set the Content-type to multipart/form-data;
boundary=boundary_string. The boundary string acts as a separation between the form-data and the
content. For more information, see the “Multi-part Request Representation” section of the Core REST
Developer Guide.
Examples
• Creation of object without content:
{"properties":{"r_object_type": "bookpreview", "d2_configuration": ["start_version=2.2",
"lifecycle=New lifecycle", "folder_id=0c01e24080000105"], "object_name":"test.txt"}}
--91FJE9lOv7JqplS6Y_AYIoCtY2ePfQxPaiK
Content-Disposition: form-data; name="object"
Content-Type: application/vnd.emc.documentum+json; charset=UTF-8
Object Versioning
Objects can be versioned by the user who has sufficient permissions on the object. In
addition to the permissions, the D2-Configuration offers configuration to place additional
options and restrictions when checking in and checking out the object.
As in Core REST, objects can be versioned by doing a checkout followed by a check-in. The
check-in can be a minor/major/branch/same version. The checkout places a lock on the
object which can be removed by doing a cancel-checkout. The check-in request can be a
POST request which posts:
a) text/plain: for content only.
b) multi-part: for content and properties.
38
c) JSON/XML: for properties only.
While doing a checkout/check-in the corresponding D2 configurations, check-in and
checkout config objects are read. The configurations are honored by the D2REST services.
URI Template
/repositories/ { repositoryName }/ objects/{chronicleId}/versions?object-
id={objectId}&version-policy=next-major
/repositories/ { repositoryName }/ objects/{chronicleId}/versions?object-
id={objectId}&version-policy=next-minor
/repositories/ { repositoryName }/ objects/{chronicleId}/versions?object-
id={objectId}&version-policy=branch-version
/repositories/ { repositoryName }/ objects/{chronicleId}/versions?object-
id={objectId}&version-policy=same-version
Link Relation
All the link relations that is applicable for a newly created object. See “Link Relation”, section
in SysObject resource of the Core REST Developer Guide, which provides information on what kind of
links are available for a certain type of object.
Other Details
Please refer to the Core REST Developer Guide for more info since these link relations are
extensions from Core REST and they honor D2-Config. Sample steps of how object can be locked and
versioned are also present in the Guide.
Sample Steps
These steps describe how to perform common tasks in D2.
39
1. Type the following URL in your web browser to navigate to the service node (Home
Document).
http://localhost:8080/dctm-rest/services.json
The service node contains a list of the available services.
40
Optionally, “inline=true” query param can be used for the complete entry to be visible.
41
5. Alternatively, to only view a specific profile, navigate on the link rel: “self” of an entry.
42
This response has link relations to point to the:
a) types present in this profile.
b) a self-link pointing to itself (this profile).
6. To know the list of types configured in a profile, navigate to the “href” of the link relation
identified by: http://identifiers.opentext.com/linkrel/types-d2. Use inline=true to get the
type configuration along with the types. Otherwise, navigate on the “self” link relation of
each type entry.
43
As seen earlier for profile, each type has similar link relations to navigate to:
a) the types which are present in this profile (types-d2).
b) self link (which is this type).
Content creation
There are 2 ways to create content:
A) Create Object without Content; attach content to the object (two steps).
B) Create object with content (single step).
44
Now, POST data such as below to create an object without content:
The "d2_configuration" section provides the list of configurations that are to be applied to
the created object. Note that these configurations need to exist in the Docbase. Here is a
sample response for the above request:
Now, to set the content, follow the Core REST link relations or use templates from D2.
45
To get the list of available templates for this object, follow the href for the link relation:
“http://identifiers.opentext.com/linkrel/document-templates”
The response contains information about the template and the URL to the actual template document
object.
To set content to the object without using templates, use the other link relations “content”.
46
Create Object with content
To create Object with content, navigate to the href pointed by linkrelation:
http://identifiers.opentext.com/linkrel/object-creation.
Now, POST data such as below to create an object with content.
This content can be stored as a file in the local machine and the content-type needs to be
set as: multipart/form-data; boundary=boundary_string.
This is like the earlier request; however, the “d2_configuration” is passed along with the
content.
The response obtained is like the earlier response.
C2-View :
C2-View lists all the download URLs for the given object only if the object has at least one
PDF rendition. It gets download urls for all the C2_View_configs applicable for the given
document.
Link Relation:
47
This new http://identifiers.opentext.com/linkrel/views/c2-view link relation is
available to the object if the object’s content itself is PDF or it has at least one PDF rendition
available.
Eg :
<link rel="http://identifiers.opentext.com/linkrel/views/c2-view"
href="http://10.31.168.68:8090/d2_rest/repositories/CSAUTO/objects/0900303
98005c5b2/views/c2-view"/>
HTTP Method
GET
Query Parameters
None.
48
<dm:url>: The download URL also lists BOCS/ACS URL based on the following properties
configured in d2fs.properties.
D2-BOCS=true
includeAcsServer=true
Note: OpenText does not support Linked objects and Multi repository solutions as it’s a
limitation in CORE REST.
C2-Print :
C2-Print lists all the print URLS for the given object only if the object has at least one PDF
rendition. It gets print-urls for all the c2_print_configs applicable for the given document.
Link Relation:
This new http://identifiers.opentext.com/linkrel/views/c2-print link relation is
available to the object if the object’s content itself is PDF or it has at least one PDF rendition
available.
Eg :
<link rel="http://identifiers.opentext.com/linkrel/views/c2-print"
href="http://10.31.168.68:8090/d2_rest/repositories/CSAUTO/objects/0900303
98005c5b2/views/c2-print"/>
HTTP Method
GET
49
Server Accepted Request Media Types
• application/vnd.emc.documentum+xml
• application/vnd.emc.documentum+json
Query Parameters
controlled_field_1
controlled_field_2
controlled_field_3.
50
Task Status End Point:
http://{host}:{port}/d2fs-rest/repositories/{repositoryName}/
/processes/{processName}/{processId}/{taskName}/{taskId}/status
Http Method: GET
Parameters:
processName: Name of the dm_workflow process
processId: r_object_id of the dm_workflow process
taskName: Name of the workflow activity
taskId: r_object_id of the dmi_queue_item
Description: Task Status End point provides the state of the workflow task.
Http Method: Post
Parameters:
processName: Name of the dm_workflow process
processId: r_object_id of the dm_workflow process
taskName: Name of the workflow activity
taskId: r_object_id of the dmi_queue_item
Description: Post method of Task Status End point allows us to perform various operations
on Task.
1) JSON request body for Accepting a task
{
"properties": {
"action" : "acquire"
}
}
2) JSON request body for rejecting a task
{
"properties": {
"action" : "reject",
"comment": "test comment",
"next_task_id": "task id"
}
}
51
3) JSON request body for forwarding a task with sign-off intentions
{
"properties": {
“action" : "forward",
"comment": "test comment",
"next_task_id": "task id"
"signoff_login": "user name",
"signoff_password": "user password"
}
}
TaskNotes EndPoint
http://{host}:{port}/d2fs-
rest/repositories/{repositoryName}/processes/{processName}/{processId}/{taskName}/{taskId}/notes
HTTP Method
PUT
Sample request
{
"properties" : {"task_note" :"POST NOTE THROUGH REST SERVICE"}
}
Digital Signature
52
D2 SmartView provides the capability to send a document to digital signature providers for digital signatures.
Digital signature solutions allow D2 to integrate with enterprise-grade signature applications that allow
employees and third parties to sign quotes, contracts, and other documents in a fast, compliant and hassle-
free way. This feature is achieved via D2 Smart View Workflows.
D2 Smart View supports OpenText Core Signature as a digital signature provider. OpenText™ Core Signature
is a professional and enterprise-grade electronic signature application.
Refer to the D2 Administration Guide and the D2 Installation Guide for details on the different configurations
required for this.
There are multiple Rest APIs to support this feature as listed below. For detailed information on Rest API
spec, RADL needs to be referred.
53
The following diagram illustrates different entities involved and flow of Rest APIs calls.
54
1. Digital Signature Configuration: The rest end-point ‘d2-task-digital-signature-config’ returns the
Digital Signature configurations of a D2 workflow task in D2-Config.
The link rel (http://identifiers.emc.com/linkrel/d2-task-digital-signature-config) for this API can be
accessed in the response of task details rest end-point when the task has been configured to use
‘Digital Signature’. The configuration contains information such as Digital Signature provider name,
whether signer grouping is allowed, whether external signer is allowed, and other configuration
details.
2. Authentication with Core Signature: In order to access Core Signature APIs, one needs a valid OTDS
token. D2 Rest uses authorization code flow to get valid access token.
If the user is already authenticated with Core Signature, then HTTP status 200 would be returned.
Otherwise, HTTP status 403 would be returned with the Location header with Core Signature
authorization code URL. The Location header would also contain redirect URI.
Once the user provides OTDS credentials then the authorization code would be sent to D2 Rest using
the redirect_uri specified in the Location header URL. D2 Rest server exchanges the authorization
code for an access token.
This access token is stored in the D2CORESIGN-TOKEN cookie for future access to Core Signature APIs
using D2 Rest.
3. Validation API: If a document is sent for signature, then the user shouldn’t be allowed to send it again
until the signature is complete/cancelled. Clients can call the ‘d2-digital-signature-documents-
validator’ rest end point to check this. The link rel http://identifiers.emc.com/linkrel/ d2-digital-
signature-documents-validator for this API is returned in the ‘d2-task-digital-signature-config’ rest end
point. This also checks other validation conditions like if document is checked out, if the document
size is more than the allowed size, or if the document type is allowed.
4. Get signers list: The rest end point ‘d2-digital-signature-signees’ returns the list of signers as
configured in D2-Config. The link rel ‘http://identifiers.emc.com/linkrel/d2-digital-signature-signees’ is
returned in ‘ d2-task-digital-signature-config’ rest end point.
5. Creating Digital Signature Request: Create a Digital Signature Request by sending a POST request to
the ‘d2-digital-signatures’ end point. The link rel (http://identifiers.emc.com/linkrel/d2-digital-
55
signatures) for this is returned in ‘d2-task-digital-signature-config’ REST end-point. This API would
acquire a lock on the document on behalf of the superuser.
This API takes signer details, working documents, and supporting documents (attachments) in the
request body. In response to this API, the signature provider prepare URL is returned.
6. Send Digital Signature Request: Clients need to open the prepare URL in another window to send the
document for digital signature. Once the document is sent from the signature provider UI, there are
two options to get call back. One is to append ‘redirect_url’ to the prepare URL and open it. The
signature provider will redirect the user to this URL. The other options is to capture the windows
message events from the opened window. Core signature notifies the caller with the message events
once the document is successfully sent for signature.
7. Updating Digital Signature Request: The client needs to call ‘d2-digital-signature’ REST end-point once
the signature request has been sent in the Signature provider UI in order to update the signature
status in D2 Digital Signature object. The link rel (http://identifiers.emc.com/linkrel/d2-digital-
signature) is returned from the task details end point. This API doesn’t take any request body. Instead,
it gets the latest status and signers’ details from the provider and updates D2 Digital Signature object.
8. Get Digital Signature Request: Clients can call ‘d2-digital-signature’ end-point to know the latest
status of a digital signature tied to a given task. The link rel (http://identifiers.emc.com/linkrel/d2-
digital-signature) is returned from task details end point. This API is useful in scenarios when a
signature request is sent but a task couldn’t be marked as completed because of some network issue.
So, when a user revisits the incomplete task, clients can check if the signature is already created and
sent by calling this API. If the signature is sent, then the user might be allowed to complete the task. If
the signature is created but not sent, then the client needs to send a new digital signature request to
D2 Rest. An old signature request related to the task would be deleted from D2 as well as from the
signature provider.
9. Background D2 job: As described in the D2 Administration Guide, for each signature provider, there is a
job running on Documentum server. D2 method linked to the job polls the signature provider to get
the latest status on signature request. Every time there is a change in signer status or overall status,
there would be entry in the audit table depending on D2 audit config.
D2 installer deploys D2JobCoreSignStatusUpdate and D2CoreSignStatusUpdateMethod for Core
Signature Provider. Once a signature has been completed, D2 method would do the following:
a) It would get the signed document from signature provider and check-in the document to the
DCTM repository. It would honor any check-in config specified in D2 Config under Digital Signature
config. Once the document is checked in, the lock on the document is released.
b) It would get the signing log from the provider. The log file is added as relation
‘D2_DIGITAL_SIGNATURE_LOG’ to each of the signed documents. One needs to specify location
and ACL for the signing log in Digital Signature config.
56
c) The workflow “Digital Signature Tracker Task” would be marked as completed, and the workflow
would move forward.
d) If ‘Digital Signature Tracker Task’ has been designed with a ‘Reject’ flow and the signature request
is ‘declined/cancelled’, then the task would be completed with a Reject path.
a) ‘d2-workflow-tasks’ REST end-point returns information on ‘Digital Signature Tracker Task’. The task
would have configuration ‘is_digital_signature_awaiting_task’ set to true.
b) ‘d2-workflow-tasks-audits’ REST end-point returns information on all the digital signature events
auch as document sent for signing or signer signed/declined. This end-point takes a request param
‘is_digital_signature_awaiting_task’.
These rest end-points depend on ‘Smartview Content Import/Export’ configurations. So please refer admin
guide for more info on ‘Smartview Content Import/Export’ configurations.
1. Validate
The rest end-point ‘ d2-zip-and-download-validation‘ is used to validate the allowed file size, file type and
total count. link rel (http://identifiers.emc.com/linkrel/d2-zip-and-download-validation) for this rest end-point can
be accessed in the response of the repository rest end-point. This rest end-point needs a preconfigured zip and
download configuration to mention about the allowed total file size, file type, total files count etc. For more info on
this please refer “RADL” documentation.
57
2. Initialize zip and download
The rest end-point ‘d2-zip-and-downloads’ returns a unique ID representing dm_sysobject which is used to track
the status of files archiving process(zip and download process status). The link rel
(http://identifiers.emc.com/linkrel/d2-zip-and-downloads) can be accessed in the response of the validation rest
end-point , ’d2-zip-and-download-validation’. This rest end-point creates a tracking dm_sysobject and starts
a separate background thread which gets files from Content Server, compresses and creates a downloadable
archieved file (zip file). This background thread also creates a manifest file which contains details about the
files included in the archieve and also the warning messages for the files which are not included as part of the
archieved file. For more info on this please refer “RADL” documentation.
3. Status Check
This rest end-point ‘d2-zip-and-download-status ‘returns current status of the files archiving process. Based on
the status user/client takes a call whether to call download content API or not. The link rel
(http://identifiers.emc.com/linkrel/d2-zip-and-download-status ) can be accessed in the response of the ‘d2-zip-
and-downloads’ API. The possible status values are STARTED, INPROGRESS, COMPLETED, CANCELLED. For
more info on this please refer “RADL” documentation.
4. Download content
This rest end-point ‘d2-zip-and-download-content’ downloads the archived file to the clients machine by the
name download.zip. If the file-name is passed in the request then downloaded file will have the name passed. The
link rel (http://identifiers.emc.com/linkrel/d2-zip-and-download-content) can be accessed in the response of the
rest end-point ‘d2-zip-and-download-status ‘. This link rel will be available only after the status has the value
COMPLETED in the response of the rest end-point ‘d2-zip-and-download-status ‘. For more info on this please
refer “RADL” documentation.
58
Method Command: com.emc.d2.api.methods.D2Method -class_name
com.emc.d2.api.methods.D2ZipAndDownloadCleanupMethod
Custom Argument: -age
Description: Zip and Download init process will save the base directory location in the tracker object in
field directory_location.
This job will collect the directories information based on the following conditions,
Default age is one day or 1440 minutes
If status is INPROGRESS or STARTED, then the method will check the DATEDIFF with zip_process_init_time
If status is COMPLETED, then the method will check the DATEDIFF with archive_end_date
If the status is CANCELLED, then method will always collect the rows from DB
Once the Object Ids and Directories are collected then Job will delete the all the corresponding rows from the
DB and delete the directories.
In this process this JOB will assume that all the DATEs are saved in the DB in UTC format a common format for
APP server and Method Server, so that the date comparison can be uniform.
Advanced Search
Overview:
The advanced search feature from D2-REST provides search related capabilities to the REST clients such as
creating and saving search criteria, fetching objects based on search criteria, fetching saved search objects,
creating folders to save search criteria. Using advanced search, a user can search for documents based on a
lot of different criteria such as the content of the document, the document properties or the type of
document. The column and facet configuration defined by the user in advanced search displays the search
result as per the user requirement. It is also possible to limit the search to user defined folders through this
advanced search APIs.
This feature has been broken down into several different APIs based on their usage and for ease of
access to this feature. Please refer to the glossary below to better understand the advanced search
terminology in REST APIs before proceeding further.
Search terminology:
Search group: A user may choose to create a saved search object, the folder where this object is stored is
referred to as a Search group. A search group is of 2 types: PRIVATE and PUBLIC. If a search object is meant to
be shared with others, it should be stored under a PUBLIC search group else store it in a PRIVATE search
group. Search group is also referred to as Search category.
Search sub-group: For better classification of search objects and for ease of management a user may choose
to create folders in Search group. The saved search objects can then directly be stored under these folders.
These folders are referred to as search sub-group or search sub-criteria.
59
Advanced search APIs:
60
1. To get the list of all saved search objects and search sub-groups. This REST API can fetch all saved
search object (PRIVATE, PUBLIC OR PRIVATE+PUBLIC) and search sub-groups in a single go, however,
the request params exposed in this API help narrow down the response.
2. To create an advanced search object.
View Permission
Permissions API
This CORE-REST API (link-rel.: http://identifiers.emc.com/linkrel/permissions) is used to get the basic and
extended permissions for a logged in user, any particular user or any group for the selected object
Note: For 23.2 and newer, D2-REST (with the help of D2-Config) supports MACL (Mandatory Access
Con Control List). This means the security template in D2-Config now supports Permission,
Restriction, Required Group, and Required Group Set. Prior to 23.2, D2-Config only supported
Permissions. All the D2-REST endpoints honor the MACL, wherever applicable. Refer to D2-Config
guide for more details.
61
Installation Guide
Follow below guidelines for deploying REST .war depending on the app server.
WebLogic 12.1.3
Disable web service annotation scan for WebLogic
Since WebLogic has service provider hook for jaxb implementation, duplicate implementations for jaxb related jars
results in a linkage error. Follow the manual changes to the lib folder:
jaxb-api-2.1.jar
jaxb-impl-2.1.6.jar
jsr173_api-20060801.jar
stax-api-1.0-2.jar
stax2-api-3.1.1.jar
xml-apis-1.3.04.jar
xmlParserAPIs-2.6.2.jar
http://central.maven.org/maven2/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-impl-2.2.11.jar
http://central.maven.org/maven2/xalan/xalan/2.7.0/xalan-2.7.0.jar
2) Change the class loader order at Enterprise Applications > d2fs-rest-web_war > Manage Modules > d2fs-
rest-web.war class loader with local class loader first (parent last)
62
About OpenText
OpenText enables the digital world, creating a better way for organizations to work with information,
on-premises or in the cloud. For more information about OpenText (NASDAQ: OTEX, TSX: OTEX),
visit opentext.com.
63