Add our tools to your projects!

Supercharge your apps! Our API gives you access to our tools.

Overview

Zeenshare’s API allows you to integrate Zeenshare in your own Information System.

If your need more info on this API or if you wish to use it, feel free to contact us.

Session methods

Create session

All API requests require a session to be opened on the server. When a session is opened, a sessionId is returned. This sessionId will be required in all following requests in order to identify the user. At the end of your request, you should close the session.

When you know the credentials of the user, you can create session with it:

GET or POST https://zeenshare.com/api/auth

Parameters:

login
- login of the user (most of the time the email)
pwd
- the password of the user

Else if you are in a team, you can use the team private key to open a session for a user:

GET or POST https://zeenshare.com/api/team/auth

Parameters:

login
- login of the user (most of the time the email)
teamName
- name of the team
teamPrivateKey
- private key of the team

Example of answer the request is a success:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "sessionId": "616ecf7caa6f5b245deadc7f4517f561bf02d7bbgcHYxD"
    }
}
					

Close session

When you don't need anymore the session, you should close it.

GET or POST https://zeenshare.com/api/logout

Parameters:

sid
- the Id of the session you want to close

Answer the request is a success:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": null
}
					

Folder methods

Get folder

Each folder has a Id. You can access to a folder with its Id. If you don't provide a specific Id to get, you will access to the root folder.

GET or POST https://zeenshare.com/api/folder/get

Parameters:

sid
- the Id of the session
folderId
- the folder id. If not provided, the root folder will be returned
level
- specify the level of the tree structure you want to access. If not provided, we return the full folder tree structure of the returned folder.

Example of answer the request is a success:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type": "com.netsas.Folder",
        "id": "Cw85smNn0mjwWMj",
        "update": false,
        "name": "folder1",
        "folders": null,
        "documents": null,
        "owner": "mymail@mycompany.com",
        "group": null,
        "coworkers": {
            "mymail@mycompany.com": 1358262482336
        },
        "permissions": {
            "mymail@mycompany.com": [
                "FOLDER_OWNER"
            ]
        },
        "root": false,
        "loaded": false,
        "parentIds": [
            "mymail@mycompany.com"
        ]
    }
}
					

Create folder

On all your folder, you can create subfolders. You have to specify the id of the folder in wich you want to create the subfolder, and the name of the folder to create.

GET or POST https://zeenshare.com/api/folder/create

Parameters:

sid
- the Id of the session
name
- folder name to create
parentId
- id of the parent folder. The new folder will be inserted in this folder.

If the request is a success, we return a FolderNewActivity.

Example:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type": "com.netsas.activity.folder.FolderNewActivity",
        "id": "9223370678084205837_758703409",
        "from": "mymail@mycompany.com",
        "date": 1358784315477,
        "read": true,
        "folderName": "New folder name",
        "folderId": "A8rEBwtNbi8seR0",
        "parentFolderId": "mymail@mycompany.com",
        "parentFolderName": "Parent folder Name"
    }
}
					

Remove folder

Remove a folder from an other folder.

GET or POST https://zeenshare.com/api/folder/delete

Parameters:

sid
- the Id of the session
folderId
- folder id to delete

If the request is a success, we return a FolderDeleteActivity.

Example:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type":"com.netsas.activity.folder.FolderDeleteActivity",
         "id": "9223370678084205837_758703409",
         "from": "mymail@mycompany.com",
         "date": 1358784315477,
         "read": true,
         "folderName": "Folder name",
         "folderId": "A8rEBwtNbi8seR0",
         "parentFolderId": "mymail@mycompany.com",
         "parentFolderName": "Parent folder Name"
    }
}
					

Rename folder

GET or POST https://zeenshare.com/api/folder/rename

Parameters:

sid
- the Id of the session
name
- the new folder name
folderId
- id of the folder to update

If the request is a success, we return a FolderRenameActivity.

Example:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type":"com.netsas.activity.folder.FolderRenameActivity",
         "id": "9223370678084205837_758703409",
         "from": "mymail@mycompany.com",
         "date": 1358784315477,
         "read": true,
         "folderName": "New folder name",
         "folderId": "A8rEBwtNbi8seR0",
         "folderOldName": "Old folder Name"
    }
}
					

Document methods

Get document

Each document has a Id. You can access to a document with its Id.

GET or POST https://zeenshare.com/api/document/get

Parameters:

sid
- the Id of the session
docId
- the document id

Example of answer the request is a success:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type": "com.netsas.Document",
        "id": "6KMN6d2mL8RPGoX",
        "update": false,
        "versions": [
            {
                "type": "com.netsas.DocumentVersion",
                "id": "iJcn7M",
                "update": false,
                "mediaId": "6KMN6d2mL8RPGoX",
                "size": 1826146,
                "creationDate": 1340725668241,
                "lastModificationDate": 1340725668241,
                "sentDate": null,
                "from": "mymail@mycompany.com",
                "read": false,
                "name": "myDocument.doc",
                "description": null,
                "pages": [
                    {
                        "type": "com.netsas.Page",
                        "id": "6KMN6d2mL8RPGoX_iJcn7M_0000",
                        "update": false,
                        "width": 3556,
                        "height": 2454,
                        "unit": "PX"
                    }
                ],
                "comments": [ ],
                "loaded": true,
                "crc32": "3954719873",
                "converted": true,
                "utilDate": 1340725668241
            }
        ],
        "loaded": true,
        "deletedDate": null,
        "owner": "mymail@mycompany.com",
        "group": null,
        "coworkers": {
            "mymail@mycompany.com": 1340725668295
        },
        "name": "test.jpg",
        "lastActivityDate": 1340725668241,
        "thumbUrl": "/api/document/download/page?docId=6KMN6d2mL8RPGoX&docVersionId=iJcn7M&proxyType=S160",
        "folders": [
            "mymail@mycompany.com"
        ],
        "shareProperties": null,
        "unreadHistoryElements": 0,
        "crc32": "3954719873",
        "properties": { }
    }
}
					

