GET All Files
Endpoint ini mengambil semua file dari drive Anda.
Endpoint API
GET https://drive.nyanhosting.id/api/v1/drive/file-entries
Parameter Query
Parameter | Tipe | Deskripsi |
---|---|---|
perPage | integer | Jumlah item per halaman |
workspaceId | integer | Identifikasi workspace |
Contoh
cURL
curl -X 'GET' \
'https://drive.nyanhosting.id/api/v1/drive/file-entries?perPage=50&workspaceId=0' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'
PHP (menggunakan cURL)
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://drive.nyanhosting.id/api/v1/drive/file-entries?perPage=50&workspaceId=0',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'accept: application/json',
'Authorization: Bearer YOUR_TOKEN'
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Node.js (menggunakan axios)
const axios = require('axios');
const config = {
headers: {
'accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
};
axios.get('https://drive.nyanhosting.id/api/v1/drive/file-entries?perPage=50&workspaceId=0', config)
.then(response => console.log(response.data))
.catch(error => console.error(error));
Contoh Respon
[
{
"id": 0,
"name": "image.png",
"file_name": "j6oWHDG1z613UqFHLZpE1Yrqngw0N8XLuGNLNWJV",
"file_size": 111863,
"parent_id": 1,
"parent": "string",
"thumbnail": "thumbnail.png",
"mime": "image/png",
"url": "secure/uploads/3260",
"hash": "MzI2MHxwYWRkaQ",
"type": "image",
"description": "Contoh deskripsi yang dimasukkan pengguna",
"deleted_at": "2021-02-23T14:42:38.000000Z",
"created_at": "2021-02-23T14:42:38.000000Z",
"updated_at": "2021-02-23T14:42:38.000000Z",
"path": "3260/3261/3262",
"users": [
{
"id": 0,
"email": "[email protected]"
}
]
}
]