Kenesto Documents API
Kenesto Web API provides the same RESTful API that Kenesto web app and Kenesto Drive uses. You can use it for all the same operations for manipulating folders, documents and tasks. You must first be registered with Kenesto which means you must have an account in Kenesto to use the API.

Contents

Each method gets optional parameter called ud (userData) that returns same value. (To keep context or anything else)

Each method returns response status – ok or failed.

If it failed exception message is also returned.

Base URL: https://app.kenesto.com/Kenesto.Web.API/KDocuments.svc/

1.  Create Folder:

Request:

CreateFolder?t={token}&pid={parentFolderID}&fn={fileName}&fd={filedescription}&fk={keywords}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
pid string no Parent ID, if not supplied, root folder is assumed
fd string no Folder description
fk string no Folder key words
fn string yes Folder name
ud string no User Data – free text.

Response:

Type: Json Formatted String

Response Example

2.  Delete Folder:

Request:

DeleteFolder?t={0}&fid={folderID}&dc={deleteContent=true|false}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
fid guid no Folder ID, if not supplied, root folder is assumed
dc boolean no Delete content, default is false
ud string no User data – free text

Response:

Type: Json Formatted String

Response status – ok or failed

Response Example

3. List Items in Folder:

Request:

RetrieveDocuments?t={token}&fid={folderId}&ps={pageSize}&pn={pageNumber}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
fid guid no Folder ID, if not supplied, root folder is assumed
ps int no Page size – the max number of results that will return. Allowed values: 25, 100 and 200. If not sent – default value is 25. If forbidden value was sent – Throwing an exception.
pn int no Page number – the results page we want. Total results/Page size = number of pages. If requested page number is bigger than last page number – returning all results. If not sent – default value is 1.
ud string no User data – free text

Response:

Type: Json Formatted String

Response status – List of file versions – each version contains: file id and file name.

Response Example

4. List Document Versions:

Request:

RetrieveFileVersions?t={token}&fid={fileId}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
fid guid no Folder ID, if not supplied, root folder is assumed
ud string no User data – free text

Response:

Type: Json Formatted String

Response status – ok or failed

Response Example

5. Get Document Count:

Request:

RetrieveNumberOfDocuments?t={token}&fid={fileId}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
fid guid no Folder ID, if not supplied, root folder is assumed
ud string no User data – free text

Response:

Type: Json Formatted String

Response status – Number of items in root or specific folder

Response Example

{
“ResponseData”: {
“TotalDocuments”: “77”
},
“ResponseStatus”: “OK”,
“UserData”: null
}

6. Check In Document:

Request:

CheckIn?t={token}&dId={documentId}&cmnt={comment}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
did guid yes Document ID
cmnt string no Comment
ud string no User data – free text

Response:

Type: Json Formatted String

Response status – Number of items in root or specific folder

Response Example

7. Check Out Document:

Request:

CheckOut?t={token}&dId={documentId}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
did guid yes Document ID
ud string no User data – free text

Response:

Type: Json Formatted String

Response status – Number of items in root or specific folder

Response Example

8. Discard Check Out:

Request:

DiscardCheckOut?t={token}&dId={documentId}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
did guid yes Document ID
ud string no User data – free text

Response:

Type: Json Formatted String

Response status – Number of items in root or specific folder

Response Example

9. Check In Multiple Documents at Once:  

Request:

CheckInMultiple?t={token}&cmnt={comment}&ud={userData}

Http Method: Post

Content-Type: application/json

Parameters:

Name Type Required Description
cmnt string no Comment
ud string no User data – free text

Body parameters:

  • documentIds – an array of {document ids}

Example: { “documentIds”: [“6692d550-2583-4f2e-b918-45e0df168368”, “c8b45966-6b96-4e5c-a447-9bf52b60241c”]}

Response:

Type: Json Formatted String

Response status – OK or Failed

Response Example

{
“ResponseStatus”: “OK”,
“UserData”: null
}

10. Check Out Multiple Documents at Once:  

Request:

CheckOutMultiple?t={token}&ud={userData}

Http Method: Post

Content-Type: application/json

Parameters:

Name Type Required Description
documentIds guid array yes Array of document IDs
ud string no User data – free text

Body parameters:

  • documentIds – an array of document ids

Example: { “documentIds”: [“6692d550-2583-4f2e-b918-45e0df168368”, “c8b45966-6b96-4e5c-a447-9bf52b60241c”]}

Response:

Type: Json Formatted String

Response status – OK or Failed

Response Example

{
“ResponseStatus”: “OK”,
“UserData”: null
}

11. Download File:

Request:

DownloadFile?t={token}&fid={fileId}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
fid guid yes File ID
ud string no User data – free text

Response:

Type: URL

Response status – a URL that gives access to download the file for the next hour

Response Example

12. Share a Document