Upload document

Documents can be uploaded as a new document in a folder, or as a new version of an existing document. In the first case, you have to provide the project id, and in the second case you have to provide the document id in which you want to add a new version.

New document:

GET or POST https://zeenshare.com/api/document/upload

Parameters:

sid
- the Id of the session
folderId
- the document id
name
- the document name. If not set, we use the original name of the document found in the uplaod request
replace
- true of false. Default value is false. If true, and a file with the same name already exists in the folder, the file will replace the old file as a new version. If false, the file will be renamed

New version:

POST https://zeenshare.com/api/document/version/upload

Parameters:

sid
- the Id of the session
docId
- the document id

In both cases, the document must be passed as parameter in a multi-part POST parameter.

If the request is a success, we return a DocumentNewActivity.

Example:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type":"com.netsas.activity.document.DocumentNewActivity",
        "id": "9223370678084205837_758703409",
        "from": "mymail@mycompany.com",
        "date": 1358784315477,
        "read": true,
        "folderName": "Folder name",
        "folderId": "A8rEBwtNbi8seR0",
        "thumbUrl": "/api/document/download/page?docId=TVYkXcpzyxvC7ry&docVersionId=6tymxd&proxyType=S160",
        "documentId": "TVYkXcpzyxvC7ry",
        "name": "myDoc.doc"
    }
}
					

Remove document

Remove a document from a folder.

GET or POST https://zeenshare.com/api/document/delete

Parameters:

sid
- the Id of the session
docId
- document id to delete

If the request is a success, we return a DocumentDeleteActivity.

Example:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type":"com.netsas.activity.document.DocumentDeleteActivity",
        "id": "9223370678084205837_758703409",
        "from": "mymail@mycompany.com",
        "date": 1358784315477,
        "read": true,
        "fromFolderName": "Folder name",
        "fromFolderId": "A8rEBwtNbi8seR0",
        "documentId": "TVYkXcpzyxvC7ry",
        "name": "myDoc.doc"
    }
}
					

Rename document

GET or POST https://zeenshare.com/api/document/rename

Parameters:

sid
- the Id of the session
name
- the new document name
docId
- id of the document to update

If the request is a success, we return the same answer as the document get request, with the new document name.

If the request is a success, we return a DocumentRenameActivity.

Example:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": {
        "type":"com.netsas.activity.document.DocumentRenameActivity",
        "id": "9223370678084205837_758703409",
        "from": "mymail@mycompany.com",
        "date": 1358784315477,
        "read": true,
        "oldDocumentName": "myDoc.doc",
        "documentName": "myNewDoc.doc",
        "documentId": "A8rEBwtNbi8seR0",
        "folderName": "Folder name",
        "folderId": "A8rEBwtNbi8seR0"
    }
}
					

Update document properties

Each document has a properties field. It's a JSON object to store any information you need about document, like size, tag, price, attachment, and so one. You can update this field with this request:

GET or POST https://zeenshare.com/api/document/properties/save

Parameters:

sid
- the Id of the session
docId
- id of the document to update
properties
- JSON properties object. Exemple {"field1": "value1", "field2":"value2"}

Activity methods

An activity represents an action done on a zeenshare account. For all actions done, you will have a corresponding action that indicates what has been done.

You can find all type of activities on the activity description page.

List activity

This methods list all activities done on the connected account. It can be used you need to synchronize your files with zeenshare servers, to be informed about zeenshare activity on your account. It can also be used when you need to resume what happen recently on the account.

When you launch the request, you should specify a token, or a date. The request will return all activties next to this token, or who have a more recent date that the date specified. It allows you to be informed about all the activity since the last activity received (the token will be the id of the last activity), or since a date.

GET or POST https://zeenshare.com/api/activity/list

Parameters:

sid
- the Id of the session
pageToken
- id of the activity to start from. If specified, will return only activities next (in the ascending order) or before (in descending order) of the specified activity
fromDate
- date to start from. If specified, will return only activities next (in the ascending order) or before (in descending order) of the specified date. The fromDate paramted is used only if pageToken is not specified, or empty
wait
- true or false. (Default is false) If true, and there is no activity to return (because nothing happened for exemple), the request will wait for new activity to return it. If nothing happen during the max waiting time (30 sec), the request will return an empty response
asc
- true or false. (Default is true) If true, activities are returned in the date ascending order (less recent first). Else the descending order is used
pageSize
- Default is 100. Specify the max number of items to return. If you need to get next activity, you can use the last activity id as the pageToken parameter for the newt request

Example of answer the request is a success:

						{
                            "apiHeader": {
        "status": "OK",
        "errors": [ ],
        "warnings": [ ]
    },
                            "result": [
        {
            "type": "com.netsas.activity.folder.FolderRenameActivity",
            "id": "9223370678084205837_758703409",
            "update": false,
            "from": "mymail@mycompany.com",
            "date": 1358770569970,
            "read": true,
            "folderName": "My Folder Name",
            "folderId": "dHW2Xh4DUn8sqCa",
            "folderOldName": "New folder",
            "documentId": null
        }, ...
    ]
} 
					

The response is an array of activity objects. Here are the list of activity available today:

  • com.netsas.activity.folder.FolderRenameActivity