logoBack to home screen

Legacy REST API

This page explains how to use legacy REST endpoints. Please keep in mind that these endpoints are only meant to provide support for existing legacy ADx (1.1) applications. Please do not develop new applications working with Legacy API, as it won't be developed - use the latest ADx REST API instead, which is exposed via Swagger and OpenAPI.

URL Adaptation for Kubernetes Installations

In Kubernetes ADx installations, the /rest endpoint, which you will find in applications working with Legacy ADx API, doesn't work. To use Legacy ADx 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTGet session IDhttps://host:port/tribefire-agiledocs-cartridge/rest/authenticateNoneuser, passwordsessionId
POSTIs session valid?https://host:port/tribefire-agiledocs-cartridge/rest/isSessionValidsessionIdNonetrue or false
POSTLogouthttps://host:port/tribefire-agiledocs-cartridge/rest/authenticate/logoutsessionIdNonetrue

Parameters

ParameterData typeDescription
userstringuser name used for authentication
passwordstringpassword used for authorization
sessionIdstringsessionId 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 ADx 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTUpload contenthttps://host:port/tribefire-agiledocs-cartridge/docuploadNonesessionId, content (file), accessId, parent, documentType, metadata, multifileMetadata, directUpload, executionMode (synchron, asynchron), content1(2,3,...,n)Uploaded content metadata or tracking ID (asynchronous request)
POSTCopy documenthttps://host:port/tribefire-agiledocs-cartridge/doccopyNonesessionId, documentId, accessId, parentId, executionMode (synchron, asynchron)Copied content metadata or tracking ID (asynchronous request)
POSTDelete documenthttps://host:port/tribefire-agiledocs-cartridge/docdeleteNonesessionId, entryId1, accessId, executionModeIDs of deleted entries with a boolean flag marking them as deleted set to true.
POSTDownload documenthttps://host:port/tribefire-agiledocs-cartridge/docdownloadsessionId, documentId, download (true or false), accessIdNoneDownloaded file
POSTMove document (between repositories)https://host:port/tribefire-agiledocs-cartridge/docmoveNonesessionId, srcAccessId, entryId1, dstAccessId, dstParentId, action (move-doc), entryId2(3,4,...,n), deleteOriginal (true or false), executionModeMoved content metadata
POSTUpdate documenthttps://host:port/tribefire-agiledocs-cartridge/docupdateNonesessionId, documentId, accessId, contentUpdated content metadata

Parameters

ParameterData typeDescription
contentfilefile uploaded to the system
parentstringParent folder ID
parentIdstringParent folder ID
sessionIdstringSession ID returned by authentication request
entryId1(2,3,4,...,n)stringID of a document or folder. You can enter multiple IDs (entryId2, entryId3...) in your request when this syntax is used.
documentIdstringDocument ID
documentTypestringType of the document which is being uploaded.
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
srcAccessIdstringSource repository access ID - used when moving documents
dstAccessIdstringDestination repository access ID - used when moving documents
dstParentIdstringDestination parent folder ID - used when moving documents
metadatastringJSON with the metadata properties and values
multifileMetadataJSON with the metadata properties and values
directUploadstringCMIS feature that provides faster upload if you set it to true.
executionModestringsynchron or asynchron for synchronous or asynchronous request.
deleteOriginalstringUsed when moving documents to delete the original document (can be set to true or false)
actionstringmove-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 typeService descriptionEndpointRequest query parametersForm data
POSTCheck out/check inhttps://host:port/tribefire-agiledocs-cartridge/doclockaction (check-in or check-out)sessionId, documentId, accessId
POSTCreate new document versionhttps://host:port/tribefire-agiledocs-cartridge/docnewversionNonesessionId, documentId, accessId, content, version
POSTGet all previous versions of a documenthttps://host:port/tribefire-agiledocs-cartridge/getpreviousNonesessionId, documentId, accessId
POSTSwitch to a previous document versionhttps://host:port/tribefire-agiledocs-cartridge/switchversionsNonesessionId, documentId, accessId, versionId

Parameters

