Rest API Resources
This guide describes the document indexing, storage, and retrieval functions available in the GlobalSearch API.
Basics
The REST API offers a rich set of tools for performing all major create, read, update, delete, and search operations within the system. The Square 9 API’s default web path is http://localhost/square9api/api, where localhost represents the DNS name or IP address of your GlobalSearch server.
Square 9’s REST implementation is simple and offers a language agnostic approach to enabling document management functionality into your existing applications. You can program with your language of choice (Python, PHP, VB, C#, JavaScript, etc.), and most functionality is implemented as HTTP GET requests. Many of the calls can be tested by typing the request directly into your browser’s address bar. In you are unfamiliar with calling into a RESTful API, Google “Using a REST API” to gain some insight on the basics using your language of choice.
All connections to the website must first be authenticated with a valid Windows user account. Once authenticated, any call can be made. Functionality available is categorized and described below. Note that some calls may require data returned from another call. All calls with the exception of getting a database list require a license token, which is returned by making a call to the Get License method. As the name implies, Get License consumes a GlobalSearch license. Remember to release licenses you consume using the Delete License call.
Example code may be found in Square 9’s GitHub here.
Authentication and Licensing
GlobalSearch Web Services are authenticated with Windows Authentication. User accounts are created and managed as they are in all other scenarios. User’s must be authorized in the system and granted a license in order to log in. Refer to the GlobalSearch Configuration Guide for details on creating user accounts, assigning licenses, and granting access to database.
Get License: Attempts to get a license token for the current user
Delete License: Remove a specified license token
Database Access
Each database in GlobalSearch has an ID and is self-contained. Access to all documents begins with targeting the correct database.
Get Database List: Get a list of databases for the currently authenticated user.
Get Root Archive List: Gets a list of top-level archives from the specified database.
Get Child Archives List: Get a list of child-archives of the specified archive.
Searching
Access to documents is modeled around searching. In general, in order to access a specific document, an application would want to get the information about a search, run that search, and retrieve a document in the result.
Get Archive Searches: Gets a list of searches from an archive
Get Archive Search: Gets information about a single search
Run Search: Returns results from a search
Get Archive Fields: Returns Fields for Archive
Document Actions
GlobalSearch’s API has the ability to Import and Export documents, as well as modify the field data associated with a document already in a database, manually or via a Document Workflow.
Get Document: Retrieve a document file or meta-data
Get Workflows: Gets all possible workflows on an archive.
Run Workflow: Execute a Workflow
Update Index Data: Make a change to a field value
Import Document: Imports a new document into a database
Upload File to Server: Puts document in “WebPortalCache”
Export Document: Exports a document out of a database
Delete Document: Deletes the Specified Document
Transfer Document: Moves or Copies Document
Get Document Revision: Returns document revisions
Run DataXChange: Check an external source for matching data.
Get GlobalAction Queue Actions: Get a list of GlobalAction Queue Actions for a document
Fire GlobalAction Queue Action: Fire a GlobalAction Queue Action on a document
Get Document Secure ID: Get the Secure ID without running a search
Miscellaneous
Various utility methods.
Get Username: Get the currently logged in username
Get List: Get the contents of a pick-list
Get DataXChange Sources: Get a list of configured DataXChange sources.
Administration
Square 9’s Rest API now supports preforming certain administrative tasks relating to archives, fields, and lists.
Get Secured Users and Groups: Get users and groups secured to any database
Get Unsecured Users and Groups: Get users and groups not secured to a database
Get Tree Structure: Get tree structure of all databases, archives and searches
Get Archive User Permissions: Get user archive permissions on a specified archive
Get Search Properties: Get search options for all searches for the user in a database.
Add Archive Security: Add users and groups to archive security for one or more archives
Add Database Security: Add users and groups to database security for one or more databases
Add Search Security: Add search security for given users
Add Search Settings: Add search settings for users and groups in an archive
Add user: Create a new Square 9 user
Delete User: Permanently delete a Square 9 user
Update User: Update a Square 9 user password
Inboxes
Inboxes act as a holding folder for documents that have not been indexed yet. There is one set of inboxes no matter how many databases a GlobalSearch install has.
Get Inboxes: Return Inbox metadata.
Import Document to an Inbox: Adds a document to an inbox.
Chunking Upload
As of version 4.0.1.0 there are multiple ways to upload files to the server. This section details how to upload files for Archives, either in whole or in part using chunks of a file.
Create Archive Job: Initialize upload job to index a file into an archive.
Create Inbox Job: Initialize upload job to save a file to an inbox.
Upload File Chunk: Send part of a file.
Finalize Upload: File upload job complete.
Import Actions
Various calls for getting and creating capture workflows.
Get Capture Workflows List: Retrieve a list of available import scans capture workflows
API Call:
GET /licenses?format={json|xml}
Description
Attempts to get a license for the user. If successful, response is returned with the user’s username, domain, authentication server, type of permissions, ip address, date created, date accessed, and token which is required by most calls to the API.
Parameters:
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
{ "Username": "SSAdministrator", "Domain": "YourDomain", "AuthServer": "YourDomain", "Type": 1, "IPAddress": "192.168.56.1", "DateCreated": "2013-10-01T13:43:39.8855858-04:00", "DateAccessed": "2013-10-01T13:43:39.8855858-04:00", "Token": "96db469b-6427-43ab-a3eb-c736597b2e6a", "Reg": 2 }
XML:
<License xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <AuthServer>YourDomain</AuthServer> <DateAccessed>2013-10-01T17:04:24.8738202-04:00</DateAccessed> <DateCreated>2013-10-01T17:04:24.8738202-04:00</DateCreated> <Domain>YourDomain</Domain> <IPAddress>192.168.56.1</IPAddress> <Reg>2</Reg> <Token>a2f7a47b-c92e-481d-b338-4a09fe9ad326</Token> <Type>1</Type> <Username>SSAdministrator</Username> </License>
API Call:
GET /licenses/{token}
Description
Removes the license token which is specified by the “token” parameter.
Returns
Nothing.
API Call:
GET /dbs/{id}?format={json|xml}
Description
Retrieves one or more databases a user has permissions to in a Databases array. Note that this function does not consume a license.
Parameters:
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
id Optional:
Integer representing the database ID of a particular database. Specifying an ID will return only the database detail for the specific database in question. Providing an invalid database id will return an empty database array.
Returns
{ "Databases": [ { "Id": 1, "Name": "GetSmart" }, { "Id": 6, "Name": "QuickBooks" }, { "Id": 16, "Name": "Demo" }, { "Id": 17, "Name": "Clean" } ] }
XML:
<DatabaseList> <Databases> <Database> <Id>1</Id> <Name>GetSmart</Name> </Database> <Database> <Id>6</Id> <Name>QuickBooks</Name> </Database> <Database> <Id>16</Id> <Name>Demo</Name> </Database> <Database> <Id>17</Id> <Name>Clean</Name> </Database> </Databases> </DatabaseList>
API Call:
GET /dbs/{Database}/archives?token={token}&format={json|xml}
Description
This call gets a list all the top-level archives (Children of the base root ‘Archives’) for the specified database ID.
Parameters:
Database:
ID of the Database where the archives were created.
token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License”.
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
{ "Archives": [ { "Id": 1, "Name": "Accounts Payable", "Parent": 0, "Permissions": 1, "Properties": 2 } ] }
XML:
<ArchiveList xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Archives> <Archive> <Id>1</Id> <Name>Accounts Payable</Name> <Parent>0</Parent> <Permissions>1</Permissions> <Properties>2</Properties> </Archive> </Archives> </ArchiveList>
API Call:
GET /dbs/{DatabaseID}/archives/{ArchiveID}?format={json|xml}&token={token}
Description
Some archives can have child-archives below them in an archive tree. This call retrieves a list of those archives given a database ID and an archive ID.
Parameters:
ArchiveID:
ID of the parent archive that contains the children archives (Passing “0” here gets you the top level).
DatabaseID:
ID of the Database where the archives were created.
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
token Optional:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License”.
Returns
{ "Archives": [ { "Id": 1, "Name": "Accounts Payable", "Parent": 0, "Permissions": 1, "Properties": 2 } ] }
XML:
<ArchiveList xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Archives> <Archive> <Id>1</Id> <Name>Accounts Payable</Name> <Parent>0</Parent> <Permissions>1</Permissions> <Properties>2</Properties> </Archive> </Archives> </ArchiveList>
API Call:
GET /dbs/{Database}/archives/{ArchiveId}/searches?Token={token}&format={json|xml}
Description
Returns an array of searches, including the search name, archives and conditions.
Parameters:
ArchiveId:
ID of archive which to retrieve searches
Database:
ID of database from which to retrieve searches.
Token:
A valid token must be passed in the url. A token is retrieved by making a call to “Get License.”
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
[ { "Archives": [ { "ID": 1007, "Name": "Customer Contracts" }, { "ID": 1008, "Name": "Vendor Contracts" }, { "ID": 1005, "Name": "Legal" } ], "Id": 1006, "Parent": 1005, "Name": "Browse Legal", "Hash": "ae347873c4fab0f494611ebc754fe7d00e491f6fd384cfb36948365204bfb854", "Detail": [ { "ID": 3145, "FID": 16, "ListID": 0, "Parent": 0, "Operator": 2, "Prompt": "Description:", "VAL": "", "Prop": 0 }, { "ID": 3146, "FID": 1031, "ListID": 3, "Parent": 0, "Operator": 1, "Prompt": "Contract Status:", "VAL": "", "Prop": 64 } ], "Props": 1, "Fuzzy": 0, "Grouping": "", "Settings": 1 } ]
XML:
<ArrayOfSearch xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Search> <Archives> <SearchArchive> <ID>2</ID> <Name>Purchase Orders</Name> </SearchArchive> </Archives> <Detail> <SearchDetail> <FID>1</FID> <ID>5145</ID> <ListID>0</ListID> <Operator>2</Operator> <Parent>0</Parent> <Prompt>Vendor Name:</Prompt> <Prop>0</Prop> <VAL/> </SearchDetail> <SearchDetail> <FID>2</FID> <ID>5146</ID> <ListID>0</ListID> <Operator>1</Operator> <Parent>0</Parent> <Prompt>PO Number:</Prompt> <Prop>0</Prop> <VAL/> </SearchDetail> <SearchDetail> <FID>5</FID> <ID>5147</ID> <ListID>4</ListID> <Operator>1</Operator> <Parent>0</Parent> <Prompt>Cost Center:</Prompt> <Prop>64</Prop> <VAL/> </SearchDetail> <SearchDetail> <FID>11</FID> <ID>5148</ID> <ListID>1</ListID> <Operator>1</Operator> <Parent>0</Parent> <Prompt>Approval Status:</Prompt> <Prop>64</Prop> <VAL/> </SearchDetail> </Detail> <Fuzzy>0</Fuzzy> <Grouping/> <Hash>e6ae9f85b090cc06d60d3d4a1b724c92e63ad0cf8414c0ca2e9eaedb0146fb12</Hash> <Id>1</Id> <Name>Browse Accounts Payable</Name> <Parent>1</Parent> <Props>0</Props> <Settings>1</Settings> </Search> <Search> <Archives> <SearchArchive> <ID>2</ID> <Name>Purchase Orders</Name> </SearchArchive> </Archives> <Detail> <SearchDetail> <FID>2</FID> <ID>5149</ID> <ListID>0</ListID> <Operator>1</Operator> <Parent>0</Parent> <Prompt>PO Number:</Prompt> <Prop>0</Prop> <VAL/> </SearchDetail> </Detail> <Fuzzy>0</Fuzzy> <Grouping/> <Hash>76d98c7d7b8d58f14edc9c662377a10a03dad2b30530b7aced9d7cbca921ee3e</Hash> <Id>2032</Id> <Name>Three Way Match</Name> <Parent>1</Parent> <Props>8</Props> <Settings>0</Settings> </Search> </ArrayOfSearch>
API Call:
GET /dbs/{Database}/searches/{Id}?token={token}&format={json|xml}
Description
Returns information about a single search
Parameters:
Database:
ID of database.
Id:
Id of search.
token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
[ { "Archives": [ { "ID": 2, "Name": "Purchase Orders" } ], "Id": 1, "Parent": 1, "Name": "Browse Accounts Payable", "Hash": "2c689722482f7254a4ece2345eedff6aafe7a30fb81882204bd9a09d55863369", "Detail": [ { "ID": 5145, "FID": 1, "ListID": 0, "Parent": 0, "Operator": 2, "Prompt": "Vendor Name:", "VAL": "", "Prop": 0 }, { "ID": 5146, "FID": 2, "ListID": 0, "Parent": 0, "Operator": 1, "Prompt": "PO Number:", "VAL": "", "Prop": 0 }, { "ID": 5147, "FID": 5, "ListID": 4, "Parent": 0, "Operator": 1, "Prompt": "Cost Center:", "VAL": "", "Prop": 64 }, { "ID": 5148, "FID": 11, "ListID": 1, "Parent": 0, "Operator": 1, "Prompt": "Approval Status:", "VAL": "", "Prop": 64 } ], "Props": 0, "Fuzzy": 0, "Grouping": "", "Settings": 1 } ]
XML:
<ArrayOfSearch xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Search> <Archives> <SearchArchive> <ID>2</ID> <Name>Purchase Orders</Name> </SearchArchive> </Archives> <Detail> <SearchDetail> <FID>2</FID> <ID>5149</ID> <ListID>0</ListID> <Operator>1</Operator> <Parent>0</Parent> <Prompt>PO Number:</Prompt> <Prop>0</Prop> <VAL/> </SearchDetail> </Detail> <Fuzzy>0</Fuzzy> <Grouping/> <Hash>76d98c7d7b8d58f14edc9c662377a10a03dad2b30530b7aced9d7cbca921ee3e</Hash> <Id>2032</Id> <Name>Three Way Match</Name> <Parent>1</Parent> <Props>8</Props> <Settings>0</Settings> </Search> </ArrayOfSearch>
API Call:
GET /dbs/{Database}/searches/{Search}/archive/{Archive}/documents?page={page}&RecordsPerPage={rows}&SearchCriteria={criteria}&SecureId={sid}&count={true|false}&token={token}&format={json|xml}
Description
Returns results from a single search. Note that searches will only ever return a single row of table data for archives that have table fields. If you need all rows of table data bound to a document, refer to the Get Document function in the Document Actions section.
Parameters:
page:
Denotes the specific page or results which is desired. If not specified, the default value is 1.
SecureId:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Archive Searches.” Every search returned by the call will be returned with a “Hash.” This hash is to be used as the Secure Id.
token:
A valid token must be passed in the url. A token is retrieved by making a call to “Get License.”
count Optional:
If “true”, only return a count of how many documents were found.
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
RecordsPerPage Optional:
Denotes how many records should be returned per page. If not specified, the default value is 50.
SearchCriteria Optional:
Denotes what value will be searched on. If not specified, the value is an empty string. This parameter is specified as a JSON string in the format {ID:”Value”, ID:”Value”}, where ID represents the search prompt ID for the field you are searching and Value represents the value you wish to pass into the prompt.
Returns
{ "Fields": [ { "ID": 1, "Name": "Vendor Name", "List": 0, "Type": 1, "Mask": "", "Size": 50, "RegEx": "", "Prop": 0, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 2, "Name": "PO Number", "List": 0, "Type": 1, "Mask": "", "Size": 50, "RegEx": "", "Prop": 0, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 3, "Name": "PO Amount", "List": 0, "Type": 4, "Mask": "$###,###.##", "Size": 50, "RegEx": "", "Prop": 0, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 4, "Name": "PO Date", "List": 0, "Type": 3, "Mask": "MM/dd/yyyy", "Size": 50, "RegEx": "", "Prop": 0, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 5, "Name": "Cost Center", "List": 4, "Type": 1, "Mask": "", "Size": 50, "RegEx": "", "Prop": 64, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 20, "Name": "Requisitioner", "List": 0, "Type": 1, "Mask": "", "Size": 50, "RegEx": "", "Prop": 0, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 6, "Name": "Vendor Email", "List": 0, "Type": 1, "Mask": "", "Size": 50, "RegEx": "", "Prop": 0, "Parent": 0, "ListF1": 0, "ListF2": 0 } ], "Docs": [ { "Id": 7, "Hash": "c353caf3bf6ed600a07c97bbd73c0ab17c0b99cf2c6de112d472a7747bf74ed1", "TID": 1, "Fields": [ { "MVAL": [], "ID": 1, "VAL": "" }, { "MVAL": [], "ID": 2, "VAL": "" }, { "MVAL": [], "ID": 3, "VAL": "" }, { "MVAL": [], "ID": 4, "VAL": "" }, { "MVAL": [], "ID": 5, "VAL": "" }, { "MVAL": [], "ID": 20, "VAL": "" }, { "MVAL": [], "ID": 6, "VAL": "" } ], "Version": 0, "RootVersionID": 0, "User_Name": null, "Hits": 0, "Permissions": 262143, "RevisionOptions": 0, "FileType": ".pdf" } ], "Count": 1 }
XML:
<Result xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Count>1</Count> <Docs> <Doc> <Fields> <FieldItem> <ID>1</ID> <MVAL/> <VAL/> </FieldItem> <FieldItem> <ID>2</ID> <MVAL/> <VAL/> </FieldItem> <FieldItem> <ID>3</ID> <MVAL/> <VAL/> </FieldItem> <FieldItem> <ID>4</ID> <MVAL/> <VAL/> </FieldItem> <FieldItem> <ID>5</ID> <MVAL/> <VAL/> </FieldItem> <FieldItem> <ID>20</ID> <MVAL/> <VAL/> </FieldItem> <FieldItem> <ID>6</ID> <MVAL/> <VAL/> </FieldItem> </Fields> <FileType>.pdf</FileType> <Hash>c353caf3bf6ed600a07c97bbd73c0ab17c0b99cf2c6de112d472a7747bf74ed1</Hash> <Hits>0</Hits> <Id>7</Id> <Permissions>262143</Permissions> <RevisionOptions>0</RevisionOptions> <RootVersionID>0</RootVersionID> <TID>1</TID> <User_Name i:nil="true"/> <Version>0</Version> </Doc> </Docs> <Fields> <Field> <ID>1</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>Vendor Name</Name> <Parent>0</Parent> <Prop>0</Prop> <RegEx/> <Size>50</Size> <Type>1</Type> </Field> <Field> <ID>2</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>PO Number</Name> <Parent>0</Parent> <Prop>0</Prop> <RegEx/> <Size>50</Size> <Type>1</Type> </Field> <Field> <ID>3</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask>$###,###.##</Mask> <Name>PO Amount</Name> <Parent>0</Parent> <Prop>0</Prop> <RegEx/> <Size>50</Size> <Type>4</Type> </Field> <Field> <ID>4</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask>MM/dd/yyyy</Mask> <Name>PO Date</Name> <Parent>0</Parent> <Prop>0</Prop> <RegEx/> <Size>50</Size> <Type>3</Type> </Field> <Field> <ID>5</ID> <List>4</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>Cost Center</Name> <Parent>0</Parent> <Prop>64</Prop> <RegEx/> <Size>50</Size> <Type>1</Type> </Field> <Field> <ID>20</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>Requisitioner</Name> <Parent>0</Parent> <Prop>0</Prop> <RegEx/> <Size>50</Size> <Type>1</Type> </Field> <Field> <ID>6</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>Vendor Email</Name> <Parent>0</Parent> <Prop>0</Prop> <RegEx/> <Size>50</Size> <Type>1</Type> </Field> </Fields> <FolderOptions>None</FolderOptions> <Terms i:nil="true"/> </Result>
API Call:
GET /dbs/{Database}/archives/{ArchiveId}?Token={token}&format={json|xml}&type={fields}
Description
Provides the user with the fields for a single archive. The Archive ID can be originally obtained using the get archives call.
Fields have various properties associated with them which can be understood by interpreting the Prop value of a field in the returned data. Prop is bitwise value of the following:
Required – 2
System Field: Date Entered – 4
System Field: Indexed By – 8
System Field: Page Count – 16
Multi-Value Field – 32
Field contains Dropdown List – 64
Field contains Dynamic List – 128
System Field: Last modified By – 256
Table Field – 512
System Field: File Type – 1024
System Field: Read Only – 2048
Fields are always of a specific data type. Data type enforcement is important, so as a developer you should be aware of the data type for fields you are working with. The Type value in the return represents the data type, which can be one of the following:
Character – 1
Integer – 2
Date/Time – 3
Decimal – 4
Parameters:
ArchiveId:
ID of the selected Archive
Database:
ID of the selected Database
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
type:
There is currently only one type option for this call, fields.
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
<ArrayOfField xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Field> <ID>1</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>number1</Name> <Parent>0</Parent> <Prop>1024</Prop> <RegEx/> <Size>50</Size> <Type>1</Type> </Field> <Field> <ID>2</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>number2</Name> <Parent>0</Parent> <Prop>0</Prop> <RegEx/> <Size>50</Size> <Type>1</Type> </Field> <Field> <ID>3</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>Document Version</Name> <Parent>0</Parent> <Prop>4096</Prop> <RegEx/> <Size>50</Size> <Type>2</Type> </Field> <Field> <ID>4</ID> <List>0</List> <ListF1>0</ListF1> <ListF2>0</ListF2> <Mask/> <Name>Document Parent ID</Name> <Parent>0</Parent> <Prop>8192</Prop> <RegEx/> <Size>50</Size> <Type>2</Type> </Field> </ArrayOfField>
JSON:
[ { "ID": 1, "Name": "number1", "List": 0, "Type": 1, "Mask": "", "Size": 50, "RegEx": "", "Prop": 1024, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 2, "Name": "number2", "List": 0, "Type": 1, "Mask": "", "Size": 50, "RegEx": "", "Prop": 0, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 3, "Name": "Document Version", "List": 0, "Type": 2, "Mask": "", "Size": 50, "RegEx": "", "Prop": 4096, "Parent": 0, "ListF1": 0, "ListF2": 0 }, { "ID": 4, "Name": "Document Parent ID", "List": 0, "Type": 2, "Mask": "", "Size": 50, "RegEx": "", "Prop": 8192, "Parent": 0, "ListF1": 0, "ListF2": 0 } ]
API Call:
GET /dbs/{Database}/archives/{Archive}/documents/{Document}/{Type}?SecureId={sid}&token={token}
Description
Based on the database, archive and document specified, call returns a representation of the document. The data returned varies based on {Type} specified. Not specifying a type will return the JSON/XML document object for the record.
Note: This method is the only way to retrieve all rows of meta-data when using table fields on a document. For documents with multiple rows of table data, the Doc record will be returned multiple times for each distinct table row.
Parameters:
Archive:
ID of archive.
Database:
Id of database.
Document:
Id of document.
SecureId:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
token:
A valid token must be passed in the url. A token is retrieved by making a call to “Get License.”
Type:
"File": Returns the requested file "Email": Returns a ready-to-email version of the document "Print": Returns a ready-to-print version of the document "Thumb": Returns a thumbnail of the document "Zone": ---data missing---
Returns
The document, format depends on which “Type” is specified
API Call:
GET /dbs/{Database}/archives/{ArchiveId}/flows?document={document}&token={token}&SecureId={sid}&format={json|xml}
Description
Returns possible Workflow actions on a document. Each workflow item includes workflow ID, name of workflow, its description.
Parameters:
ArchiveId:
Id of archive.
Database:
Id of database.
document:
Specifies which document to execute the workflow on.
SecureId:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
[ { "Id": 21, "Name": "Approve", "Description": "Approves invoice and forwards to AP" }, { "Id": 22, "Name": "Decline", "Description": "Declines invoice and forwards to AP" }, { "Id": 23, "Name": "On Hold", "Description": "Changes status to On Hold and remains in queue" } ]
XML:
<ArrayOfWorkflow xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Workflow> <Description/> <Id>39</Id> <Name>Approve</Name> </Workflow> </ArrayOfWorkflow>
API Call:
GET /dbs/{Database}/archives/{ArchiveId}/flows?document={docid}&SecureId={sid}&format={json|xml}
Description
Executes a single document workflow.
Parameters:
ArchiveId:
Id of archive.
Database:
Id of database.
document:
Id of document that the workflow will be executed on.
SecureId:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
Nothing.
API Call:
POST /dbs/{DatabaseID}/archives/{ArchiveId}/documents/{DocID}/save?Token={Token}&SecureId={sid}&format={json|xml}
Description
Update the index values of a specified document.
Parameters:
[RAW]:
Post body must contain a JSON object (IndexFields), consisting of an array of two name-value pairs (ID and VAL).
The ID is the field ID, and the value is the data to be indexed.
See the following example:
{"IndexData":{“IndexFields”:[{"ID":3,"VAL":"Packing Slip"},{"ID":4,"VAL":"1122334456"},{"ID":5,"VAL":"Shipped"}]}}
SecureId:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
Token:
A valid token must be passed in the url. A token is retrieved by making a call to “Get License.”
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
Nothing.
API Call:
POST /dbs/{Database}/archives/{ArchiveID}?token={token}
Description
Imports a document based on the archive specified in the URL.
Parameters:
[RAW]:
Post body must contain a JSON object with two name-value pairs. The first is the field data (fields) for this document (for formatting info see the Update Index Data method), the second is the name of the file (files) uploaded to the server, see the note below.
{"fields":[{"name":"1","value":"Tom Fiddle"}],"files":[{"name":"24871f50-8874-4b22-ac84-9e730e933d74.txt"}]}
Note: To be imported, the document must exist in your SmartSearch “WebPortalCache” directory which is by default installed into the same location as Archives/Inboxes. See “Upload File to Server” call, which can be used to put a document in that folder.
token:
A valid token must be passed in the url. A token is retrieved by making a call to “Get License.”
Returns
Nothing.
API Call:
POST /files
Description
Imports a document based on the archive specified in the URL.
Parameters:
[RAW]:
Post body must contain the file which you would like moved to the server
Returns
{ "files": [ { "name": "a0300e6e-5377-4b6a-8be3-2c55ecb1de4c.pdf", "isEmail": false, "oEmailData": null, "test": null } ] }
API Call:
POST /dbs/{Database}/export?token={token}&field={field}
Description
Exports documents out of a database.
Parameters:
[RAW]:
An array of JSON objects must be passed in the HTTP body. The array should contain one object for each document to be exported. Each object should contain three name-value pairs(one for the archive Id, document Id and the document hash) The JSON should look like this:
[{'Archive':1,'Id':7,'Hash':'cfbc4b4248a84e5534899f5e003a2ecf4c168f6331b133b654888a67840bad24'},{'Archive':1,'Id':8,'Hash':'372e9b52c3f89e75f717b94b89cabf285884819d6b613867b9b1debaee79a15f'}]
field:
Field which will be used to name the file(s).
token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
Path of to the ZIP file.
API Call:
GET /dbs/{Database}/archives/{Archive}/documents/{Document}/delete/?SecureID={string}&Token={}
Description
Removes the selected document from the database entirely. This requires delete document rights to the archive in question.
Parameters:
Archive:
ID of the selected Archive
Database:
ID of the selected Database
Document:
ID of the selected Document
SecureID:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
Token:
License Token
Returns
Nothing.
API Call:
GET /dbs/{Database}/archives/{Archive}/documents/{Document}/{Type}?DestinationArchive={destinationarchive}&SecureID={SecureID}&token={license}
Description
This call has the ability to move a document between archives or copy it into a new archive or the existing.
Parameters:
Archive:
ID of the selected Archive
Database:
ID of the selected Database
DestinationArchive:
Archive ID of the selected destination of the transfer
Document:
ID of the selected Document
SecureID:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
token:
A valid token must be passed in the url. A token is retrieved by making a call to “Get License.”
Type Optional:
Move or Copy. Depending on your desired action.
Returns
Document ID
Other:
DocID of new document in new archive.
API Call:
GET /dbs/{Database}/archives/{Archive}/documents/{Document}/rev?format={json|xml}
Description
Gets the revision control document versions of the selected document. This data can be used to access other revisions of the document using the returned hash to in conjunction with the Get Document call.
Parameters:
Archive:
ID of the selected Archive
Database:
ID of the selected Database
Document:
ID of the selected Document
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
<ArrayOfRevision xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <Revision> <DocId>20</DocId> <SecureId>a1f89c37bed4bb5303eabef9fa3a00325ed38374e482dc75cb3462784d4e9fbe</SecureId> <Version>2</Version> </Revision> <Revision> <DocId>21</DocId> <SecureId>cf780f4c1ea022c0e09fef5fe6e3921334f31e5db31954f473393e42082dea0e</SecureId> <Version>2</Version> </Revision> <Revision> <DocId>22</DocId> <SecureId>dbbcb4dbba398eee43767f0768ff00f82a6dbc15d84f4beea27518e9bc9ffffd</SecureId> <Version>1</Version> </Revision> <Revision> <DocId>23</DocId> <SecureId>e404dba087b3f1893d9b49fe52afb3a669a22770bdd4dab08edf503587a46d6b</SecureId> <Version>3</Version> </Revision> </ArrayOfRevision>
JSON:
[ { "DocId": 20, "Version": 2, "SecureId": "a1f89c37bed4bb5303eabef9fa3a00325ed38374e482dc75cb3462784d4e9fbe" }, { "DocId": 21, "Version": 2, "SecureId": "cf780f4c1ea022c0e09fef5fe6e3921334f31e5db31954f473393e42082dea0e" }, { "DocId": 22, "Version": 1, "SecureId": "dbbcb4dbba398eee43767f0768ff00f82a6dbc15d84f4beea27518e9bc9ffffd" }, { "DocId": 23, "Version": 3, "SecureId": "e404dba087b3f1893d9b49fe52afb3a669a22770bdd4dab08edf503587a46d6b" } ]
API Call:
POST api/dbs/{DatabaseID}/archives/{ArchiveID}/dxc/{SourceID}?token={Token}
Description
After setting up an external DataXChange source in Smartsearch, this route runs a matching query against that source using passed field data.
Parameters:
[RAW]:
The body of the POST must contain a record of field IDs (ID) and values to match against. (VAL for single value fields, MVAL[] for multi value fields)
JSON:
[
{
"MVAL": [],
"ID": 1,
"VAL": "test"
}
]
ArchiveID:
ID of the archive where the DataXChange Source is.
DatabaseID:
ID of the database.
SourceID:
ID of the DataXChange source to use. This can be retrieved from the Get DataXChange Sources call.
token:
A valid license token.
Returns
[ { "Match": [ { "MVAL": [], "ID": 3, "VAL": "1234" }, { "MVAL": [], "ID": 4, "VAL": "" } ] }, { "Match": [ { "MVAL": [], "ID": 3, "VAL": "1234" }, { "MVAL": [], "ID": 4, "VAL": "Brew Haven LLC" } ] } ]
API Call:
GET api/useraction?Database={DatabaseID}&Archive={ArchiveID}&Document={DocumentID}&Token={Token}&SecureID={SecureID}
Description
This call gets a list of available GlobalAction Queue Actions for a given document. The call returns a list of queue actions and their action keys.
Parameters:
Archive:
Id of archive.
Database:
Id of database.
Document:
Specifies the Id of document to pull the process actions on.
SecureID:
A valid Secure Id must be passed in the url. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
{ "Key": "-12", "ProcessID": 1, "Name": "Invoice Approval", "Actions": [ { "Name": "Approve", "Key": "-12UA-4" }, { "Name": "Reject", "Key": "-12UA-6" } ], "UsersAndGroups": null }
API Call:
POST api/useraction?Database={DatabaseID}&Archive={ArchiveID}&Document={DocumentID}&ActionId={ActionID}&Token={Token}&SecureID={SecureID}
Description
This call fires a specified GlobalAction Queue action for a given document.
Parameters:
ActionId:
The action id of the specific queue action to be excuted on the document. This can be obtained by first making a call to “Get GlobalAction Queue Actions.” This call will return a list of actions that contain a name and a key. The key is to be used as the Action Id.
Archive:
Id of archive.
Database:
Id of database.
Document:
Specifies the Id of document to fire the process action on.
SecureID:
A valid Secure Id must be passed in the URL. In this situation, the Secure Id is retrieved by making a call to “Run Search.” Every document returned by the search will be returned with a “Hash.” This hash is to be used as the Secure Id.
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
Nothing.
API Call:
GET api/dbs/{DatabaseID}/archives/{ArchiveID}?DocumentID={DocumentID}&Token={Token}
Description
To access a document, the caller must have the Secure ID of the specific document. Secure ID’s are based on the unique properties of the document, and a user’s current login token. For most application use cases, the Secure ID is automatically generated and returned in the Run Search call. When there is a need to access a document without running a search, the secure ID can be obtained with this method. For this function to work, the authenticated user must have the Archive level permission “Full API Access”.
Parameters:
ArchiveID:
Archive ID of the Archive when the document currently resides. Note, you MUST have Full API Access permissions for the authenticated user to the Archive.
DatabaseID:
The database ID for the GlobalSearch database where the document resides.
DocumentID:
Document ID for the specific document. Note that the Document ID will change should the document ever change Archives.
Token:
A valid license token.
Returns
A Text string representing the Secure ID of the document.
API Call:
GET /admin?format={json|xml}
Description
Returns the user currently logged in. Note that this function does not consume a license.
Parameters:
format Optional:
Text string of ‘JSON’ or ‘XML’. Default is XML when unspecified.
Returns
“YourDomain\\SSAdministrator”
XML:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">YourDomain\SSAdministrator </string>
API Call:
GET /dbs/{Database}/lists/{ListId}
Description
Returns a pick list as specified in the Url. Includes the ?, a string array of options, and the list’s name.
Returns
{ "Items": [ "01 - Administration", "02 - Facility", "03 - IT", "04 - Marketing", "05 - Production", "06 - Research & Development", "07 - Sales", "08 - Shipping & Receiving" ], "ID": 4, "Name": "Cost Center" }
XML:
<List xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects"> <ID>4</ID> <Items> <string>01 - Administration</string> <string>02 - Facility</string> <string>03 - IT</string> <string>04 - Marketing</string> <string>05 - Production</string> <string>06 - Research & Development</string> <string>07 - Sales</string> <string>08 - Shipping & Receiving</string> </Items> <Name>Cost Center</Name> </List>
API Call:
GET api/dbs/{DatabaseID}/archives/{ArchiveID}/dxc?Token={Token}
Description
This call returns a list of available DataXChange sources for an archive. The ID is used in the run DataXChange search call as the SourceID.
Parameters:
ArchiveID:
ID of the archive where the DataXChange Source is.
DatabaseID:
ID of the database.
Token:
A valid license token.
Returns
[ { "ID": 3, "ArchiveID": 42, "SourceName": "ARP System" }, { "ID": 1, "ArchiveID": 42, "SourceName": "Judis Database" } ]
API Call:
GET api/userAdmin/secured?Token={token}
Description
Returns a list of all users and groups that are secured to any SmartSearch database
Parameters:
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
[ { "Name": "apiuser", "Email": null, "License": 1, "Type": 1, "SecuredDBs": [ { "Id": 1, "Name": "GetSmart", "SecurityLevel": 0, "Manager": null }, { "Id": 2, "Name": "BrewHaven", "SecurityLevel": 0, "Manager": null } ] } ]
API Call:
GET api/userAdmin/unsecured?Token={token}
Description
Returns a list of all users and groups that are not secured to any SmartSearch databases
Parameters:
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
[ { "Name": "user", "Email": null, "License": 0, "Type": 1, "SecuredDBs": null }, { "Name": "Square9User", "Email": null, "License": 0, "Type": 2, "SecuredDBs": null } ]
API Call:
GET api/userAdmin/tree?Token={token}
Description
Returns an object containing databases, their associated archives and the searches associated with those archives.
Parameters:
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
[ { "Id": 1, "DbId": 1, "Label": "GetSmart", "Type": "database", "DefaultSearch": false, "QueueSearch": false, "DirectSearch": false, "Children": [ { "Id": 1, "DbId": 1, "Label": "DWG Test", "Type": "archive", "DefaultSearch": false, "QueueSearch": false, "DirectSearch": false, "Children": [ { "Id": 1, "DbId": 1, "Label": "Browse DWG Test", "Type": "search", "DefaultSearch": true, "QueueSearch": true, "DirectSearch": true, "Children": null } ] }, { "Id": 2, "DbId": 1, "Label": "Test Archive", "Type": "archive", "DefaultSearch": false, "QueueSearch": false, "DirectSearch": false, "Children": [ { "Id": 2, "DbId": 1, "Label": "Browse Test Archive", "Type": "search", "DefaultSearch": true, "QueueSearch": true, "DirectSearch": true, "Children": null }, { "Id": 3, "DbId": 1, "Label": "Test new search", "Type": "search", "DefaultSearch": true, "QueueSearch": true, "DirectSearch": true, "Children": null } ] } ] } ]
API Call:
GET api/userAdmin/archives?db={databaseId}&archive={archiveId}&username={Username}&Token={token}
Description
Returns specified user’s archive permissions for a given archive
Parameters:
archive:
Id of the archive
db:
Id of the database
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
username:
User, for which, to retrieve archive permissions
Returns
524287
API Call:
GET api/userAdmin/searches?db={databaseId}&username={Username}&Token={token}
Description
Return search properties for all searches a user has permissions to in the specified database.
Parameters:
db:
Id of the database
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
username:
User, for which, to retrieve search properties
Returns
[ { "Id": 2, "Properties": 14, "IsDefault": true, "IsQueue": true, "IsDirect": false }, { "Id": 1, "Properties": 10, "IsDefault": true, "IsQueue": false, "IsDirect": false } ]
API Call:
POST api/userAdmin/archives?Token={token}
Description
This call allows user and group archive permissions to be set by passing in users or groups, the target archive or archives and a permissions level to set for those archives.
The returns JSON contains an example of the object that needs to be passed in the request.
Parameters:
[RAW]:
JSON object containing a list of users or groups, a list of target archives and the permissions level to be set for those archives.
Permissions level is obtained by adding the values for each permission to be applied and using that number as the permissions level. Permissions values:
View = 1
Add = 2
modify docs = 4
delete = 8
print = 16
email = 32
export data = 64
export docs = 128
view in acrobat = 256
view doc history = 512
modify data = 1024
modify annotations = 2048
launch doc = 4096
launch new version = 8192
view doc revisions = 16384
publish revisions = 32768
modify pages = 65536
move docs = 131072
Delete Batches = 262144
Full API Access = 524288
{ “users”: [ { “name”: “apiuser”, “type”: 1 }, { “name”: “SSAdministrator”, “type”: 1 } ], “targets”: [ { “id”: 2, “database”: 1 } ], “permissions”: { “level”: 524287 } }
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
{ "Saved": 1 }
API Call:
POST api/userAdmin/databases?Token={token}
Description
This call allows user or group database permissions and license types to be set by passing in users or groups, the target database or databases and a license type to set for those databases.
Parameters:
[RAW]:
JSON object containing a list of users and groups to be added to database security, a list of each database ids, and the permissions to be assigned to those users and groups. Permissions types are 0 for database access and 1 for administrator access. License types are 1 for full access, 2 for web only full license, and 4 for web only read only. Each targets id is the database id of the database { "users": [ { "name": "apiuser", "type": 1 }, { "name": "ClientTest", "type": 1 } ], "targets": [ { "id": 1 }, { "id": 2 } ], "permissions": { "remove": false, "type": 0, "license": "1" } }
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
{ "Message": "Success" }
API Call:
POST api/userAdmin/searches?Token={token}
Description
This call allows users or groups to be granted permissions to searches.
The returns JSON contains an example of an object to be passed for the request. The targets id, in this case, is the search id.
A Search id can be obtained by making a call to “Get Archive Searches.”
Parameters:
[RAW]:
JSON object containing a list of users or groups, a list of the specific searches for those users to be given access and the permissions to be given to those users and groups.The targets id, in this case, is the search id. A Search id can be obtained by making a call to "Get Archive Searches." { "users": [ { "name": "apiuser", "type": 1 } ], "targets": [ { "id": 4049, "database": 2 } ], "permissions": { "view": true } }
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
{ "Message": "Success" }
API Call:
POST api/userAdmin/searchType?Token={token}
Description
This call allows search settings for users or groups to be configured for searches on an archive. The users will first need to be granted view permissions to the searches and this can be done by making a call to “Add Search Security.” The returns JSON contains an example of an object to pass to the request. The targets id in this case refers to the archive id of the archive where search settings are to be applied. The available permissions types to be used are 4 for queue search, 8 for default search and 16 for direct search.
Parameters:
[RAW]:
JSON object containing a list of users or groups, a list of archives to apply the search setting
The targets id in this case refers to the search id of the search that is to be set. A Search id can be obtained by making a call to “Get Archive Searches.”
The available permissions types to be used are 4 for queue search, 8 for default search and 16 for direct search.
{
“users”: [
{
“name”: “apiuser”,
“type”: 1
}
],
“targets”: [
{
“id”: 2,
“database”: 1
}
],
“permissions”: {
“type”: 8,
“remove”: false
}
}
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
{ "Message": 0 }
API Call:
POST api/userAdmin?create?Token={Token}
Description
This call allows a new Square9 user to be created.
Parameters:
[RAW]:
JSON object containing the user name and password of the new Square 9 user to be created.
{
“name”:”Square9User”,
“password”:”number#1″
}
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
Nothing.
API Call:
DELETE api/userAdmin/user?name={Username}&Token={token}
Description
This call will permanently delete a Square 9 user.
Parameters:
name:
The user to be deleted.
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
Nothing.
API Call:
PUT api/userAdmin/user?name={Username}&Token={token}
Description
Update a Square user password.
Parameters:
[RAW]:
JSON object containing the new password for the user.
{
“password”:
“number#2”
}
name:
The Square 9 user to be updated.
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
Nothing.
API Call:
GET inboxes/{id}
Description
Retrieves the ID, Name, and Path of all inboxes, or a specific inbox if an ID is passed.
Parameters:
id Optional:
ID of a specific inbox.
Returns
{ "InboxOptions": 1, "Inboxes": [ { "Id": 1, "Name": "Inbox1", "Path": "C:\\SmartSearch\\inboxes\\Inbox1" }, { "Id": 2, "Name": "Inbox2", "Path": "C:\\SmartSearch\\inboxes\\Inbox2" } ] }
XML:
<InboxOptions>1</InboxOptions> <Inboxes> <Id>1</Id> <Name>Inbox1</Name> <Path>C:\SmartSearch\inboxes\Inbox1</Path> </Inboxes> <Inboxes> <Id>2</Id> <Name>Inbox2</Name> <Path>C:\SmartSearch\inboxes\Inbox2</Path> </Inboxes>
API Call:
POST inboxes/{id}?filepath={uploadedfilename}
Description
This call takes a file already uploaded to the server (through the upload method or otherwise) and adds it to the targeted inbox. The file must be present in the API’s cache folder.
Parameters:
filepath:
The name of the file uploaded to the API to be added to the inbox. This file must be located in the API’s cache folder.
id:
ID of the inbox to add the file to.
Returns
Nothing.
API Call:
POST upload?database={dbID}&archive={archiveID}&time={time}&filetype={type}&token={token}
Description
This is the first step in uploading a file to an Archive using chunks. With this method a new job is created on the server, and that Job ID is returned.
Once the JobID is obtained, chunks of a document can be posted to the upload chunk endpoint.
Parameters:
archive:
ID of the archive. You must have add permissions to this archive in order to upload to it.
database:
ID of the Database
filetype:
Extension of the file to be uploaded.
time:
A valid datetime, typically when the upload starts. This acts as a key, you will need to pass this value for every call in this job.
token:
Valid license token.
Returns
{ "ChunkLimit": 1, "JobID": "12345abcdef" }
API Call:
POST upload?inbox={inbox}&time={time}&filetype={type}&token={token}
Description
This is the first step in uploading a file to an Inbox using chunks. With this method a new job is created on the server, and that Job ID is returned.
Once the JobID is obtained, chunks of a document can be posted to the upload chunk endpoint.
Parameters:
filetype:
Extension of the file to be uploaded.
inbox:
ID of the inbox.
time:
A valid datetime, typically when the upload starts. This acts as a key, you will need to pass this value for every call in this job.
token:
Valid license token.
Returns
{ "ChunkLimit": 1, "JobID": "12345abcdef" }
API Call:
POST upload?time={time}&token={token}
Description
This call receives part of a file and places it in the correct location on the server according to the JobID. The new upload call returns the JobID and the maximum chunk size allowed when uploading.
Once all the chunks of a file have been sent, the finalize call will complete the upload process. Headers: content-type = text/json
Parameters:
[RAW]:
The body of this POST must contain a JSON object with the following keys:
{
“JobID”: “”, //JobID obtained in the initial upload call
“Index”: 1, //number of the chunk being uploaded.
“RawData”: “” //A base64 encoded string of the chunk of the file being uploaded
}
time:
A valid datetime, this must be the same value as what was passed on the initial upload request.
token:
A valid license token.
Returns
Nothing.
API Call:
GET upload?JobID={job}&time={time}&token={token}
Description
Once all file chunks have been completely uploaded, this call finalizes the file on the server, and returns the filename for indexing purposes.
Parameters:
JobID:
JobID received from the initial upload call, and used during all chunk uploads.
time:
A valid datetime, this must be the same value as what was passed on the initial upload request.
token:
A valid license token.
Returns
“filename.ext”
API Call:
GET api/captureworkflows/list?Token={token}
Description
This call will retrieve a list of capture workflows that use the import scans action
Parameters:
[RAW]:
JSON Object containing all data for a document to be imported into SmartSearch via a capture workflow.
A valid token must be passed in the object. A token is retrieved by making a call to “Get License.”
{
“token”: “710858b7-90e7-4c7b-8613-2c1f2dece902”,
“fields”: [
{
“name”: “FieldName”,
“value”: “FieldValue”
}
],
“xmlPath”: “\\\\SERVER\\ImportFolder”,
“documentPaths”: [
“C:\\ImportFolder\\test1.pdf”
],
“processName”: “ImportFile”,
“archiveId”: “3”,
“inboxId”: “0”,
“databaseId”: “1”
}
Token:
A valid token must be passed in the URL. A token is retrieved by making a call to “Get License.”
Returns
{ "XMLPath": "\\\\SERVER\\ImportFolder\\ImportFile\\createdXMLFile.xml" }
API Call:
POST api/captureworkflows/upload
Description
This call allows an object to be passed in, converted to an XML and placed into a folder to be processed by a capture workflow.
Returns
{ "token": "710858b7-90e7-4c7b-8613-2c1f2dece902", "fields": [ { "name": "FieldName", "value": "FieldValue" } ], "xmlPath": "\\\\SEVER\\ImportFolder", "documentPaths": [ "C:\\ImportFolder\\test1.pdf" ], "processName": "ImportFile", "archiveId": "3", "inboxId": "0", "databaseId": "1" }