IntelligenceBank Public API Documentation (v2)

A new API is now available

This page documents IntelligenceBank's API referred to as v2. Most of the calls listed below have been upgraded as part of a new API version, referred to as v3.

For better performance and additional flexibility, please use the v3 calls when possible. v3 calls can be used in conjunction with v2 calls. Some additional calls are also only available in v3.

You can access the v3 API documentation at https://apidoc.intelligencebank.com


Overview

This service provides the ability to retrieve, add and modify digital assets that reside on an IntelligenceBank platform instance.

RFC2119 Words

The key words "MUST","MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL" in this document are to be interpreted as described in RFP2119.

Media Type Support

All server response bodies SHOULD be returned using the JSON Media Type. All client request bodies SHOULD be sent using the application/x-www-form-urlencoded Form Media Type, or the multipart/form Media Type as appropriate.

Product Key

All calls can have a product key parameter appended to the URL as p60=KEYVALUE.

It allows to track the source of calls in the platform's Usage Reporting.

URLs and Operations

All URLs share a common base of

https://XXXXX.intelligencebank.com/webapp/1.0

where XXXXX is the API server subdomain assigned to a client. You can use the Request Client API URL call to retrieve the subdomain applicable to your platform domain.

Below is a list of the endpoint URLs and the operations they perform

/login

The /login URL supports the following HTTP methods

  1. POST using the Login Payload and returns the Login Response 

/reset

The /reset URL supports the following HTTP methods

  1. POST using the Reset Payload and returns the No Content Response

/resources

The /resources URL supports the following HTTP methods

  1.  GET using the Root Folder Request and returns the Folder Response

  2.  GET using the Folder Request and returns the Folder Response

  3.  GET using the Resource Request and returns the resource file or file size estimate

  4.  POST using the Create Folder Payload and returns the FolderResponse  

  5.  POST using the Create Resource Payload and returns the Resource Response

  6.  PUT using the Update Folder Payload and returns the FolderResponse

  7.  PUT using the Update Resource Payload and returns the Resource Response

  8.  DELETE using the Delete Folder Request and returns a No Content Response

  9.  DELETE using the Delete Resource Request and returns a No Content Response

/icon

The /icon URL supports the following HTTP methods

  1.  GET using the Icon Request and returns the icon file 

/comments

The /comments URL supports the following HTTP methods

  1. GET with the Comment Request and returns the Comment Response

  2. POST with the Comment Payload and returns the No Content Response

/sync

The /sync URL supports the following HTTP methods

  1. POST with the Sync Payload and returns the Sync Response

/search

The /search URL supports the following HTTP methods

  1. GET with the Search Request and returns the Search Response

/downloadpresets

The /downloadpresets URL supports the following HTTP methods

  1.  GET using the Download Preset Request and returns the Download Preset Response

Requests and Payloads

Below is a list of query strings and payloads that can be sent from the client to the server along with a list of common server responses.


Login

Example

p70=joe.blow@test.com&p80=mypassword&p90=test.intelligencebank.com

would request a login to the test.intelligencebank.com site with the user joe.blow@test.com.

Note this payload is a simple key/value pairs. The client MUST use POST to send this payload to the Login URL. You SHOULD use the following header:

Content-Type: application/x-www-form-urlencoded 

The Login URL is https://XXXXX.intelligencebank.com/webapp/1.0/login

Upon successful completion of this operation, the server SHOULD return the Login Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Reset Password

Example

p70=joe.blow@test.com&p90=test.intelligencebank.com

would request the server to send a password reset email to be sent to joe.blow@test.com. If the user is valid then an email will be sent to that address.

Note this payload is simple key/value pairs. The client MUST use POST to send this payload to the Reset URL. You SHOULD use the following header

Content-Type: application/x-www-form-urlencoded 

The Reset URL is https://XXXXX.intelligencebank.com/webapp/1.0/reset

Upon successful completion of this operation, the server SHOULD return the No Content Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Request Client API URL

Note that this call uses a different API.

https://<client-domain>.intelligencebank.com/v1/auth/app/getYapiAddress

Return example:

{"SID":"eef24c07ebd40fafbb6ab216aa0d1ade","content":"https:\/\/apiau.intelligencebank.com"}

In this case, URL to use for subsequent API calls is https://apiau.intelligencebank.com


Browser Login (For SSO Users)

Note that this call uses a different API. It enables the user to be authenticated by login to IntelligenceBank via their browser. This is useful for Single Sign On users to login into third-party applications using the IntelligenceBank API.

STEP 1

https://<client-domain>.intelligencebank.com/v1/auth/app/token

Example response:

{"SID":"eef24c07ebd40fafbb6ab216aa0d1ade","content":"VeZEZR9ee"}