Request:

ShareDocument?t={token}&uid={userID}&ue={userEmail}&ud={userData}

Http Method: Post

Content-Type: application/json

Parameters:

Name Type Required Description
uid guid yes User ID
ue string no User Email
ud string no User Data
Body Parameters

Body parameters:

  • asset – object to be shared that contains the following properties:
    • ID – guid id of the shared documents
    • UsersPermissions – an array of user permissions, each permission contains the following properties:
      • ParticipantUniqueID – user email
      • FamilyCode – participants type. Possible values:
        • PARTICIPANT_USER – registered user
        • EXTERNAL_USER – external user
      • ForUpdate (Boolean – mandatory) – is permission for update
      • PermissionTypeValue – permission type, possible values:
        • NONE – no permissions
        • VIEW_ONLY – view only permission
        • ALLOW_DOWNLOAD – view and download permissions
        • ALLOW_UPDATE_VERSIONS – view download and update permissions
      • Allow Share (Boolean – default value is false) – weather or not shared user will be allowed to re-share

Allow Upload (Boolean – default value is false) – Applies for folders only, sets weather shared user will be able to upload documents to the shared folder

Body Example

Example (sharing a document with 2 participants):

{ “asset”: { “ID”: “c21c8e11-64f8-43fe-8826-bdc0fc459c8a”,

“UsersPermissions”[

{

“ParticipantUniqueID”: “lisa@kenestodemo.com”,

“FamilyCode”: “PARTICIPANT_USER”,

“ForUpdate” :  false,

“PermissionTypeValue” : “ALLOW_DOWNLOAD”,

“AllowShare” : false

},

{

“ParticipantUniqueID”: “jeff@kenestodemo.com”,

“FamilyCode”: “PARTICIPANT_USER”,

“ForUpdate” :  true,

“PermissionTypeValue” : “ALLOW_DOWNLOAD”,

“AllowShare” : true

}

]}

}

Response:

Type: Json Formatted String

Response status – OK or Failed

Response Example

{
“ResponseStatus”: “OK”,
“UserData”: null
}

13. Share multiple files with multiple users:

Request:

MultiSelectShare?t={token}& ue={userEmail}&ud={userData}

Http Method: Post

Content-Type: application/json

Parameters:

Name Type Required Description
ue string no User Email
ud string no User Data
Body Parameters

Body parameters:

  • shareObject – object to be shared that contains the following properties:
    • Items – an array of
    • UsersPermissions – an array of user permissions, each permission contains the following properties:
      • ParticipantUniqueID – user email
      • FamilyCode – participants type. Possible values:
        • PARTICIPANT_USER – registered user
        • EXTERNAL_USER – external user
      • ForUpdate (Boolean – mandatory) – is permission for update
      • PermissionTypeValue – permission type, possible values:
        • NONE – no permissions
        • VIEW_ONLY – view only permission
        • ALLOW_DOWNLOAD – view and download permissions
        • ALLOW_UPDATE_VERSIONS – view download and update permissions
      • Allow Share (Boolean – default value is false) – weather or not shared user will be allowed to re-share

Allow Upload (Boolean – default value is false) – Applies for folders only, sets weather shared user will be able to upload documents to the shared folder

Body Example

Example (sharing 2 documents and a folder with 2 participants):

