ECMS - Integration Server Web Services Examples
This document explains shows examples for using Perceptive Content Integration Server for using RESTful web services calls to manipulate Imaging System documents.
Integration Server
Follows is a process for using Perceptive Content Integration Service to find Document IDs to allow manipulation of the document (view, modify IndexKeys, etc.). It does not show doing such modifications, just the sequence of SOAP/REST/Web services calls to get a document's DocID.
Integration Server provides NO mechanism that exposes Workflow Queue contents. One must create a view that exposes a workflow queue, then use that view to find documents in the queue. Thus a View is required for use of Integration Server. The Imaging Team, or a lcoal contact with Department Leas privileges can manage view using the Management Console. A View in this context is similar to a database view - a saved query that return filtered data (see the item below that explains the "A_GRAD_Warrants_DocID_Only" view).
Testing below done using "Advanced REST Client" in Google Chrome browser. The GET line is the web service string sent to Integration Server. The XML data is the returned response to the IS query.
NOTE: This documentation includes data from REAL Imaging System documents; please be mindful about this and act wisely and with appropriate precautions.
Workflow - A_GRAD workflow; used for this testing/documentation
- Queues - #s indicate workflow squence, are not part of the Queue Name
- 00 GRAD_Warrant approved Error
- 00 zNAK GradTesting
- 01a GRAD MastersWarrant
- 01b GRAD PhDFinalWarrant
- 021 GRAD MastersWarrant wTranscr
- 02b GRAD PhDFinalWarrant wTranscr
- 03a GRAD PhDPrelimWarrant
- 03b GRAD PhDPrelimWarrant wTranscr
- 04a GRAD ProfessionalWarrant
- 04b GRAD ProfessionalWarrant wTranscr
- 05a GRAD_Warrant approved, A_GS_EFORM_XML_extract.js, script routes to GRAD_Warrant approved FLAT
- 05b GRAD WarrantDenied, Grad_EWarrant_Email_DENIED.js, GRAD-Ewarrant denied status cust prop.js
- 06 GRAD_Warrant approved FLAT, automated system convert queue
- 07a GRAD wrnt aprvd cust prop, in/b: GRAD-Ewarrant aprvd status cust prop.js, w/in: GRAD route to wrnt aprvd: em req
- 07b GRAD warrant flat fail
- 08 GRAD wrnt apvd: em req/drw chg, in/b: GRAD_EWarrants_Drawer change.js, w/in: A_GRAD_ewarrant_email_requestor.js
- 09 GRAD wrnt apvd: ARCHIVE
- Queues - #s indicate workflow squence, are not part of the Queue Name
Production View against queue "Grad_Warrant approved" - A_GRAD_Warrants_DocID_Only
- view/321Z165_01V8SGTN00002JR
- Three columns:
- Workflow Queue
- Type
- DocumentID
- Query is: Drawer is equal to "GRAD_Warrant approved" AND Created within is equal to 180 [days]
Docs are currently in "GRAD wrnt apvd: ARCHIVE"
Testing view against queue "zNAKGrad_Testing" - A_GRAD_Warrants_DocID_Test_ZNAKQueue
- view/321Z19F_01WDG1V1C00003H
Using these credentials; the developer will need to use UID/PWD provided by the Imaging Team which include proper security to scope access to Imaging System data and files
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n
Test connection
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/connection/
Returns
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <connectionStatus> <version>7.2.2.295</version> </connectionStatus>
Get view IDs
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/view/
Returns LONG XML of Views, but it has the View we want for TEST/PROD. Have to match/parse/search
<name>_value_</name>
against the desired view to get<id>_value_</id>
of same; XML data manipulation tools could come in handy here, or a brute search for<name>A_GRAD_Warrants_DocID_Only</name>
to then get the<id>
immediately above the<name>
:<id>321Z165_01V8SGTN00002JR</id>
PROD
<view> <id>321Z165_01V8SGTN00002JR</id> <name>A_GRAD_Warrants_DocID_Only</name> <description>View to show DocID for eWarrants for Integration Server webservices use</description> <category>DOCUMENT</category> <classifier>NONE</classifier> <hasFilters>false</hasFilters> </view>
TEST - This is the view for testing work in TEST against the zNAKGrad Testing queue:
<id>321Z19F_01WDG1V1C00003H</id>
<view> <id>321Z19F_01WDG1V1C00003H</id> <name>A_GRAD_Warrants_DocID_Test_ZNAKQueue</name> <description>View to show DocID for eWarrants for Integration Server webservices use</description> <category>DOCUMENT</category> <classifier>NONE</classifier> <hasFilters>false</hasFilters> </view>
Get View Configuration data to confirm that the column with the needed value is exposed, in this case, DocumentID
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/view/321Z165_01V8SGTN00002JR?category=DOCUMENT
Returns a LONG XML of all configurations for the view
PROD
<view> <id>321Z165_01V8SGTN00002JR</id> <name>A_GRAD_Warrants_DocID_Only</name> <description>View to show DocID for eWarrants for Integration Server webservices use</description> <category>DOCUMENT</category> <autoRun>true</autoRun> <classifier>NONE</classifier> <searchPrompts /> <filters /> <columns> [With LOTS of values before the end of the XML data; none of which match the three columns of the actual View] </columns> </view>
The columns appear to be:
<column> <columnId>20</columnId> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Workflow Queue</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </column> <column> <columnId>6</columnId> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Type</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </column> <column> <columnId>8</columnId> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Document ID</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </column>
There is no apparent method for determining position in the XML data. So, use XML data parsing magic or search for
<name>_value_</name>
to find the<columnId>_value_</columnId>
(the XML has the<columnID>
and<name>
several rows apart)In this case the three values are:
- Workflow Queue = ID 20
- Type = ID 6
- Document ID = ID 8
Here is the same for the TEST testing View against the ZNAKGrad_Testing queue
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/view/321Z19F_01WDG1V1C00003H?category=DOCUMENT <column> <columnId>20</columnId> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Workflow Queue</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </column> <column> <columnId>6</columnId> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Type</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </column> <column> <columnId>8</columnId> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Document ID</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </column>
Same IDs
- Workflow Queue = ID 20
- Type = ID 6
- Document ID = ID 8
Get IDs of documents shown by the View, reference the
<name>Document ID</name>
from the last step for the<id>_value_</id>
that goes into the Request Body.Request Body format provided by Karen Lynch (Lexmark) to the Raw payload section. Request Body:
<viewParameters> <columnSelectors> <columnSelector> <id>8</id> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> </columnSelector> </columnSelectors> </viewParameters>
NOTE:
?category=DOCUMENT
is required (even though the documentation says it is optional)Content-Type: application/xml Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n POST https://test.imaging.wisc.edu/integrationserver/v2/view/321Z165_01V8SGTN00002JR/result?category=DOCUMENT
If NO docs, result is:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <viewResults> <resultColumns> <resultColumn> <id>8</id> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Document ID</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </resultColumn> </resultColumns> <resultRows /> <hasMore>false</hasMore> </viewResults>
With a doc in the queue, call returns
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <viewResults> <resultColumns> <resultColumn> <id>8</id> <dataType>STRING</dataType> <displayType>VISIBLE</displayType> <name>Document ID</name> <sortOrder>0</sortOrder> <sortDirection>ASCENDING</sortDirection> <groupOrder>0</groupOrder> <width>20.0</width> </resultColumn> </resultColumns> <resultRows> <resultRow> <fields> <field> <columnId>8</columnId> <value>321Z16W_01VHK26G1001FKT</value> </field> </fields> </resultRow> </resultRows> <hasMore>false</hasMore> </viewResults>
The
<value>_value_</value>
is the Document ID!!
Get Document data using DocID
- Can use this step to get
<documentType>_value></documentType>
.<documentType>
is also the eForm name for eForms. It could be used in a subsequent step for creating the URL to the eForm XML data. The XML data shows:The primary IndexKeys in the
<key>
sectionAny workflow data associated with the document if it is in workflow in the
<workflow>
sectionInformation related to the physical document in the
<pages>
sectionCustom property ID, Type, and value
Content-Type: text/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/document/321Z16W_01VHK26G1001FKT <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <document> <info> <id>321Z16W_01VHK26G1001FKT</id> <name>321Z16W_01VHK26G1001FKT</name> <keys> <drawer>A_GRAD_EWarrants</drawer> <field1>0004445371</field1> <field2>West,Elena</field2> <field3>doucetbeer@wisc.edu</field3> <field4>kpelland@wisc.edu</field4> <field5>321Z16W_01VHK86G1000L3J</field5> <documentType>A_GRAD_PhDFinalWarrant</documentType> </keys> <version>1</version> <locationId>301YWDJ_00YZ6TZ6H0008J6</locationId> </info> <workflowItems> <workflowItem> <id>321Z16W_01VHK26G1001FKZ</id> </workflowItem> </workflowItems> <pages> <page> <id>321Z17D_01VM8S2DC000QW7</id> <name>321Z16W_01VHK26G1001FKT.xml.new.xml.tiff</name> <extension>tiff</extension> <pageNumber>1</pageNumber> </page> </pages> <properties> <property> <id>301YX3D_00ZY9YW54000VCH</id> <type>STRING</type> <value>PHD</value> </property> <property> <id>301YX2E_00ZMZPXZZ001S8E</id> <type>STRING</type> <value>Zoology - G995</value> </property> ... </document>
- Can use this step to get
Using Integration Server to get eForm ID. Using the GradSchool eWarrant eForms, would require FOUR passes for each of the four eWarrant eForms in use.
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/form
Returns data for ALL eForms (not just the GradSchool eForms). Do match magic for a specific eForms:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <forms> <form> <id>301YWDN_00YZMSXPZ001CPG</id> <name>A_GRAD_MastersWarrant/name> <description /> <active>true</active> </form>
There are four for Grad eWarrants, for example:
<form> <id>301YWDN_00YZMSXPZ001CPG</id> <name>A_GRAD_MastersWarrant</name> <description /> <active>true</active> </form> <form> <id>301YWDN_00YZMXXPZ001D0Q</id> <name>A_GRAD_PhDFinalWarrant</name> <description /> <active>true</active> </form> <form> <id>301YWDN_00YZN4XQ0001DEV</id> <name>A_GRAD_PhDPrelimWarrant</name> <description /> <active>true</active> </form> <form> <id>301YWDN_00YZMVXPZ001CMN</id> <name>A_GRAD_ProfessionalWarrant</name> <description /> <active>true</active> </form>
IDs are
A_GRAD_MastersWarrant: 301YWDN_00YZMSXPZ001CPG A_GRAD_PhDFinalWarrant: 301YWDN_00YZMXXPZ001D0Q A_GRAD_PhDPrelimWarrant: 301YWDN_00YZN4XQ0001DEV A_GRAD_ProfessionalWarrant: 301YWDN_00YZMVXPZ001CMN
For this testing, there was a current document in zNAKGRAD_Testing queue which was an A_GRAD_PhDFinalWarrant eForm. If more than one type of warrant is placed in the testing queue, then the next step must be done multiple times, matching eForm ID with DocID.
<documentType>_value_</documentType>
can be used to match<name>_value></name>
is this step to eliminate unnecessary steps.Get document form XML data using form ID and Document ID. NOTE:
?version=1
is required. Using:FormID: 301YWDN_00YZMSXPZ001CPG (one of four)
DocID: 321Z16W_01VHK26G1001FKT
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/form/301YWDN_00YZMVXPZ001CMN/document/321Z16W_01VHK26G1001FKT?version=1
If no form (are matching one of four form IDs with DocIDs) returns
500 Internal Server Error The response was empty Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/form/301YWDN_00YZMVXPZ001CMN/document/321Z16W_01VHK26G1001FKT?version=1
If eForm ID and DocID do not match (there is no DocID for the eForm ID) returns
404 Not Found The document form data was not found. Doc ID: 321Z16W_01VHK26G1001FKW, Version: 1, Form ID: 301YWDN_00YZMVXPZ001CMN
This example returns a legit eForm document
Content-Type: test/plain Authorization: Basic anN0YWxuYWtAd2lzYy5lZHU6aWZ5b3U2M1RUT3RoaW5raW5n GET https://test.imaging.wisc.edu/integrationserver/v1/form/301YWDN_00YZMXXPZ001D0Q/document/321Z16W_01VHK26G1001FKT?version=1
Note this is for testing only, one form was routed to the zNAKGrad_Testing queue.
Returns 200 OK
The ARC client RAW tab shows the XML data that could then be manipulated (this data is truncated below as the GradSchool eForms are quite extensive)
<?xml version="1.0" encoding="UTF-8"?> <form> <FNAME>Elena</FNAME> <CAMPUS_ID>9058191637</CAMPUS_ID> <LNAME>West</LNAME>< EMPLID>0004445371</EMPLID> <EM_ADDR>doucetbeer@wisc.edu</EM_ADDR> <NAME>West,Elena</NAME> <RequestedByName>Kayla Pelland</RequestedByName> <RequestedByEmail>kpelland@wisc.edu</RequestedByEmail> <RequestDateMonth>06</RequestDateMonth> <RequestDateDate>28</RequestDateDate> <RequestDateYear>2017</RequestDateYear> <ACAD_PROG_PRIMARY infd_id="301YX2E_00ZMZPXZZ001S8E" infd_name="A_GRAD_Award_acad_prog" infd_path="301YX2E_00ZMZPXZZ001S8E" infd_required="false" infd_sync_cp="to" infd_type="prop" infd_use_format="true">Zoology - G995</ACAD_PROG_PRIMARY> <SUBPLAN></SUBPLAN> <PlanTypeP infd_id="301YX3D_00ZY9YW54000VCH" infd_name="A_GRAD_Award_acad_plan" infd_path="301YX3D_00ZY9YW54000VCH" infd_required="false" infd_sync_cp="to" infd_type="prop" infd_use_format="true">PHD</PlanTypeP> <MINOR>GMIN254 - Distributed</MINOR> <Term infd_id="301YX2E_00ZMZMXZZ001RRE" infd_name="A_GRAD_Award_term" infd_path="301YX2E_00ZMZMXZZ001RRE" infd_required="false" infd_sync_cp="to" infd_type="prop" infd_use_format="true">Summer 2017</Term>< EXAMDATEmonth>07</EXAMDATEmonth> <EXAMDATEdate>25</EXAMDATEdate> <EXAMDATEyear>2017</EXAMDATEyear> <ThesisTitle infd_id="301YX2S_00ZSDBEG6000B9E" infd_name="A_GRAD_ThesisTitle" infd_path="301YX2S_00ZSDBEG6000B9E" infd_required="false" infd_sync_cp="to" infd_type="prop" infd_use_format="true">Foraging ecology and habitat use of Steller’s Jays in human-influenced landscapes</ThesisTitle> ... </form>