Legacy REST API services
This page explains how to use legacy REST endpoints.
The endpoints described on this page are meant only for supporting the existing legacy D1 (1.1) applications. Do not develop new applications by using the legacy API, as it will not be supported.
Use the lates D1 REST API instead, which is also exposed and documented in Swagger and OpenAPI.
Activating and deactivating legacy REST endpoints
D1 enables you to activate or deactivate legacy REST endpoints. When you deactivate legacy endpoints, all legacy API calls fail. To activate, deactivate, or check the status of legacy APIs, go to the Adminstrator page, click Settings Menu on the top-right corner, and then expand Legacy API.
URL adaptation for Kubernetes installations
In Kubernetes D1 installations, the /rest
endpoint, which you will find in applications working with Legacy D1 API, doesn't work. To use Legacy D1 API in such environments, you need to adapt the URL - please use /component/service_name
instead of /rest/service_name
. The /component
endpoint itself is universal - it works in both Kubernetes and on-prem (packaged) installations.
Authentication
To authenticate, send a request to the https://host:port/tribefire-agiledocs-cartridge/rest/authenticate
endpoint. Additionally, you can validate the current session or end it, as explained below.
Endpoints
Endpoints below are responsible for authentication, session validation, and terminating a session (logout).
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Get session ID | https://host:port/tribefire-agiledocs-cartridge/rest/authenticate | None | user, password | sessionId |
POST | Is session valid? | https://host:port/tribefire-agiledocs-cartridge/rest/isSessionValid | sessionId | None | true or false |
POST | Logout | https://host:port/tribefire-agiledocs-cartridge/rest/authenticate/logout | sessionId | None | true |
Parameters
Parameter | Data type | Description |
---|---|---|
user | string | user name used for authentication |
password | string | password used for authorization |
sessionId | string | sessionId getting returned, verified or ended |
cURL Example
The legacy request shown below will return a session ID from http://adx-local:9080
. user
and password
are passed in the request body.
curl --location --request POST 'http://adx-local:9080/tribefire-agiledocs-cartridge/rest/authenticate' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'user=username' \
--data-urlencode 'password=password'
Working with documents
These endpoints allow you to work with documents (upload/delete/download/copy/move). Note that /doccreate
endpoint you might know from legacy D1 installations is no longer in use.
Endpoints
Use the endpoints described below to work with documents. Parameters marked in bold are mandatory. Requests with executionMode set to asynchron
always return the tracebackId.
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Upload content | https://host:port/tribefire-agiledocs-cartridge/docupload | None | sessionId, content (file), accessId, parent, documentType, metadata, multifileMetadata, directUpload, executionMode (synchron , asynchron ), content1(2,3,...,n) | Uploaded content metadata or tracking ID (asynchronous request) |
POST | Copy document | https://host:port/tribefire-agiledocs-cartridge/doccopy | None | sessionId, documentId, accessId, parentId, executionMode (synchron , asynchron ) | Copied content metadata or tracking ID (asynchronous request) |
POST | Delete document | https://host:port/tribefire-agiledocs-cartridge/docdelete | None | sessionId, entryId1, accessId, executionMode | IDs of deleted entries with a boolean flag marking them as deleted set to true . |
POST | Download document | https://host:port/tribefire-agiledocs-cartridge/docdownload | sessionId, documentId, download (true or false), accessId | None | Downloaded file |
POST | Move document (between repositories) | https://host:port/tribefire-agiledocs-cartridge/docmove | None | sessionId, srcAccessId, entryId1, dstAccessId, dstParentId, action (move-doc), entryId2(3,4,...,n), deleteOriginal (true or false ), executionMode | Moved content metadata |
POST | Update document | https://host:port/tribefire-agiledocs-cartridge/docupdate | None | sessionId, documentId, accessId, content | Updated content metadata |
Parameters
Parameter | Data type | Description |
---|---|---|
content | file | file uploaded to the system |
parent | string | Parent folder ID |
parentId | string | Parent folder ID |
sessionId | string | Session ID returned by authentication request |
entryId1(2,3,4,...,n) | string | ID of a document or folder. You can enter multiple IDs (entryId2, entryId3...) in your request when this syntax is used. |
documentId | string | Document ID |
documentType | string | Type of the document which is being uploaded. |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
srcAccessId | string | Source repository access ID - used when moving documents |
dstAccessId | string | Destination repository access ID - used when moving documents |
dstParentId | string | Destination parent folder ID - used when moving documents |
metadata | string | JSON with the metadata properties and values |
multifileMetadata | JSON with the metadata properties and values | |
directUpload | string | CMIS feature that provides faster upload if you set it to true . |
executionMode | string | synchron or asynchron for synchronous or asynchronous request. |
deleteOriginal | string | Used when moving documents to delete the original document (can be set to true or false ) |
action | string | move-doc - value expected when moving documents. |
Upload Document cURL Request
The request below uploads a document from the provided file system path into a specific folder of a repository.
curl --location --request POST 'http://adx-local:9080/tribefire-agiledocs-cartridge/docupload' \
--header 'Content-Type: multipart/form-data; boundary=--------------------------153931285616406442159366' \
--form 'content=@/C:/path/to/file/filename.pdf' \
--form 'parent=55fb0cb2-a709-4961-b22e-c4c69f5ac24b' \
--form 'sessionId=20200319170818206-fea02fe8-f33a-4310-922a-289470e10cb6' \
--form 'accessId=access.adx.content.default'
Versioning documents
Use the endpoints below to work with document versions.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data |
---|---|---|---|---|
POST | Check out/check in | https://host:port/tribefire-agiledocs-cartridge/doclock | action (check-in or check-out) | sessionId, documentId, accessId |
POST | Create new document version | https://host:port/tribefire-agiledocs-cartridge/docnewversion | None | sessionId, documentId, accessId, content, version |
POST | Get all previous versions of a document | https://host:port/tribefire-agiledocs-cartridge/getprevious | None | sessionId, documentId, accessId |
POST | Switch to a previous document version | https://host:port/tribefire-agiledocs-cartridge/switchversions | None | sessionId, documentId, accessId, versionId |
Parameters
Parameter | Data type | Description |
---|---|---|
content | file | file uploaded to the system |
sessionId | string | Session ID returned by authentication request |
versionId | string | Version ID of a document |
documentId | string | Document ID |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
action | string | Used when checking documents in/out (value: check-in or check-out ) |
cURL request - Creating new document version
The request below creates a new version of a document identified by its ID. Document is updated with a file uploaded from the file system.
curl --location --request POST 'http://adx-local:9080/tribefire-agiledocs-cartridge/docnewversion' \
--form 'content=@/C:/path/to/file/filename.pdf' \
--form 'sessionId=20200319170818206-fea02fe8-f33a-4310-922a-289470e10cb6' \
--form 'accessId=access.adx.content.default' \
--form 'documentId=6ca0bb4d-95b7-42c7-988b-6d386a50253b' \
--form 'version=2'
Adding repositories
You can add new repositories via the https://host:port/tribefire-agiledocs-cartridge/addrepository
endpoint.
Endpoints
Use /tribefire
, /cmis
or /documentum
endpoints depending on the type of the repository you want to add.
Request type | Service description | Endpoint | Request query parameters | Form data parameters | Returns |
---|---|---|---|---|---|
Post | Add D1 Repository | https://host:port/tribefire-agiledocs-cartridge/addrepository/tribefire | None | sessionId, repositoryName, repositoryDescription, repositoryRootFolderName, repositoryResourceFolderPath , repositoryCacheFolderPath , repositoryDbConnectionType , repositoryDbUsername , repositoryDbPassword , repositoryDbHost, repositoryDbPort, repositoryDbName, repositoryDbService, repositoryDbVersion, cacheDbConnectionType, cacheDbUsername, cacheDbPassword, cacheDbHost, cacheDbPort, cacheDbName, cacheDbService, cacheDbVersion, action | Created repository metadata |
Post | Add Documentum Repository | https://host:port/tribefire-agiledocs-cartridge/addrepository/cmis | None | sessionId, repositoryName, repositoryDescription, repositoryUrl, repositoryId, rootFolderId, repositoryCacheFolderPath, cacheDbConnectionType, cacheDbUsername, cacheDbPassword, cacheDbHost, cacheDbPort, cacheDbName, cacheDbService, cacheDbVersion, action | Created repository metadata |
Post | Add CMIS Repository | https://host:port/tribefire-agiledocs-cartridge/addrepository/documentum | None | sessionId, repositoryName, repositoryDescription, authMethod, bindingType, repositoryUrl, repositoryId, rootFolderId, repositoryCacheFolderPath, cacheDbConnectionType, cacheDbUsername, cacheDbPassword, cacheDbHost, cacheDbPort, cacheDbName, cacheDbService, cacheDbVersion, action | Created repository metadata |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | session ID returned after authentication |
repositoryName | string | Name of the repository getting created |
repositoryDescription | string | Description of the repository getting created |
repositoryRootFolderName | string | Name of the root folder created in the repository |
repositoryResourceFolderPath | string | Path to the actual folder on your file system in which respository resources will be kept. |
repositoryCacheFolderPath | string | Path to the actual folder on your file system in which cached respository resources will be kept. |
repositoryDbConnectionType | string | Database you wish to use for storing metadata about repository resources. You can chose between Oracle (oracleconn ), MS SQL Server (mssqlconn ) and MySQL (mysqlconn ). |
repositoryDbUsername | string | Username for database storing repository resources metadata. |
repositoryDbPassword | string | Password for database storing repository resources metadata. |
repositoryDbHost | string | Host name of the database storing repository resources metadata. |
repositoryDbPort | string | Port of the database storing repository resources metadata. |
repositoryDbName | string | Name of the database storing repository resources metadata. |
repositoryDbService | string | Service name of the database storing repository resources metadata. |
repositoryDbVersion | string | Type of database (for example Oracle , MySQL , SqlServer2008 , SqlServer2012 , SqlServer2014 ) you wish to use for storing repository resources metadata. For Oracle versions grater than 10 enter Oracle10g . |
cacheDbConnectionType | string | Database used for storing metadata about repository resources cache. You can choose between Oracle (oracleconn ), MS SQL Server (mssqlconn ) and MySQL (mysqlconn ). |
cacheDbUsername | string | Username for database storing repository resources cache metadata. |
cacheDbPassword | string | Password for database storing repository resources cache metadata. |
cacheDbHost | string | Host name of the database storing repository resources cache metadata. |
cacheDbPort | string | Port of the database storing repository resources cache metadata. |
cacheDbName | string | Name of the database storing repository resources cache metadata. |
cacheDbService | string | Service name of the database storing repository resources cache metadata. |
cacheDbVersion | string | Type of database (for example Oracle , MySQL , SqlServer2008 , SqlServer2012 , SqlServer2014 ) you wish to use for storing repository resources metadata. For Oracle versions grater than 10 enter Oracle10g . |
action | string | add-tf for adding standard D1 repository, add-cmis for adding CMIS repository, add-documentum for adding Documentum repository. |
Creating folders
Creating folders is done via the /assembly-manipulate
endpoint. You need to enter folder properties in the form data.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Create folder | https://host:port/tribefire-services/rest/assembly-manipulate | accessId, sessionId, projection | body | Created folder JSON data structure |
Parameters
Parameter | Data type | Description |
---|---|---|
projection | string | Enter entity as the value |
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
body | string | Data structure containing the type signature (Folder in this case) and its mandatory properties (name for a folder). See the cURL request below for an example body content. |
cURL request - Creating a folder
curl --location --request POST 'http://adx-local:9080/tribefire-services/rest/assembly-manipulate?accessId=access.adx.content.default&sessionId=20200319170818206-fea02fe8-f33a-4310-922a-289470e10cb6&projection=entity' \
--header 'Content-Type: multipart/form-data; boundary=--------------------------860040075212999776415305' \
--form 'body={ "_type": "com.braintribe.model.resourcerepository.Folder",
"name": "TestParentFolder"
}'
Updating entry metadata
Updating metadata on contents and folders is done using the /assembly-manipulate
endoint.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Update entry as defined in body (see Body Templates) | https://host:port/tribefire-services/rest/assembly-manipulate | accessId, sessionId | body, projection | Updated entry JSON structure |
Parameters
Parameter | Data type | Description |
---|---|---|
projection | string | Enter entity as the value |
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
body | string | Data structure containing the type signature of the repository entry and its properties to be updated (remeber that mandatory properties must always be defined). See the cURL request below for an example body content. |
Body templates
Update document name
This template contains the name
parameter, used to set new document name.
{
"_type": "com.braintribe.model.resourcerepository.Content",
"id": "DocumentID",
"name": "NewName"
}
Move document
This template contains the parent
parameter, used to define the parent folder via the id
paremeter. Document identified by its id
is moved into this folder.
{
"_type": "com.braintribe.model.resourcerepository.Content",
"id": "DocumentID",
"parent": {
"_type": "com.braintribe.model.resourcerepository.Folder",
"id": "ParentID"
}
}
Create folder
This template contains the parent
parameter, used to define the parent folder of the newly created folder. name
is used to define the name of the new folder.
{ "_type": "com.braintribe.model.resourcerepository.Folder",
"parent": {"_type": "com.braintribe.model.resourcerepository.Folder",
id:"ParentFolderID"},
"name": "FolderName"
}
Update folder name
This template updates the name
of a folder identified by its id
.
{
"_type": "com.braintribe.model.resourcerepository.Folder",
"id": "FolderID",
"name": "NewName"
}
Move folder
This template defines the target parent
folder by id
, as well as the source folder id
.
{
"_type": "com.braintribe.model.resourcerepository.Folder",
"id": "SourceFolderID",
"parent": {
"_type": "com.braintribe.model.resourcerepository.Folder",
"id": "TargetParentID"
}
}
Add external repository credentials
In the template below, username
and password
are credentials to the external repository. adxUsername
refers to the D1 user. Repository is identified by id
.
{
"_type": "com.braintribe.model.agiledocs.repository.RepositoryCredentials",
"username": "UserName",
"password": "Password",
"adxUsername": "ADxUserName",
"repository": {
"_type": "com.braintribe.model.agiledocs.repository.Repository",
"id": "RepositoryId"
}
}
Change metadata values
Adapt the template below as required to change metadata values.
[{
"_type": "com.braintribe.model.resourcerepository.Property",
"id":"MetadataID1",
"value":"newMetadataValue1"
},
{
"_type": "com.braintribe.model.resourcerepository.Property",
"id":"MetadataID2",
"value":"newMetadataValue2"
},
{
"_type": "com.braintribe.model.resourcerepository.Property",
"id":"MetadataID3",
"value":"newMetadataValue3"
}]
Sample cURL request
The below request creates a new name (Test1.pdf
) on a content and assigns it to a parent with a specific ID.
curl --location --request POST 'http://adx-local:9080/tribefire-services/rest/assembly-manipulate?sessionId=20200323130212488-2dd744d2-7ae1-4144-b41b-8330f6a05f8a&accessId=access.adx.content.default&projection=entity' \
--form 'body={
"_type": "com.braintribe.model.resourcerepository.Content",
"id":"6c34bb3c-fc7f-42b6-8202-af566c48aacd",
"name": "Test1.pdf",
"parent":{"_type": "com.braintribe.model.resourcerepository.Folder",
"id":"51f5ee2d-fefc-4df3-b346-b48096c0ee5f"
}
}'
Working with tags
You can add tags as a property parameter of the /set-insert
and /set-remove
endpoints.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
GET | Insert a tag | https://host:port/tribefire-services/rest/set-insert | accessId, sessionId, Id, type, property, value | None | null |
GET | Remove a tag | https://host:port/tribefire-services/rest/set-remove | accessId, sessionId, Id, type, property, value | None | null |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
Id | string | Id of a document or folder |
type | string | Type signature of repository entry. Value is fixed to com.braintribe.model.resourcerepository.RepositoryEntry . |
property | string | This value (fixed to tags ) tells the system that we want to apply tags. |
value | string | Actual text of the tag. |
cURL request
The request below inserts tag user1ContentTag
on a repository entry with ID 6ca0bb4d-95b7-42c7-988b-6d386a50253b
in a repository named default
.
curl --location --request GET 'http://adx-local:9080/tribefire-services/rest/set-insert?sessionId=20200319170818206-fea02fe8-f33a-4310-922a-289470e10cb6&accessId=access.adx.content.default&type=com.braintribe.model.resourcerepository.RepositoryEntry&id=6ca0bb4d-95b7-42c7-988b-6d386a50253b&property=tags&value=user1ContentTag'
Converting documents
Legacy endpoints support converting documents to PDF and operations on PDF files as described below.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Merge documents | https://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/merge | None | accessId, sessionId, entryId1, entryId2, action | Output file stream |
POST | Apply watermark | https://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/watermark | None | accessId, sessionId, entryId1, action, watermarkText | Output file stream |
POST | Extract text | https://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/textextract | None | accessId, sessionId, entryId1 action | Output file stream |
POST | Split | https://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/split | None | accessId, sessionId, entryId1, entryId2, action, splitStartPage, splitEndPage, splitPagesPerFile | Output file stream |
POST | Convert to PDF | https://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/pdfconvert | None | accessId, sessionId, entryId1, entryId2, action | Output file stream |
POST
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
entryId1(2,3,...,n) | string | Entry ID (in this case content ID). You can enter multiple Entry IDs when merging documents, all other requests only take entryId1. |
action | string | Enter one of the following values, corresponding to your request: merge , watermark , extractText , split , pdf |
watermarkText | string | Parameter defining the watermark text. |
splitStartPage | string | Page number where splitting should start. |
splitEndPage | string | Page number where splitting should end. |
splitPagesPerFile | string | Page limit for files created while splitting document. |
cURL request
The following request will split entry with ID 1234
starting from page 1
and ending on page 20
, creating 2-page long
documents in the process.
curl -X POST "https://adxhost.com/tribefire-agiledocs-cartridge/pdfutils/split" -H "accept: application/pdf" -H "Content-Type: application/x-www-form-urlencoded" -d "sessionId=1234&accessId=access.adx.content.repositoryname&entryId1=1234&action=split&splitStartPage=1&splitEndPage=20&splitPagesPerFile=2"
GET requests - Querying by type signature
Legacy D1 provides an endpoint dedicated for queries, which you can use to send GET requests. Returned data depends on your query statement, which consists of a type signature and a WHERE clause - take a look at the example queries below.
Endpoint
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
GET | Querying by statement (see Statements) | https://host:port/tribefire-services/rest/query | accessId, sessionId, statement (from+com.braintribe.model.agiledocs.repository.Repository ), depth | none | Items matching your statement |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
statement | string | Your URL-encoded query statement consisting of from+type.signature and a WHERE clause. |
depth | string | Defines how "deep" the query should go in a folder structure. depth=1 means the current directory only, depth=2 includes sub-folders, etc. |
Statements
Purpose | Statement |
---|---|
List all repositories | from+com.braintribe.model.agiledocs.repository.Repository |
List all contents of a folder | from com.braintribe.model.resourcerepository.Content where parent="FolderID" |
Find content by ID | from com.braintribe.model.resourcerepository.Content where id="DocumentID" |
Get Subfolders | from com.braintribe.model.resourcerepository.Content where parent="FolderID" |
Get Entity by Tag - D1 repositories only, external repositories are not supported | from com.braintribe.model.resourcerepository.RepositoryEntry where "TagName" in tags |
Get Request status | from com.braintribe.model.agiledocs.asyncrequest.AsyncRequestTracking where requestId = "RequestId" |
Get Templates by ID | from com.braintribe.model.resourcerepository.Content where id="TemplateID" |
Searching files
You can search files using the /tribefire-services/rest/assembly-query
endpoint, passing the search conditions in the body parameter of the query (do not confuse with the request body, which is empty in this case).
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Search files | https://host:port/tribefire-services/rest/assembly-query | accessId, sessionId, depth, body | None | List of items matching the criteria set in body . See the list of body templates below. |
Example body - Searching files by keywords
Use the below JSON as a template - adapt SEARCHING_KEYWORDS and PARENT_FOLDER_ID as required.
{
"_type": "com.braintribe.model.query.EntityQuery",
"distinct": false,
"entityTypeSignature": "com.braintribe.model.resourcerepository.Content",
"noAbsenceInformation": false,
"restriction": {
"_type": "com.braintribe.model.query.Restriction",
"condition": {
"_type": "com.braintribe.model.query.conditions.Conjunction",
"operands": [
{
"_type": "com.braintribe.model.query.conditions.FulltextComparison",
"text": "SEARCHING_KEYWORDS"
},
{
"_type": "com.braintribe.model.query.conditions.ValueComparison",
"leftOperand": {
"_type": "com.braintribe.model.query.PropertyOperand",
"propertyName": "parent"
},
"operator": {
"_type": "com.braintribe.model.query.Operator",
"value": "equal"
},
"rightOperand": {
"_type": "string",
"value": "PARENT_FOLDER_ID"
}
}
]
},
"paging": {
"_type": "com.braintribe.model.query.Paging",
"pageSize": 100,
"startIndex": 0
}
},
"traversingCriterion": null
}
Example body - Searching metadata
Adapt the body below - replace DOCUMENTTYPE with the actual document type you wish to find, PROPERTYTYPE with property you are looking for and PROPERTYVALUE with the value of the property you are searching for
{
"_id" : "0",
"_type" : "com.braintribe.model.query.SelectQuery",
"distinct" : true,
"entityId" : null,
"evaluationExcludes" : null,
"froms" : [ {
"_id" : "1",
"_type" : "com.braintribe.model.query.From",
"entityId" : null,
"entityTypeSignature" : "com.braintribe.model.resourcerepository.Content",
"joins" : null
}, {
"_id" : "2",
"_type" : "com.braintribe.model.query.From",
"entityId" : null,
"entityTypeSignature" : "com.braintribe.model.resourcerepository.DocumentType",
"joins" : null
} ,
{
"_id" : "15",
"_type" : "com.braintribe.model.query.From",
"entityId" : null,
"entityTypeSignature" : "com.braintribe.model.resourcerepository.PropertyType",
"joins" : null
},
{
"_id" : "16",
"_type" : "com.braintribe.model.query.From",
"entityId" : null,
"entityTypeSignature" : "com.braintribe.model.resourcerepository.Property",
"joins" : null
} ],
"groupBy" : null,
"ignorePriviledgedRoles" : null,
"ordering" : null,
"queryContext" : null,
"restriction" : {
"_id" : "3",
"_type" : "com.braintribe.model.query.Restriction",
"condition" : {
"_id" : "4",
"_type" : "com.braintribe.model.query.conditions.Conjunction",
"entityId" : null,
"operands" : [ {
"_id" : "5",
"_type" : "com.braintribe.model.query.conditions.ValueComparison",
"entityId" : null,
"leftOperand" : {
"_id" : "6",
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "documentType",
"source" : {
"_ref" : "1"
}
},
"operator" : {
"_type" : "com.braintribe.model.query.Operator",
"value" : "equal"
},
"rightOperand" : {
"_id" : "7",
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : null,
"source" : {
"_ref" : "2"
}
}
},
{
"_type" : "com.braintribe.model.query.conditions.ValueComparison",
"entityId" : null,
"leftOperand" : {
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "propertyType",
"source" : {
"_ref" : "16"
}
},
"operator" : {
"_type" : "com.braintribe.model.query.Operator",
"value" : "equal"
},
"rightOperand" : {
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : null,
"source" : {
"_ref" : "15"
}
}
},
{
"_id" : "8",
"_type" : "com.braintribe.model.query.conditions.ValueComparison",
"entityId" : null,
"leftOperand" : {
"_id" : "9",
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "value",
"source" : {
"_ref" : "16"
}
},
"operator" : {
"_type" : "com.braintribe.model.query.Operator",
"value" : "equal"
},
"rightOperand" : "PROPERTYVALUE"
},
{
"_id" : "8",
"_type" : "com.braintribe.model.query.conditions.ValueComparison",
"entityId" : null,
"leftOperand" : {
"_id" : "9",
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "attrName",
"source" : {
"_ref" : "15"
}
},
"operator" : {
"_type" : "com.braintribe.model.query.Operator",
"value" : "equal"
},
"rightOperand" : "PROPERTYTYPE"
},
{
"_id" : "9",
"_type" : "com.braintribe.model.query.conditions.ValueComparison",
"entityId" : null,
"leftOperand" : {
"_id" : "9",
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "typeName",
"source" : {
"_ref" : "2"
}
},
"operator" : {
"_type" : "com.braintribe.model.query.Operator",
"value" : "equal"
},
"rightOperand" : "DOCUMENTTYPE"
}]
},
"entityId" : null,
"paging" : null
},
"selections" : [ {
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "id",
"source" : {
"_ref" : "1"
}
},
{
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "typeName",
"source" : {
"_ref" : "2"
}
},
{
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "attrName",
"source" : {
"_ref" : "15"
}
} ,{
"_type" : "com.braintribe.model.query.PropertyOperand",
"entityId" : null,
"propertyName" : "value",
"source" : {
"_ref" : "16"
}
} ],
"traversingCriterion" : null
}
Using templates
Use the endpoints described below to perform operations on documents via templates. These requests require a mergeData
JSON input identifying templates to be used, documents to work with, and folders where the result should be uploaded - use the examples below as a starting point when developing your own input.
Note that /templupload
is deprecated and only present to return an error message. Use /docupload
to upload templates - in D1 2.x they are treated as any other content.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Upload template (must be in Velocity Engine format) | https://host:port/tribefire-agiledocs-cartridge/templupload | none | sessionId, content | An error - template upload should be done via /docupload . |
POST | Merge PDFs from template | https://host:port/tribefire-agiledocs-cartridge/mergepdf | none | sessionId, accessId, mergeData | Created content metadata. |
POST | Merge PDFs from toxicology template | https://host:port/tribefire-agiledocs-cartridge/toxmergepdf | none | sessionId, accessId, mergeData | Created content metadata. |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
mergeData | string | JSON data input - see the templates below. |
Merge PDFs from template - JSON mergeData
example
Adapt the template below to merge template-based documents. Two non-template based documents are added to the JSON as well. You need to insert template IDs, document IDs, parent folder ID, and the name for the merged file.
{
"mergeData" : [
{
"type" : "TEMPLATE",
"id" : "TEMPLATE_ID_1",
"variables" : {
"docReviewerReason":"Reason : I am approving this document",
"docStatus":"Closed",
"docAuthorName":"Iris TEST175",
"docReportName":"Capture.PNG",
"docAssesmentType":"FormulatedIngredient Review",
"docAuthorReason":"Reason : I am the author of this document",
"reportGeneratedOn":"15-Nov-2017",
"docAuthorEmail":"ITEST175@domain.com",
"rtreprNo":"RTR_00242",
"docReviewerDate":"2017-11-15 15:22:35.66",
"docAuthorDate":"15-Nov-2017",
"docReviewerName":"Iris TEST180",
"reportGeneratedBy":"Iris TEST180",
"docReviewerEmail":"ITEST180@domain.com"
}
},
{
"type" : "DOCUMENT",
"id" : "FILE_ID_1"
},
{
"type" : "DOCUMENT",
"id" : "FILE_ID_2"
},
{
"type" : "TEMPLATE",
"id" : "TEMPLATE_ID_2",
"variables" : {
"col1" : "asf",
"col2":"Reason : I am approving this document",
"cell11":"Closed",
"cell21":"Iris TEST175",
"cell12":"Capture.PNG",
"cell22":"FormulatedIngredient Review"
}
}
],
"parentId":"PARENT_FOLDER_ID",
"rtreprNo":"NAME_OF_MERGED_FILE",
"version":"1.0"
}
Merge PDFs from toxicology template - JSON mergeData
example
Use the JSON below as a basis for your toxicology merge request. Replace r_object_id
values with document IDs and gxpFolderId
with the parent folder ID.
{
"coverPageVersion":"1.0",
"coverPageDocAssesmentType":"FormulatedIngredient Review",
"project_name":"Automation_Program_By_Admin",
"coverPageComments":"My Own Comments",
"coverPageDocAuthorReason":"I am the author of this document",
"coverPageDocAuthorDate":"2017-11-15 15:14:11.0",
"coverPageDocReviewerReason":"I am approving this document",
"coverPageDocReviewerDate":"2017-22-15 15:22:35.35",
"ntId":"itest180",
"coverPageDocReviewerEmail":"ITEST180@domain.com",
"coverPageDocumentParams":[
{
"docReviewerReason":"Reason : I am approving this document",
"docStatus":"Closed",
"docAuthorName":"Iris TEST175",
"docReportName":"Capture.PNG",
"docAssesmentType":"FormulatedIngredient Review",
"docAuthorReason":"Reason : I am the author of this document",
"reportGeneratedOn":"15-Nov-2017",
"docAuthorEmail":"ITEST175@domain.com",
"rtreprNo":"RTR_00242",
"r_object_id":"FILE_ID_1",
"docReviewerDate":"2017-11-15 15:22:35.66",
"docAuthorDate":"15-Nov-2017",
"docReviewerName":"Iris TEST180",
"reportGeneratedBy":"Iris TEST180",
"docReviewerEmail":"ITEST180@domain.com"
},
{
"docReviewerReason":"Reason : I am approving this document",
"docStatus":"Closed",
"docAuthorName":"Iris TEST175",
"docReportName":"Capture.PNG",
"docAssesmentType":"FormulatedIngredient Review",
"docAuthorReason":"Reason : I am the author of this document",
"reportGeneratedOn":"15-Nov-2017",
"docAuthorEmail":"ITEST175@domain.com",
"rtreprNo":"RTR_00242",
"r_object_id":"FILE_ID_2",
"docReviewerDate":"2017-11-15 15:22:35.66",
"docAuthorDate":"15-Nov-2017",
"docReviewerName":"Iris TEST180",
"reportGeneratedBy":"Iris TEST180",
"docReviewerEmail":"ITEST180@domain.com"
}
],
"requestSeqNo":"338",
"coverPageDocStatus":"Closed",
"coverPageDocAuthorName":"Iris TEST175",
"docbase_name":"dmfusrimvd01",
"coverPageRtreprNo":"RTR_00242",
"coverPageDocAuthorEmail":"ITEST175@domain.com",
"gxpFolderId":"PARENT_FOLDER_ID",
"coverPageDocReviewerName":"Iris TEST180",
"coverPageReportGeneratedOn":"15-Nov-2017",
"coverPageReportGeneratedBy":"Iris TEST180"
}
Working with digital keys and signatures
You can generate and verify digital keys and signatures using the endpoints described below.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Generate digital key | https://host:port/tribefire-agiledocs-cartridge/genkey | none | sessionId, action (iskeyset or genkeypair ) | iskeyset: true or false , genkeypair: generated key |
POST | Sign content or verify signature | https://host:port/tribefire-agiledocs-cartridge/digsign | none | sessionId, accessId, documentId, privateKey, action (sign-tf or verify-tf ) | Verification: true or false |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
documentId | string | Document ID identifying the document to be signed. |
privateKey | string | Key with which you're signing the document. |
action | string | For generating keys: genkeypair (key generation) or iskeyset (verification). For signatures: sign-tf (signing document) or verify-tf (verification). |
Viewing and rendering files
Use the endpoint described below to transform files to images, pdf or generate a link to open the file in WebReader.
Endpoints
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Transform a file | https://host:port/tribefire-agiledocs-cartridge/transform | none | sessionId, accessId, documentId, preview, download, downloadName | Depending on preview , either a thumbnail image, a PDF, or a WebReader link is returned. |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
documentId | string | Document ID identifying the document to be signed. |
preview | string | thumbnail , pdf or webreader , depending on the output you want |
download | string | true to download rendered file, false to open it in a browser |
downloadName | string | Name of the downloaded file. |
Running health checks
You can send a GET request to https://host:port/deep-healthcheck-cartridge/deephealthcheck
to run a predefined set of tests on the selected repository (or all repositories).
Endpoint
Request type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Run deep health check | https://host:port/deep-healthcheck-cartridge/deephealthcheck | action | sessionId, accessId (not needed for allhealthcheck action) | Repository status |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned by authentication request |
accessId | string | Access ID, typically used to identify a repository (syntax: access.adx.content.repositoryname ) |
action | string | either healthcheck for checking a single repository or allhealthcheck for checking all repositories. allhealthcheck request does not require accessId . |