{  “shareObject”: {

“UsersPermissions” :

[

{

“ParticipantUniqueID”: “lisa@kenestodemo.com”,

“FamilyCode”: “PARTICIPANT_USER”,

“ForUpdate” :  true,

“PermissionTypeValue” : “ALLOW_DOWNLOAD”,

“AllowShare” : true,

“AllowUpload” : false

},

{

“ParticipantUniqueID”: “jeff@kenestodemo.com”,

“FamilyCode”: “PARTICIPANT_USER”,

“ForUpdate” :  true,

“PermissionTypeValue” : “VIEW_ONLY”,

“AllowShare” : false,

“AllowUpload” : true

}

],

“Items”:

[

{

“Id” : “65eae021-980e-48fc-a1e8-ab34db662f8a”,

“Type” : “Document”

},

{

“Id” : “f8f8b756-f1f7-4995-a870-97a0889687c4”,

“Type” : “Folder”

},

{

“Id” : “f45b0d51-4637-403e-a6db-27949d887f0b”,

“Type” : “Document”

}

]

}

 

Response:

Type: Json Formatted String

Response status – OK or Failed

Response Example

14. Share a Folder

Request:

ShareFolder?t={token}&uid={userID}&ue={userEmail}&ud={userData}

Http Method: Post

Content-Type: application/json

Parameters:

Name Type Required Description
uid guid yes User ID
ue string no User Email
ud string no User Data
Body Parameters

Body parameters:

  • folder– object to be shared that contains the following properties:
    • ID – guid id of the shared documents
    • UsersPermissions – an array of user permissions, each permission contains the following properties:
      • ParticipantUniqueID – user email
      • FamilyCode – participants type. Possible values:
        • PARTICIPANT_USER – registered user
        • EXTERNAL_USER – external user
      • ForUpdate (Boolean – mandatory) – is permission for update
      • PermissionTypeValue – permission type, possible values:
        • NONE – no permissions
        • VIEW_ONLY – view only permission
        • ALLOW_DOWNLOAD – view and download permissions
        • ALLOW_UPDATE_VERSIONS – view download and update permissions
      • Allow Share (Boolean – default value is false) – weather or not shared user will be allowed to re-share

Allow Upload (Boolean – default value is false) – Applies for folders only, sets weather shared user will be able to upload documents to the shared folder

Body Example

{ “folder”: { “ID”: “f8f8b756-f1f7-4995-a870-97a0889687c4”,

“UsersPermissions”[

{

“ParticipantUniqueID”: “lisa@kenestodemo.com”,

“FamilyCode”: “PARTICIPANT_USER”,

“ForUpdate” :  false,

“PermissionTypeValue” : “ALLOW_DOWNLOAD”,

“AllowShare” : “false”

}

]}

Response:

Type: Json Formatted String

Response status – OK or Failed

Response Example

{
“ResponseStatus”: “OK”,
“UserData”: null
}

15. Upload Document:

It is a 3-step process:

  1. Get an url to upload the file: UploadFile
  2. Write the client code to upload the actual file contents
  3. Call to complete upload: UploadFileCompleted
1. Get an url to upload the file
Upload File

UploadFile?t={token}&p={path}&fd={fileDescription}&fk={fileKeyword}&fid={folderId}&bid={baseFileId}&ud={userData}

Name Required Description
p Yes Path:

Where client wants the file in Kenesto.

There are 2 options: file name with extension (meaning this file will be in root) or folder path with file name extension.

For example:

Test.txt – will create new file in the root folder.

Folder1\Folder2\Test.txt – will create new Folder1, new sub folder Folder2 and new Test.txt file in Folder2.

fd No File Description
fk No File Keyword
fid No Folder Id – if client wants to attach file to existing folder
bid No Base File Id – if client wants to update version for existing file

Upload File response:

Returns a URL that give access to upload file for the next 24 hours.

2. Write the client code to upload the actual file contents
Write Client Code

Use the url returned in the previous step to write that will upload the file to Kenesto temporary path. Please see the code sample written in C# below for guidance.

Code Example:

filePath – points to the local file in your computer from where you are uploading

url – the url returned from the previous step

static void WriteFile(string filePath, string url)

{

HttpWebRequest httpRequest = WebRequest.Create(url) as HttpWebRequest;

httpRequest.Method = “PUT”;

httpRequest.Timeout = System.Threading.Timeout.Infinite;

httpRequest.AllowWriteStreamBuffering = false;

httpRequest.ContentLength = new System.IO.FileInfo(filePath).Length;

using (Stream dataStream = httpRequest.GetRequestStream())

{

byte[] buffer = new byte[8000];

using (FileStream fileStream = new FileStream(filePath, FileMode.Open,          FileAccess.Read))

{

int bytesRead = 0;

while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) >0)

{

dataStream.Write(buffer, 0, bytesRead);

}

}

}

HttpWebResponse response = httpRequest.GetResponse() as HttpWebResponse;

}

3. Call to complete upload: UploadFileCompleted
Complete the upload

Http Method: Get

UploadFileCompleted?t={token}&u={url}&ud={userData}

  • URL – pre-signed URL (return value from the first step)

Upload File Completed response:

File upload to Kenesto.

16.  Delete Document:

Request:

DeleteAsset?t={token}&aid={assetId}&fc={familyCode}&ud={userData}

Http Method: Get

Content-Type: application/json

Parameters:

Name Type Required Description
aid guid no assetId same as document ID
fc string no Use family code “GENERAL”
ud string no User data – free text
URL Example
https://app.kenesto.com/Kenesto.Web.API/KDocuments.svc/DeleteAsset?t=FKHHJFGHH%2bI63lpJHjQDY00Xrx%2f6dtH2tfX2wv7qIlPMDA5dJLC9DRgTrSQ6qa6%2fNv7URDI601MvlQiI3NmdkenOubfBQ79Y0GhHbrVYIGGv8kptg%2bSq6zSa6BboHJEKjC6tcKFSnqT3tNj4gTWzSMVA0Oj%2fE%3d&aid=02917842-fe32-45b5-844b-775c0c848867&fc=GENERAL&ud=blabla

Response:

Type: Json Formatted String

Response status – ok or failed

Response Example

Need more help with Kenesto?

Contact Support

  • This field is for validation purposes and should be left unchanged.