STEP 2

Use the content value returned (in orange), i.e. token, to open login url in browser:

https://<client-domain>.intelligencebank.com/auth/?login=1&token=VeZEZR9ee

STEP 3

After login is done on the web, use the token to call the API and get the login session info:

https://<client-domain>.intelligencebank.com/v1/auth/app/info?token=VeZEZR9ee

The return content has 2 parts:

  1. 'session' contains the session info, use the sid value inside as the login proof, the loginTime is the time when this session was activated. The time out period will be based on this.

  2. 'info' contains the same info returned with the standard Login API call.

Note, this token is a one-time token, once you successfully received the login response info, the token will be erased on the server (for security and performance reasons).

Example Login response:

{"SID":"eef24c07ebd40fafbb6ab216aa0d1ade","content":{"session":

{"sid":"eef24c07ebd40fafbb6ab216aa0d1ade","userUuid":"4717c0b468e7a1d00872f56c81164ec1","originalUserUuid":null,"loginTime":1538631769}

,"info":{"clientname":"value","clientuuid":"d78d15bb480cf9ec53f4dfed7076c740","apikey":"4a0658df9084f078d0cbc506e0f29b57","logintimeoutperiod":120,"adminemail":"sample@intelligencebank.com","passwordexpiryperiod":null,"userverificationperiod":null,"offlineexpiryperiod":120,"annotations":"Advanced","comments":"1","passwordexpired":null,"emailexpired":null,"versions":"1","firstname":"henry","lastname":"jiang","useruuid":"4717c0b468e7a1d00872f56c81164ec1","thumbnail":"value","foldericon":"72c7319b204bef3475c9c696c625e083","rowsOnPage":"50","colourPrimary":"#100F0F","colourPrimaryText":"#B1A3A3","colourSecondary":"#F4600C","colourSecondaryText":"#5092E5","colourHighlight":"#78B7D4","enableMasterSync":"0","enableCustomBranding":"1","enableAnnotations":"1","enableImageReader":"1","enableAppOpenIn":"1","isResourceMainAdmin":true,"toolNameMapping":{"resource":

STEP 4

You will then need to construct the _aid value which is to be set as a cookie in the header of the subsequent calls as follow:

apikey_sid_productkey

If you do not have a product key (also referred to as p60), use default as a value.

Example _aid:

4a0658df9084f078d0cbc506e0f29b57_eef24c07ebd40fafbb6ab216aa0d1ade_default

Warning, DO NOT use the first level SID, but always use the "sid" value returned inside "session".


Request Root Folder List

?p10={apikey}&p20={useruuid}

Example

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef

would request the contents of the root folder. This will contain metadata for all the folders with the root folder and will allow the client to navigate the underlying folder structure.

Note this is a query string and not a payload. The client MUST append this string to the Resources URL. The client MUST use GET when executing this request.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

Upon successful completion of this operation, the server SHOULD return the Folder Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Request Folder Info

This call allows to request and retrieve details of sub-folders and number of files about one or multiple folders. If folders have a lot of files (e.g. 1000+), it is advised to make this call first to retrieve the count of files so that subsequent folder content requests can be paginated accordingly (see below).

?p10={apikey}&p20={useruuid}&folderlist={folder uuids separated by commas}

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?


Request Folder Content

?p10={apikey}&p20={useruuid}&folderuuid={folder uuid}&skip={starting position}&limit={number of resources to return}

If the limit parameter is included in the request then the number of resources returned will be the value of the limit parameter, starting from the first resource if there is no skip value present, or from the value of the skip parameter if it is present.

If the skip parameter is included in the request and the limit parameter is not then the resources returned will be those starting from the skip value and ending at the last resource.

The skip value is zero indexed based i.e. the first resource resides at skip=0. If the skip parameter is not included in the request then the starting point will be as if a skip value of 0 was included. If the skip value is larger than the number of resources in the folder, then no resource element will be returned.

The maximum number of results that can be returned at once is 1000.

Note this is a query string and not a payload. The client MUST append this string to the Resources URL. The client MUST include the p10, p20 and folderuuid parameters. The client MAY include the skip and/or the limit parameters. The client MUST use GET when executing this request.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

Upon successful completion of this operation, the server SHOULD return the Folder Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.

Examples:

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&folderuuid=hg3v23ghj4hb34hhjhjg34ezrezrezezrez 

would request the contents of the folder with that folderuuid. The response will contain metadata for all the folders and resources within the folder.

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&folderuuid=hg3v23ghj4hb34hhjhjg34ezrezrezezrez&skip=0&limit=50

would request the contents of the folder with that folderuuid. The response will contain metadata for all the folders and the first 50 resources within the folder.

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&folderuuid=hg3v23ghj4hb34hhjhjg34ezrezrezezrez&skip=50&limit=50

would request the contents of the folder with that folderuuid. The response will contain metadata for all the folders and the next 50 resources within the folder.


Delete Folder Request

?p10={apikey}&p20={useruuid}&folderuuid={folder uuid}

Example

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&folderuuid=hg3v23ghj4hb34hhjhjg34

would request to delete the folder with that folderuuid.

Note this is a query string and not a payload. The client MUST append this string to the Resources URL. The client MUST use DELETE when executing this request.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

Upon successful completion of this operation, the server SHOULD return the No Content Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Create Folder

?p10={apikey}&p20={user id}

Example

name=Images&parent=hjsdhsd5sddsjhd675ddfsfddsf

would request to create the folder called Images within the parent folder with that uuid.

Note this payload is simple key/value pairs. The client MUST use POST to send this payload to the Resources URL. You SHOULD use the following header

Content-Type: application/x-www-form-urlencoded 

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

Upon successful completion of this operation, the server SHOULD return the Folder Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Update Folder

?p10={apikey}&p20={user id}&folderuuid=hg3v23ghj4hb34hhjhjg34dssf

Example

name=Archived%20Images

would request to update the name of the folder with that uuid to the new value "Archived Images"

Note this payload is simple key/value pairs. The client MUST use PUT to send this payload to the Resources URL. You SHOULD use the following header

Content-Type: application/x-www-form-urlencoded 

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

Upon successful completion of this operation, the server SHOULD return the Folder Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Resource Request

Context 
User wants to download a file.

URL
https://api.intelligencebank.com/webapp/1.0/resources?

Method
GET

Parameters
p10:* {client api key}
p20:* {user uuid}
fileuuid: {file uuid}} 
OPTIONAL: version: {version number}
OPTIONAL: preview=true - this will download a Preview image of the file with dimensions of up to 850 pixels width/height.
OPTIONAL: ext: {type of extension to download the file as}
OPTIONAL: size: {percentage of original file (25, 50, 75, 100) }
OPTIONAL: cropwidth: {cropped output width}
OPTIONAL: cropheight: {cropped output height}
OPTIONAL: cropx: {x coordinate to start the crop}
OPTIONAL: cropy: {y coordinate to start the crop}
OPTIONAL: compression: {compression quality (1-100) }
OPTIONAL: compressiontype: {type of compression (see Note 5 below) }

?p10={apikey}&p20={useruuid}&fileuuid={resource uuid}&version={ version number }&ext={ file extension }&preview=true&size={ percentage of original file size }&cropwidth={ cropped output width }&cropheight={ cropped output height }&cropx={ x coordinate to start the crop }&cropy={ y coordinate to start the crop }&compression={ compression quality }&compressiontype={ type of compression }

Header:

This needs to be set as a Cookie.

_aid: <session id>

Response
200 : OK
401 : Access denied
404 : File not found
500 : Internal server error

Actions
Process the streamed file

Examples

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34

would request to download the file with that fileuuid.

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34&preview=true

would request to download a preview of the file with that fileuuid.

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34&size=25&ext=gif

would request to download the file with that fileuuid at 25% of its original size, converted to a gif format

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34&compression=80&compressiontype=10

would request to download the file with that fileuuid compressed at 80% using JPEG lossless compression

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34&cropwidth=200&cropheight=200&cropx=0&cropy=0

would request to download the file with that fileuuid cropped to 200x200px starting from the top left corner of the image

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34&cropwidth=200&cropheight=200&compression=50&compressiontype=10&fileinfo=true

would request the estimated file size of the file with that fileuuid if it was to be cropped to 200x200px,   compressed at 50% using JPEG losslesscompression

Mandatory parameters: p10, p20, fileuuid

Note this is a query string and not a payload. The client MUST append this string to the Resources URL. The client MUST use GET when executing this request.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

Notes:

  1. If the version number is provided then that version's file will be downloaded. If the provided version number is not found then a  'not found' response will be provided

  2. If no version parameter is provided then the latest or current file version is downloaded.

  3. If no extension is provided, then the original will be returned.

  4. If the preview=true parameter is set then the returned image will be a png version of the original.

  5. If cropping an image, the following 4 parameters must be specified: cropwidth, cropheight, cropx and cropy

  6. If size parameter is included in a URL which also contains cropping parameters, the cropping parameters (cropwidth, cropheight, cropx and cropy) need to be specified at the same percentage as the size parameters.
    e.g. The following two snippets would produce the same target part of the image just at different dimensions

    1. -Without the size parameter: &cropwidth=960&cropheight=600&cropx=800&cropy=500

    2. With the size parameter set to 50%: &cropwidth=480&cropheight=300&cropx=400&cropy=250&size=50

  7. Types  of compression:

    • 1 = No compression

    • 2 = BZIP2 (Lossless Compression)

    • 8 = JPEG (Lossy Compression)

    • 10 = JPEG (Lossless Compression)

    • 11 = LZW (Lemple-Zif-Welch) (Lossless Compression)

    • 12 = Run-Length Encoding (Lossless Compression)

    • 13 = ZIP (Lossless Compression)

Upon successful completion of this operation, the server SHOULD return the requested file. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Delete Resource Request

?p10={apikey}&p20={useruuid}&fileuuid={folder uuid}

Example

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34

would request to delete the file with that fileuuid.

Note this is a query string and not a payload. The client MUST append this string to the Resources URL. The client MUST use DELETE when executing this request.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

Upon successful completion of this operation, the server SHOULD return the No Content Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Create Resource

?p10={apikey}&p20={user uuid}&folderuuid={folder uuid}

Note this payload is a mulitpart/form-data. The client MUST use POST to send this payload to the Resources URL.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

The name parameter in the header of the file component of the form MUST be called file1 i.e. name=file1.

The filename parameter in the header of the file component of the form MUST be the path to the file to be uploaded i.e. filename=<name of file to upload>

Supported metadata fields are Title, Description, Tags (referred to as Keywords in the platform) and Global Filters. Other Custom Fields are NOT supported.

Example

-------NEXT_PART_1431579477.49877 Content-Disposition: form-data; name="options" { "folder" : "06da9efd9e96a973015a5571b65d4b6c", "filename" : "/opt/test.txt", "name" : "Test file", "description" : "this is a test file" } -------NEXT_PART_1431579477.49877 Content-Disposition: form-data; name=file1; filename=/opt/test.txt Content-Type: plain/text one two three four -------NEXT_PART_1431579477.49877--

would request to upload the file called test.txt, save it within the folder with that uuid, give it the name "Test file" and a description of "this is a test file".

You SHOULD use the following header

Content-Type: multipart/form-data

Upon successful completion of this operation, the server SHOULD return the No Content Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Update Resource

There are two options for updating a resource. The first option is for updating the metadata of the resource only using standard POST url-form-encoded method. The second is for updating the resource file, and optionally the metadata too. The resource file can also be flagged that it should create a new version.


Option 1 - Update metadata only using url-encoded form

The URL would contain the following parameters

?p10={apikey}&p20={user id}&fileuuid={resource uuid}

And the body of the request would contain the metadata to be updated. This will overwrite the existing data so any existing tags or filters must also be sent back when updating this field.

Example

folder=685d6203ba83ae6969011ab785134c91&name=Archived%20Images&description=Old%20images&tags=California%2c%20trip%2c%20San%20Diego&filters={"Country":"USA"}

would request to update the name of the file with that uuid to the new value "Archived Image", set the description to "Old image" and set the keywords to "California, trip, San Diego", and add the filter Country with the value "USA"

the folder parameter with the uuid of the folder MUST be included

Supported fields for metadata updates are Title, Description, Tags (referred to as Keywords in the platform) and Global Filters. Note: Tag and Filter values will replace existing values. Other Custom Fields are NOT supported.

Note this payload is simple key/value pairs. The client MUST use PUT to send this payload to the Resources URL.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

You SHOULD use the following header

Content-Type: application/x-www-form-urlencoded 

Upon successful completion of this operation, the server SHOULD return the Resource Response: "Resource updated successfully". If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response

Option 2 - Update Resource File using multipart/form-data

?p10={apikey}&p20={user id}&fileuuid={resource uuid}

Example

-------NEXT_PART_1431579477.49877 Content-Disposition: form-data; name="options" { "folder" : "06da9efd9e96a973015a5571b65d4b6c", "filename" : "test2.txt", "name" : "Test 2 file", "description" : "this is the new version",
"newVersion" : true } -------NEXT_PART_1431579477.49877 Content-Disposition: form-data; name=file1; filename=/opt/test.txt Content-Type: plain/text one two three five -------NEXT_PART_1431579477.49877--

would request to upload the file called test2.txt, replace the existing file that is linked to that uuid, change the name to "Test 2 file" and the description to  "this is the new version". It would also create a new version of teh resource. If a new version is not desired then set the "newVersion" parameter to false, or leave it out of the parameters.

You can also use this method to update the metadata only. In that case there would only be one part with no file part, and you would not set the filename parameter in the metadata. Note that the new version parameter only applies when there is a file being sent as part of the update. If there is no file then no new version will be created even if the "newVersion" parameter is present and set to true.

Note this payload is a mulitpart/form-data. The client MUST use POST to send this payload to the Resources URL.

The Resources URL is https://XXXXX.intelligencebank.com/webapp/1.0/resources?

You MUST use the following header

Content-Type: multipart/form-data

Upon successful completion of this operation, the server SHOULD return the Resource Response: "Resource updated successfully". If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Thumbnail / Icon Request

?p10={apikey}&p20={useruuid}&type={ folder | people | file }&name={ folderuuid | fileuuid | useruuid | 'folder' | 'people }&ext={ file extension desired }

Example

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvue&type=file&name=hg3v23ghj4hb34hhjhjg34&ext=PDF

would request to get the Thumbnail / Icon for the PDF version of the file with that fileuuid. If there was also. a DOCX version of the file then the 'ext' part of the request would change to DOCX

Note this is a query string and not a payload. The client MUST append this string to the Thumbnail / Icon URL.

The Icon is https://XXXXX.intelligencebank.com/webapp/1.0/icon?

The client MUST use GET when executing this request.

Notes

  1. If a name is provided but a custom icon cannot be found, and a client default Thumbnail / Icon cannot be found then the default icon for the type is returned.

  2. If the name and type and ext parameters are missing it will return the default resource Thumbnail / Icon

  3. If a name is provided and the type is set to file and a valid ext is provided, then the ext Thumbnail / Icon is returned, otherwise the default resource icon is returned.

Upon successful completion of this operation, the server SHOULD return the requested file. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Download Presets Request

?p10={apikey}&p20={useruuid}

Example

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef

would request all the saved download presets.

Note this is a query string and not a payload. The client MUST append this string to the Download Presets URL. The client MUST use GET when executing this request.

The Download Presets URL is https://XXXXX.intelligencebank.com/webapp/1.0/downloadpresets

Upon successful completion of this operation, the server SHOULD return the Download Preset Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Comments Request

?p10={apikey}&p20={useruuid}&fileuuid={  fileuuid  }

Example

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&fileuuid=hg3v23ghj4hb34hhjhjg34

would request to get any comments for the file with that fileuuid.

Note this is a query string and not a payload. The client MUST append this string to the Comment URL. The client MUST use GET when executing this request.

The Comments URL is https://XXXXX.intelligencebank.com/webapp/1.0/comments

Upon successful completion of this operation, the server SHOULD return the Comment Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Comment

?p10={apikey}&p20={user id}&fileuuid={ fileuuid }&version={version number}

Example

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&type=file&fileuuid=hg3v23ghj4hb34hhjhjg34comment=some%20text%20goes%20for%20a%20comment

would create the comment and attach it to the file with that fileuuid. If there is a version number as part of the request then the comment will be attached to that version of the file, otherwise it will be attached to the latest version.

Note this payload is simple key/value pairs. The client MUST use POST to send this payload to the Comment URL.

The Comments URL is https://XXXXX.intelligencebank.com/webapp/1.0/comments

You SHOULD use the following header

Content-Type: application/x-www-form-urlencoded 

Upon successful completion of this operation, the server SHOULD return the Comment Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Sync

?p10={apikey}&p20={user id}

POST data

apikey={apikey}&useruuid={user id}

&sync=[{"folders":[<one or more folderuuids>]},{"files":[{<fileuuid>,<updatedat>,<optional annotations>]}]

Example

apikey=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&useruuid=3nj34hvdsjds8dnfnfd87bhbvuef

&sync=[{"folders":["06da9efd9e96a973015a5571b65d4b6c","334j3jkh3dsf76dsf7sdf7sdb6c"]},{"files":[{"fileuuid":"hg3v23ghj4hb34hhjhjg34dfsf","updatedat":"2015-01-01 11:00:00","annotation":{"annotation data"}]}]

would ask for the sync data for the two folders with uuids listed and for the file with that fileuuid, which has been updated with a new annotation.

Note this payload is a key/value pair with the value of the sync key being a JSON format document. The client MUST use POST to send this payload to the Sync URL.

The Sync URL is https://XXXXX.intelligencebank.com/webapp/1.0/sync

You SHOULD use the following header

Content-Type: application/x-www-form-urlencoded 

Upon successful completion of this operation, the server SHOULD return the Sync Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.


Search Request

?p10={apikey}&p20={useruuid}&searchterm={  word or words to search for  }&folderuuid= {folder uuid to start search from }&fromdate={ date to search from in format YYYY-MM-DD}skip={starting position}&limit={number of resources to return}

The folderuuid and fromDate fields are optional.

Examples

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&searchterm=supercalifraj

would request to get any documents that contain the term 'supercalifraj'

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&searchterm=super%20nova

would request to get any documents that contain the term 'super' or the term 'nova'

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&searchterm=*&fromDate=2017-01-01

would request to get all documents updated or created since Jan 1 2017

p10=adsferdftfgryfhgutjgiyhkgjhutyrgdnbvjhj&p20=3nj34hvdsjds8dnfnfd87bhbvuef&searchterm=*&fromDate=2017-01-01T10:20:09Z

would request to get all documents updated or created since Jan 1 2017, at 10:20:09 UTC

skip={starting position}&limit={number of resources to return}

If the limit parameter is included in the request then the number of resources returned will be the value of the limit parameter, starting from the first resource if there is no skip value present, or from the value of the skip parameter if it is present.

If the skip parameter is included in the request and the limit parameter is not then the resources returned will be those starting from the skip value and ending at the last resource.

The skip value is zero indexed based i.e. the first resource resides at skip=0. If the skip parameter is not included in the request then the starting point will be as if a skip value of 0 was included. If the skip value is larger than the number of resources in the folder, then no resource element will be returned.

The maximum number of results that can be returned at once is 100.

Note this is a query string and not a payload. The client MUST append this string to the Search URL. The client MUST use GET when executing this request.

The Search URL is https://XXXXX.intelligencebank.com/webapp/1.0/search

Notes:

  • If folderuuid is not present in the URL then the search will start from the root folder.

  • Search requests responses cannot currently be paginated.

  • If there is more than a single word in the searchterm then the term MUST be properly encoded with %20 or %2B for any spaces in the searchterm

Upon successful completion of this operation, the server SHOULD return the Search Response. If the operation is not successful, the server MUST return the appropriate HTTP status code and the Error Response.

Responses

Below is a list of the common responses from the server:


Login Response

The HTTP status code is returned with the following cookie

_aid: <aid cookie>

and the following body:

{
    "clientid":<clientid>,
    "clientname":"<clientname>",
    "clientuuid":"clientuuid",
    "apikey":"<apikey>",
    "logintimeoutperiod":<login timeout in hours>,
    "adminemail":"conatct email for site",
    "passwordexpiryperiod":<password expiry days | null>,
    "userverificationperiod":<user verify in days | null>,
    "offlineexpiryperiod":<days offline till expiry>,
    "annotations":"<basic | advanced | null>",
    "comments":"< 1 | null",
    "passwordexpired":< 1 | null>,
    "emailexpired":< 1 | null>,
    "versions":"< 1 | null>",
    "firstname":"<users firstname>",
    "lastname":"<users lastname>",
    "useruuid":"<user uuid>",
    "thumbnail":"<rel url for user thumbnail>",
    "foldericon":"<icon type for folder>",
    "rowsOnPage":"<number of rows per page>",
    "defaultFolderSortOrder":"<sort order for folders>"
}

The server SHOULD return this response when the POST /login operation is successful.

The _aid value returned in the cookie of the header is required in the header for all subsequent operations.


Folder Response

The HTTP status code is returned with the following body:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 { "response": { "hasversions":"< 1 if versions is enabled | 0 >", "folder":[ { "folderuuid":"<folderuuid>", "name":"<folder name>", "description":"<folder description>", "createdtime":"<UTC datetime created>", "comments":"<has comments>", "perm":"<permission level for this user for this folder", "children": { "folders":"<number of subfolders>", "resources":"<number of resource files>" }, "defaultorder":"<default order for resources>", "sortorder":"<sequence number for ordering within parent folder>" },                     {                         ... another folder                     } ], "resource":[ { "resourceuuid":"<resource uuid>", "resourcetype":"<resource type - file>", "seen":"< 1 if user has opened this resource>", "title":"<name of resource>", "description":"<description of resource>", "sortorder":"<sequence number for ordering within folder for viewing>", "updatedat":"<UTC datetime updated>", "processedat":"<UTC datetime file was processed>", "updatedby":"<firstname lastname of user who last updated or created file>", "ownershiptype":"<ownership type>", "tags":[<any keywords for this file>], "fileuuid":"<file uuid>", "filetype":"<file type extension>", "filesize":"<size of file in bytes>",                         "prevfiletype":"<type of preview file>",                         "prevfilesize":"<file size in bytes of preview file>", "origfilename":"<original filename including extension>", "resourcedate":"<UTC date file created or date set by user>", "uploadedtime":"<UTC datetime file was uploaded>", "reviewdate":"<UTC datetime for review of ile if set>", "printing":"< 1 if printing allowed>", "version":"<version number>", "annotations":"<whether file has annotations>", "versions":[ { "versionnumber":"<version number>", "origfilename":"<original filename including extension>", "filetype":"<file type extension>", "filesize":"<file siz ein bytes>", "datecreated":"<UTC datetime when file created>", "comment":"<any comments on file>", "createdby":"<firstname lastname of user who created file>", "ownershiptype":"<ownership type>" } ] } ] } }

The server SHOULD return this response when the GET Root Folder Request, Folder Request, Create Folder, Update Folder  operations are successful.


Resource Response

The HTTP status code is returned with the following body:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 { "response": { "resource":[ { "resourceuuid":"<resource uuid>", "resourcetype":"<resource type - file>", "seen":"< 1 if user has opened this resource>", "title":"<name of resource>", "description":"<description of resource>", "sortorder":"<sequence number for ordering within folder for viewing>", "updatedat":"<UTC datetime updated>", "processedat":"<UTC datetime file was processed>", "updatedby":"<firstname lastname of user who last updated or created file>", "ownershiptype":"<ownership type>", "tags":[<any keywords for this file>], "fileuuid":"<file uuid>", "filetype":"<file type extension>", "filesize":"<size of file in bytes>",                         "prevfiletype":"<type of preview file>",                         "prevfilesize":"<file size in bytes of preview file>", "origfilename":"<original filename including extension>", "resourcedate":"<UTC date file created or date set by user>", "uploadedtime":"<UTC datetime file was uploaded>", "reviewdate":"<UTC datetime for review of ile if set>", "printing":"< 1 if printing allowed>", "version":"<version number>", "annotations":"<whether file has annotations>", "versions":[ { "versionnumber":"<version number>", "origfilename":"<original filename including extension>", "filetype":"<file type extension>", "filesize":"<file siz ein bytes>", "datecreated":"<UTC datetime when file created>", "comment":"<any comments on file>", "createdby":"<firstname lastname of user who created file>", "ownershiptype":"<ownership type>" } ] } ] } }

The server SHOULD return this response when the Create Resource Request and Update Resource Request operations are successful.

The HTTP status code is returned with the following body:

1 2 3 { "estimatedFileSize": "<estimated size of the file after parameters have been applied in bytes>" }

The server SHOULD return this response when the GET Resource Request with { fileinfo=true } has  been  successful.


Comment Response

The HTTP status code is returned with the following body:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "response": { "comment":{ "commentid":"<comment id> ", "comment":"<comment text>", "createdat":"<UTC datetime created>", "createdby":"<firstname lastname of user who created file>", "updatedat":"<UTC datetime updated>", "updatedby":"<firstname lastname of user who last updated or created file>", "version":"<version number>",                         "iconuuid":"<uuid of icon of creator>", } } }

The server SHOULD return this response when the GET Comment Request operation is successful.


Sync Response

The HTTP status code is returned with the following body:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 { "folders":         {             "folder":[                 {                     "folderuuid":"<folder uuid>",                     "hasversions":"< 1 if versions enabled, 0 if not >",                     "perm":"< permission level >",                     "resource":[                         {                             "resourceuuid":"<resource uuid>",                             "resourcetype":"<resource type>",                             "seen":"< 1 if previosly accessed, 0 if not >",                             "title":"<name of resource>",                             "description":"<description>",                             "sortorder":<sequence order in folder listing | null>,                             "processedat":"<UTC datetime processed>",                             "updatedat":"<UTC datetime updated>",                             "updatedby":"<firstname lastname of user who last updated>",                             "tags":[<keywords to be linked to resource>],                             "uploadedtime":"<UTC datetime file uploaded>",                             "fileuuid":"<file uuid>",                             "filetype":"<file type extension>",                             "filesize":"<file size in bytes>",                             "prevfiletype":"<type of preview file>",                             "prevfilesize":"<file size in bytes of preview file>",                             "origfilename":"<original filename>",                             "annotations":"<1 if annotations enabled or 0>",                             "annotation":[{<annotation data>},{ .. another annotation .. }],                             "resourcedate":"2015-05-14 05:12:47",                             "printing":"<1 if printing allowed or 0>",                             "version":"<version number>",                             "tree":[<list of folder uuids as folder tree for this resource>]                             "versions":[                                 {                                     "versionnumber":"<version number>",                                     "origfilename":"<original filename>",                                     "filetype":"<file type extension>",                                     "filesize":"<file size in bytes>",                                     "datecreated":"UTC datetime file uploaded",                                     "comment":<comments>,                                     "createdby":"<firstname lastname of creator>"                                 }]                         },{                              ..... next resource                         }                     ]                 },{                     ... next folder                   }               ]           },         {             "files":                 [                    file: {                             "status":"<deleted | updated | newfile | access denied>",                             "resourceuuid":"<resource uuid>",                             "resourcetype":"<resource type>",                             "seen":"< 1 if previosly accessed, 0 if not >",                             "title":"<name of resource>",                             "description":"<description>",                             "sortorder":<sequence order in folder listing | null>,                             "processedat":"<UTC datetime processed>",                             "updatedat":"<UTC datetime updated>",                             "updatedby":"<firstname lastname of user who last updated>",                             "tags":[<keywords to be linked to resource>],                             "uploadedtime":"<UTC datetime file uploaded>",                             "fileuuid":"<file uuid>",                             "filetype":"<file type extension>",                             "filesize":"<file size in bytes>",                             "prevfiletype":"<type of preview file>",                             "prevfilesize":"<file size in bytes of preview file>",                             "origfilename":"<original filename>",                             "annotations":"<1 if annotations enabled or 0>",                             "annotation":[{<annotation data>},{ .. another annotation .. }],                             "resourcedate":"<UTC datetime created>",                             "resourcedate":"<UTC datetime review due>",                             "printing":"<1 if printing allowed or 0>",                             "version":"<version number>",                             "tree":[<list of folder uuids as folder tree for this resource>]                             "versions":[                                 {                                     "versionnumber":"<version number>",                                     "origfilename":"<original filename>",                                     "filetype":"<file type extension>",                                     "filesize":"<file size in bytes>",                                     "datecreated":"UTC datetime file uploaded",                                     "comment":<comments>,                                     "createdby":"<firstname lastname of creator>"                                     "prevfiletype":"<type of preview file>",                                     "prevfilesize":"<file size in bytes of preview file>",                                 }],                         }             ]     } }

The server SHOULD return this response when the Sync Payload operation is successful.


Search Response

The HTTP status code is returned with the following body:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 {     "numFound":"7",     "doc":[         {             "uuid":"15e617346a2cc44edd72e59d86559b90",             "title":"Version Test",             "description":"",             "id":"250597",             "ext":"PDF",             "data":{                 "location":"content",                 "snippet":{                     "ib_title":"Version <em>Test</em>"                 }             },             "file":                              {                     "resourceuuid":"<resource uuid>",                             "resourcetype":"<resource type>",                             "seen":"< 1 if previosly accessed, 0 if not >",                             "title":"<name of resource>",                             "description":"<description>",                             "sortorder":<sequence order in folder listing | null>,                             "processedat":"<UTC datetime processed>",                             "updatedat":"<UTC datetime updated>",                             "updatedby":"<firstname lastname of user who last updated>",                             "tags":[<keywords to be linked to resource>],                             "uploadedtime":"<UTC datetime file uploaded>",                             "fileuuid":"<file uuid>",                             "filetype":"<file type extension>",                             "filesize":"<file size in bytes>",                             "prevfiletype":"<type of preview file>",                             "prevfilesize":"<file size in bytes of preview file>",                             "origfilename":"<original filename>",                             "annotations":"<1 if annotations enabled or 0>",                             "annotation":[{<annotation data>},{ .. another annotation .. }],                             "resourcedate":"<UTC datetime created>",                             "resourcedate":"<UTC datetime review due>",                             "printing":"<1 if printing allowed or 0>",                             "version":"<version number>",                             "tree":[<list of folder uuids as folder tree for this resource>]                                       "versions":[                                 {                                     "versionnumber":"2",                                     "origfilename":"<original filename>",                                     "filetype":"<file type extension>",                                     "filesize":"<file size in bytes>",                                     "datecreated":"<UTC datetime file uploaded>",                                     "comment":<comments>,                                     "createdby":"<firstname lastname of creator>"                                                            "prevfiletype":"<type of preview file>",                                     "prevfilesize":"<file size in bytes of preview file>",                                             },{                                     "versionnumber":"1",                                     "origfilename":"<original filename>",                                     "filetype":"<file type extension>",                                     "filesize":"<file size in bytes>",                                     "datecreated":"<UTC datetime file uploaded>",                                     "comment":"<comments>",                                     "createdby":"<firstname lastname of creator>"                                                            "prevfiletype":"<type of preview file>",                                     "prevfilesize":"<file size in bytes of preview file>",                                             }                             ]                     }}         ]

}

The server SHOULD return this response when the Search Request operation is successful.


Download Presets Response

The HTTP status code is returned with the following body:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 {     "presets":[         {             "uuid":"15e617346a2cc44edd72e59d86559b90",             "name":"Preset Test",             "fileType":"png",             "compressionQuality":"60",             "compressionType":"1",             "fileSize":"custom",             "customWidth":200                        "customHeight":200,             "cropWidth":null,             "cropHeight":null,             "id":3322362,         },         {             ... next download preset         }     ] }

The server SHOULD return this response when the Download Preset Request operation is successful.


No Content Response

The HTTP status code is returned with no body.

The server SHOULD return this response when the Delete Folder Request, Delete Resource Request, Rest Request and Comment Payload  operations are successful


Error Response

The HTTP status code returned is in the 4xx or 5xx family and an appropriate error message is included in the body.