Note |
---|
Please note that any requests for deleting GlobalSearch Objects (like database, archives, fields, lists, tables, documents, etc) will happen instantly and cannot be reversed. Use with care and consideration. |
...
Info |
---|
Using different environments in this manner allows you to quickly switch between users and GlobalSearch Servers. Note that you may have clear Postman cookies! |
Getting a License
See “Authentication Authentication and Licensing/Get License”License
GET request to /square9api/api/licenses, uses Basic Authentication to pass in user name and password.
...
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
The response to this request will contain the token in both the request body, cookies and headers. Both a |
Deleting a License
See Authentication and Licensing/Delete License
DEL request to /square9api/api/licenses/{token} will delete (pre GlobalSearch 6.1) or deactivate (GlobalSearch 6.1+) the given license token.
Managing Licenses is an important part of interacting with GlobalSearch APIs, you should attempt to use licenses for as small a time as possible and return (or delete) them when not in use so that human users of GlobalSearch have enough licenses available to access the program.
Uploading and Indexing a Document (in Chunks)
...
Get GlobalSearch License
Request: GET "Authentication and Licenses/Get License"
Uses Basic Authentication using the postman
{{user}}
and{{password}}
variables (pulled from Postman Environment)
Start file upload to server
Request: POST "Chunking Upload/Upload File to Server"
this will return the unique JobID that you will need to use in later requests
The timestamp value here needs to be unique for each job
Upload file chunk
Request: POST "Chunking Upload/Upload File Chunk"
Body:Code Block language json {"Index":1, "RawData":base64endcodedfilecontent, "JobID":jobid}
In this example we are assuming that the file is small enough to be reasonably uploaded in one chunk.
PDF is base64 encoded, in this case since there is only one chunk the Index value is 1
Online Base64 encoding service: https://www.base64encode.org/
The Postman collection includes the
{{pdfvaluefull}}
variable which is a full PDF encoded to base64 that can be used with this request as long as you are doing a one chunk only upload.
...
Finalize Upload
Request: GET "Chunking Upload/Finalize Upload"
This will write the completed chunks to a file in the WebPortalCache directory, the return value from this request will be that file name. This file name is used in the last request when indexing the document.
Import Document from WebPortalCache
Request: POST "Document Actions/Import Document from WebPortalCache"
Example Body of Request:
Code Block | ||
---|---|---|
| ||
{ "fields": [ { "name": FieldID, "value": IndexFieldValue } ], "files":[ {"name":WebPortalCacheFilename} ] } |
...
Get GlobalSearch License
Request: GET "Authentication and Licenses/Get License"
Uses Basic Authentication using the postman
{{user}}
and{{password}}
variables (pulled from Postman Environment)
...
Info |
---|
By default it will attempt to find a PDF file called “UnsupportedDocumentFormat.pdf“ in your Postman files directory (by default this is C:\Users\<username>\Postman\files). You can update this to be whatever file you wish. |
Request: POST “Document Document Actions/Upload File To Server“Server
Uses request body form-data to upload files
Note that you can add multiple files by adding more “file” keys to the form-data section.
Select the request and switch to the Body tab;
...
Index the document
Request: POST “Document Document Actions/Import Document from WebPortalCache”WebPortalCache
Example Body of Request:
Code Block | ||
---|---|---|
| ||
{ "fields": [ { "name": FieldID, "value": IndexFieldValue } ], "files":[ {"name":WebPortalCacheFilename} ] } |
Running a search
Postman flow example:
...
See "Searching/Run Search"
In order to run a search you will need the following;
...
Page - Mainly used by GlobalSearch Web/LAN to return a limited number of results in page like fashion
RecordsPerPage - The number of results to return
SecureId - The "Hash" of the search
count - Only returns the number of documents found, without information about the documents themselves
Moving a Document
See "Document Actions/Copy Document" and "Document Actions/Move Document"
Note |
---|
Please note that you should always fetch the SecureID values anytime that you need to use them, they are updated often. This applies to any version of the SecureID, whether it be search or document. |
...
Updating Index data on a Document
See "Document Actions/Update Index Data"
In order to update index data fro a document you will need to know the following, see previous sections for how to obtain these.
...