ParameterData typeDescription
contentfilefile uploaded to the system
sessionIdstringSession ID returned by authentication request
versionIdstringVersion ID of a document
documentIdstringDocument ID
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
actionstringUsed 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 typeService descriptionEndpointRequest query parametersForm data parametersReturns
PostAdd ADx Repositoryhttps://host:port/tribefire-agiledocs-cartridge/addrepository/tribefireNonesessionId, repositoryName, repositoryDescription, repositoryRootFolderName, repositoryResourceFolderPath , repositoryCacheFolderPath , repositoryDbConnectionType , repositoryDbUsername , repositoryDbPassword , repositoryDbHost, repositoryDbPort, repositoryDbName, repositoryDbService, repositoryDbVersion, cacheDbConnectionType, cacheDbUsername, cacheDbPassword, cacheDbHost, cacheDbPort, cacheDbName, cacheDbService, cacheDbVersion, actionCreated repository metadata
PostAdd Documentum Repositoryhttps://host:port/tribefire-agiledocs-cartridge/addrepository/cmisNonesessionId, repositoryName, repositoryDescription, repositoryUrl, repositoryId, rootFolderId, repositoryCacheFolderPath, cacheDbConnectionType, cacheDbUsername, cacheDbPassword, cacheDbHost, cacheDbPort, cacheDbName, cacheDbService, cacheDbVersion, actionCreated repository metadata
PostAdd CMIS Repositoryhttps://host:port/tribefire-agiledocs-cartridge/addrepository/documentumNonesessionId, repositoryName, repositoryDescription, authMethod, bindingType, repositoryUrl, repositoryId, rootFolderId, repositoryCacheFolderPath, cacheDbConnectionType, cacheDbUsername, cacheDbPassword, cacheDbHost, cacheDbPort, cacheDbName, cacheDbService, cacheDbVersion, actionCreated repository metadata

Parameters

ParameterData typeDescription
sessionIdstringsession ID returned after authentication
repositoryNamestringName of the repository getting created
repositoryDescriptionstringDescription of the repository getting created
repositoryRootFolderNamestringName of the root folder created in the repository
repositoryResourceFolderPathstringPath to the actual folder on your file system in which respository resources will be kept.
repositoryCacheFolderPathstringPath to the actual folder on your file system in which cached respository resources will be kept.
repositoryDbConnectionTypestringDatabase you wish to use for storing metadata about repository resources. You can chose between Oracle (oracleconn), MS SQL Server (mssqlconn) and MySQL (mysqlconn).
repositoryDbUsernamestringUsername for database storing repository resources metadata.
repositoryDbPasswordstringPassword for database storing repository resources metadata.
repositoryDbHoststringHost name of the database storing repository resources metadata.
repositoryDbPortstringPort of the database storing repository resources metadata.
repositoryDbNamestringName of the database storing repository resources metadata.
repositoryDbServicestringService name of the database storing repository resources metadata.
repositoryDbVersionstringType 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.
cacheDbConnectionTypestringDatabase used for storing metadata about repository resources cache. You can choose between Oracle (oracleconn), MS SQL Server (mssqlconn) and MySQL (mysqlconn).
cacheDbUsernamestringUsername for database storing repository resources cache metadata.
cacheDbPasswordstringPassword for database storing repository resources cache metadata.
cacheDbHoststringHost name of the database storing repository resources cache metadata.
cacheDbPortstringPort of the database storing repository resources cache metadata.
cacheDbNamestringName of the database storing repository resources cache metadata.
cacheDbServicestringService name of the database storing repository resources cache metadata.
cacheDbVersionstringType 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.
actionstringadd-tf for adding standard ADx 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTCreate folderhttps://host:port/tribefire-services/rest/assembly-manipulateaccessId, sessionId, projectionbodyCreated folder JSON data structure

Parameters

ParameterData typeDescription
projectionstringEnter entity as the value
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
bodystringData 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTUpdate entry as defined in body (see Body Templates)https://host:port/tribefire-services/rest/assembly-manipulateaccessId, sessionIdbody, projectionUpdated entry JSON structure

Parameters

ParameterData typeDescription
projectionstringEnter entity as the value
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
bodystringData 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 ADx 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 typeService descriptionEndpointRequest query parametersForm dataReturns
GETInsert a taghttps://host:port/tribefire-services/rest/set-insertaccessId, sessionId, Id, type, property, valueNonenull
GETRemove a taghttps://host:port/tribefire-services/rest/set-removeaccessId, sessionId, Id, type, property, valueNonenull

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
IdstringId of a document or folder
typestringType signature of repository entry. Value is fixed to com.braintribe.model.resourcerepository.RepositoryEntry.
propertystringThis value (fixed to tags) tells the system that we want to apply tags.
valuestringActual 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTMerge documentshttps://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/mergeNoneaccessId, sessionId, entryId1, entryId2, actionOutput file stream
POSTApply watermarkhttps://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/watermarkNoneaccessId, sessionId, entryId1, action, watermarkTextOutput file stream
POSTExtract texthttps://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/textextractNoneaccessId, sessionId, entryId1 actionOutput file stream
POSTSplithttps://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/splitNoneaccessId, sessionId, entryId1, entryId2, action, splitStartPage, splitEndPage, splitPagesPerFileOutput file stream
POSTConvert to PDFhttps://host:port/tribefire-services/tribefire-agiledocs-cartridge/pdfutils/pdfconvertNoneaccessId, sessionId, entryId1, entryId2, actionOutput file stream

