Kabeers Drive Files API


After user has Signed into their Kabeers Drive Account access their files and folders with This API

*IMPORTANT
The first example shows getting files from users "My Drive" (Root) Folder, the second example shows getting files and folders from folders users Sub Folder.



//Run Auth Once Each Session if (!sessionStorage.auth) { auth(); sessionStorage.auth = "true"; } //Call Functions After Auth renderFiles(); function auth() { var USERNAME = "KABEERS DRIVE USERNAME"; var PASSWORD = "KABEERS DRIVE PASSWORD"; $.ajax({ type: "GET", url: "http://drive.hosted-kabeersnetwork.unaux.com/server/api/login.php", dataType: 'json', headers: { "Authorization": "Basic " + btoa(USERNAME + ":" + PASSWORD) }, data: '', success: function (data) { sessionStorage.auth = "true"; // AUTHORIZED console.log("authoirzed"); } }); } /* MAIN FUNCTION TO GET & RENDER FILES AND FOLDERS */ //Getting folders and files from users "My Drive (ROOT)" folder function renderFiles() { $.getJSON("http://drive.hosted-kabeersnetwork.unaux.com/server/api/my-drive.php", function (data) { for (var i = 0; i < data.Files.length; i++) { console.log(data.Files[i]); } }); } //Getting folders and files from other folders by "ID" function renderFiles(folderid) { $.getJSON("http://drive.hosted-kabeersnetwork.unaux.com/server/api/folder.php?id=" + folderid, function (data) { for (var i = 0; i < data.Files.length; i++) { console.log(data.Files[i]); } }); }


This is a sample on how you can implement accessing Folders and Files from inside your App.
The response will look the same for accessing user's My Drive (ROOT) folder and accessing files from any other folder by ID.


Example Response


{
  "TotalFolders": 4,
  "Folders": [
    {
      "name": "Random Folder",
      "id": "ef42b8e0388a8ceaa78c6dc127ce2038",
      "shared": "1",
      "owner": "test",
      "dateCreated": "2020-05-31 23:21:09.003038",
      "dateModified": "2020-05-31 23:22:00.360854"
    },
    {
      "name": "A Folder",
      "id": "gds5bc7e15226a9fc9362d692f326d5",
      "shared": "0",
      "owner": "test",
      "dateCreated": "2020-05-31 23:21:09.003038",
      "dateModified": "2020-05-31 23:22:00.360854"
    },
    {
      "name": "Another Folder",
      "id": "8f4c5dfe805005753ce9befe770193a6",
      "shared": "0",
      "owner": "test",
      "dateCreated": "2020-05-31 23:21:09.003038",
      "dateModified": "2020-05-31 23:22:00.360854"
    },
    {
      "name": "My Design Project",
      "id": "243c6e9b86f26723b8f88ad5ccf7cc1f",
      "shared": "0",
      "owner": "test",
      "dateCreated": "2020-05-31 23:21:09.003038",
      "dateModified": "2020-05-31 23:22:00.360854"
    }
  ],
  "TotalFiles": 4,
  "Files": [
    {
      "name": "File.php",
      "id": "5sr0ab16f85c013f24bb1927ea2fe3fe",
      "size": "3831",
      "path": "http://drive.hosted-kabeersnetwork.unaux.com/user-files/asd7f4e64ec60f0186ad643662f8665f8160ab16f85c013f24bb1927ea2fe3fe.php",
      "shared": "1",
      "mime": "text/x-php",
      "owner": "test",
      "thumbnail": "http://docs-kabeersnetwork-kview-app-sta.rf.gd/icons/code.svg",
      "dateCreated": "2020-05-26 19:26:36.610244",
      "dateModified": "2020-05-26 19:26:36.610244"
    },
    {
      "name": "Image.png",
      "id": "bc5e1d62bf9d14f6c77eeff4b389b67f",
      "size": "20688",
      "path": "http://drive.hosted-kabeersnetwork.unaux.com/user-files/cdb6ca4fa21f78d0f89091a877955b2fbc5e1d62bf9d14f6c77eeff4b389b67f.png",
      "shared": "0",
      "mime": "image/png",
      "owner": "test",
      "thumbnail": "http://docs-kabeersnetwork-kview-app-sta.rf.gd/icons/image.svg",
      "dateCreated": "2020-05-28 15:41:33.248536",
      "dateModified": "2020-05-31 23:13:55.376475"
    },
    {
      "name": "Another Image.png",
      "id": "00f5ea354c919saf4d813061b7b20324",
      "size": "20582",
      "path": "http://drive.hosted-kabeersnetwork.unaux.com/user-files/a4c5e81a6b130b88234ed865ca449ed600f5ea354c919b5f4d813061b7b20324.png",
      "shared": "0",
      "mime": "image/png",
      "owner": "test",
      "thumbnail": "http://docs-kabeersnetwork-kview-app-sta.rf.gd/icons/image.svg",
      "dateCreated": "2020-05-28 15:41:33.311608",
      "dateModified": "2020-05-28 15:41:33.311608"
    },
    {
      "name": "Another File.js",
      "id": "19feaaf8c9f6e799b5946810b3d22c79",
      "size": "1787",
      "path": "http://drive.hosted-kabeersnetwork.unaux.com/user-files/232d8bac43970a339d015dc42f677efb19feaaf8c9f6e799b5946810b3d22c79.js",
      "shared": "1",
      "mime": "text/plain",
      "owner": "test",
      "thumbnail": "http://docs-kabeersnetwork-kview-app-sta.rf.gd/icons/js.svg",
      "dateCreated": "2020-05-28 15:46:22.302059",
      "dateModified": "2020-05-28 15:46:22.302059"
    }
  ]
}



Response Details

For Files:

name id size path shared mime owner thumbnail dateCreated dateModified
1 Defines the name of the File.
Can Be Changed.
Unique id of current file.
Every File has an uneditable id.
Size of current file. Where this file been stored on Kabeers Network Servers. If the file has link sharing enabled.
0 if file isn't shared & 1 if shared.
Mime Type of this file. Owner of this file.
Account used to upload this file.
Thumbnail of this file.
Thumbnail for this file. Preview for image and static icons for all other formats.
When this file was created or uploaded.
Remains same.
When actions e.g. renaming was done on this file.
Can Be Changed based on user actions.


For Folders:

name id shared owner dateCreated dateModified
1 Defines the name of the Folder.
Can Be Changed.
Unique id of current Folder.
Every Folder has an uneditable id.
If the folder has link sharing enabled.
0 if folder isn't shared & 1 if shared.
Owner of this folder.
Account used to upload this folder.
When this file was created or uploaded.
Remains same.
When actions e.g. renaming was done on this file.
Can Be Changed based on user actions.


For More info Contact us at Kabeer11000@gmail.com.

© 2020 Kabeers Network | All Rights Reserved
Free Web Hosting