API for Files (URL)

Welcome to the  zipBoard  platform REST API reference. This API is essential for connecting remotely with zipBoard, regardless of whether you are building an application, scripting interactions with zipBoard or building some other integration. 

This page documents the REST resources available in the zipBoard platform, along with the expected HTTP response codes and sample requests for interacting with files in zipBoard.

Before you start working with the API, you will need to generate an API key and also get an idea of the URI Structure that needs to be followed. Please follow this article for more information on that.

Get Files

GET https://app.zipboard.co/api/v1/files

  • Returns all files visible to the currently logged in user.
  • For files to be visible, the user must be logged in and authenticated.

HEADERS

Content-Type                         application/json

Authorization                          Authorization token

URL Params
        Required:

None

        Optional:

id:                            String                                          id of the file to return the file

Body Params

        Required:

                None

        Optional:

                projectid                 String                                            project id to return files for that project

                 Owner                   Boolean                                         true to return files created by authenticated user

Request

var http = require('http');
Http.request({
   method: 'GET',
   url: `https://app.zipboard.co/api/v1/files`,
   body: {
   },
 });

Response

{
    "status": "Success",
    "status code": 200,
    "message": "Succesfully retrieved files.",
    "data": [
        {
            "createdByTransform": true,
            "_id": "9JBNNSuGKLvGsvuhE",
            "ownerId": "N6dRgcj2RkAwBu948",
            "projectId": "hoPjX5nfZomWKPsiw",
            "fileDescription": "",
            "filePath": "http://google.com",
            "uploadedAt": "2019-01-17T11:38:07.913Z",
            "isValid": true,
            "displayName": "google.com",
            "original": {
                "name": "google.com",
                "updatedAt": "2019-01-17T11:38:07.913Z",
                "size": 1,
                "type": "url"
            },
            "collectionName": "files"
        }
    ]
}

Create Files

POST https://app.zipboard.co/api/v1/files/   

  • Creates a new file for the project, data required (name, url, projectId).
  • To add a file to the project role of the current user should be Owner or Manager or reviewer or should be current project owner.
  • Returns the data of the newly created file.

HEADERS

Content-Type                          application/json

Authorization                          Authorization token

URL Params
        Required:

None

        Optional:

None

Body Params

        Required:

name                     String                                                      name of the file (string)

projectid                String                                                      project id where u want to store the file

url                          String                                                      URL for the file which user want to be(string)

        Optional:

                description            String                                                       Description for the file

Request

var http = require('http');
Http.request({
   method: 'POST',
   url: `https://app.zipboard.co/api/v1/files`,
   body: {
         name:"BING",
        projectid:"hoPjX5nfZomWKPsiw",
        url: "bing.com"
   },
 });<br>

Response

 {
    "_id": "Qfid4zJH3SC8LGibN",
    "message": "File successfully created!",
    "reviewurl": "http://localhost:3000/hoPjX5nfZomWKPsiw/Qfid4zJH3SC8LGibN/reviewboard",
    "data": [
        {
            "createdByTransform": true,
            "_id": "Qfid4zJH3SC8LGibN",
            "ownerId": "N6dRgcj2RkAwBu948",
            "projectId": "hoPjX5nfZomWKPsiw",
            "fileDescription": null,
            "filePath": "bing.com",
            "uploadedAt": "2019-01-24T09:25:54.437Z",
            "isValid": true,
            "displayName": "BING",
            "original": {
                "name": "BING",
                "updatedAt": "2019-01-24T09:25:54.437Z",
                "size": 1,
                "type": "url"
            },
            "collectionName": "files"
        }
    ]
}

Update Files

PUT https://app.zipboard.co/api/v1/files/:id

  • Updates the existing file for the user, data required (file id).
  • To update file the role of current user should be Owner or Manager or reviewer or should be current project owner.
  • Returns the data of the updated file.

HEADERS

Content-Type                          application/json

Authorization                          Authorization token

URL Params
        Required:

id:                           String                                            id for the file which needed to be updated

        Optional:

None

Body Params

        Required:

                At least one is required from optional Body Params (name, description or url).

        Optional:

                name                        String                                         name of the file

description                String                                         description of the file

                url                             String                                         URL for the file to be reviewed

Request

var http = require('http');
Http.request({
   method: 'PUT',
   url: `https://app.zipboard.co/api/v1/files/Qfid4zJH3SC8LGibN`,
   body: {
         name:"New_changed_name",
           },
 });

Response

 {
    "status": "Success",
    "status code": 200,
    "message": "File data successfully updated.",
    "data": [
        {
            "createdByTransform": true,
            "_id": "Qfid4zJH3SC8LGibN",
            "ownerId": "N6dRgcj2RkAwBu948",
            "projectId": "hoPjX5nfZomWKPsiw",
            "fileDescription": null,
            "filePath": "bing.com",
            "uploadedAt": "2019-01-24T09:25:54.437Z",
            "isValid": true,
            "displayName": "New_changed_name",
            "original": {
                "name": "BING",
                "updatedAt": "2019-01-24T09:25:54.437Z",
                "size": 1,
                "type": "url"
            },
            "collectionName": "files"
        }
    ]
}

Delete File

DEL https://app.zipboard.co/api/v1/files/:id

  • Deletes the existing file for the user, data required (file id).
  • To delete a file, the project role of the current user should be ‘Owner’ or ‘Manager’ or ‘Reviewer’ or should be the current project owner.
  • Return success message on file delete.

 HEADERS

Content-Type                         application/json

Authorization                          Authorization token

URL Params
        Required:

id:                           String                                            id for the file which needed to be deleted

        Optional:

None

Body Params

Request

var http = require('http');
Http.request({
   method: 'PUT',
   url: `https://app.zipboard.co/api/v1/files/pGvKbRrvC5Ncs7NeT`,
   body: {
           },
 });

 Response

{
    "status": "Success",
    "status code": 200,
    "message": "Succesfully retrieved files.",
    "data": [
        {
            "createdByTransform": true,
            "_id": "pGvKbRrvC5Ncs7NeT",
            "ownerId": "N6dRgcj2RkAwBu948",
            "projectId": "wwTyZFHpdXz3vXeWF",
            "fileDescription": null,
            "filePath": "google.com",
            "uploadedAt": "2019-01-14T10:36:59.892Z",
            "isValid": true,
            "displayName": "file___1001",
            "original": {
                "name": "file___1001",
                "updatedAt": "2019-01-14T10:36:59.892Z",
                "size": 1,
                "type": "url"
            },
            "collectionName": "files"
        }
    ]
}

If you have any questions, you can check out our Forum.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us