POST

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
entryId1(2,3,...,n)stringEntry ID (in this case content ID). You can enter multiple Entry IDs when merging documents, all other requests only take entryId1.
actionstringEnter one of the following values, corresponding to your request: merge, watermark, extractText, split, pdf
watermarkTextstringParameter defining the watermark text.
splitStartPagestringPage number where splitting should start.
splitEndPagestringPage number where splitting should end.
splitPagesPerFilestringPage 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 ADx 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 typeService descriptionEndpointRequest query parametersForm dataReturns
GETQuerying by statement (see Statements)https://host:port/tribefire-services/rest/queryaccessId, sessionId, statement (from+com.braintribe.model.agiledocs.repository.Repository), depthnoneItems matching your statement

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
statementstringYour URL-encoded query statement consisting of from+type.signature and a WHERE clause.
depthstringDefines how "deep" the query should go in a folder structure. depth=1 means the current directory only, depth=2 includes sub-folders, etc.

Statements

PurposeStatement
List all repositoriesfrom+com.braintribe.model.agiledocs.repository.Repository
List all contents of a folderfrom com.braintribe.model.resourcerepository.Content where parent="FolderID"
Find content by IDfrom com.braintribe.model.resourcerepository.Content where id="DocumentID"
Get Subfoldersfrom com.braintribe.model.resourcerepository.Content where parent="FolderID"
Get Entity by Tag - ADx repositories only, external repositories are not supportedfrom com.braintribe.model.resourcerepository.RepositoryEntry where "TagName" in tags
Get Request statusfrom com.braintribe.model.agiledocs.asyncrequest.AsyncRequestTracking where requestId = "RequestId"
Get Templates by IDfrom 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTSearch fileshttps://host:port/tribefire-services/rest/assembly-queryaccessId, sessionId, depth, bodyNoneList 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 ADx 2.x they are treated as any other content.

Endpoints

Request typeService descriptionEndpointRequest query parametersForm dataReturns
POSTUpload template (must be in Velocity Engine format)https://host:port/tribefire-agiledocs-cartridge/templuploadnonesessionId, contentAn error - template upload should be done via /docupload.
POSTMerge PDFs from templatehttps://host:port/tribefire-agiledocs-cartridge/mergepdfnonesessionId, accessId, mergeDataCreated content metadata.
POSTMerge PDFs from toxicology templatehttps://host:port/tribefire-agiledocs-cartridge/toxmergepdfnonesessionId, accessId, mergeDataCreated content metadata.

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
mergeDatastringJSON 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTGenerate digital keyhttps://host:port/tribefire-agiledocs-cartridge/genkeynonesessionId, action (iskeyset or genkeypair)iskeyset: true or false, genkeypair: generated key
POSTSign content or verify signaturehttps://host:port/tribefire-agiledocs-cartridge/digsignnonesessionId, accessId, documentId, privateKey, action (sign-tf or verify-tf)Verification: true or false

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
documentIdstringDocument ID identifying the document to be signed.
privateKeystringKey with which you're signing the document.
actionstringFor 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTTransform a filehttps://host:port/tribefire-agiledocs-cartridge/transformnonesessionId, accessId, documentId, preview, download, downloadNameDepending on preview, either a thumbnail image, a PDF, or a WebReader link is returned.

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
documentIdstringDocument ID identifying the document to be signed.
previewstringthumbnail, pdf or webreader, depending on the output you want
downloadstringtrue to download rendered file, false to open it in a browser
downloadNamestringName 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 typeService descriptionEndpointRequest query parametersForm dataReturns
POSTRun deep health checkhttps://host:port/deep-healthcheck-cartridge/deephealthcheckactionsessionId, accessId (not needed for allhealthcheck action)Repository status

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned by authentication request
accessIdstringAccess ID, typically used to identify a repository (syntax: access.adx.content.repositoryname)
actionstringeither healthcheck for checking a single repository or allhealthcheck for checking all repositories. allhealthcheck request does not require accessId.