List Folders
Lists private folders in Inkit Storage
Endpoint URL | SDK Method |
---|---|
N/A | Folder.list() |
Request properties
Property | Type | Required | Description |
---|---|---|---|
page | Integer | No | The page of the list you want to pull. The default is 1 . |
page_size | Integer | No | The number of records to pull per page. The default is 25 . |
sort | String | No | The sort key. If the key is preceded with a - , the request will sort the records in descending order. Otherwise it will sort in ascending order. |
search | String | No | The search key. The request will only return records with this key. |
Response properties
items
items
Property | Type | Description |
---|---|---|
created_at | String | The date and time the folder was created. |
created_by | Object | The user or API key that created the folder. |
description | String | The description of the folder. |
id | String | The ID of the folder. |
name | String | The name of the folder. |
updated_at | String | The date and time the folder was updated. |
created_by
created_by
Property | Type | Description |
---|---|---|
first_name | String | The first name of the user who generated the folder. |
last_name | String | The last name of the user who generated the folder. |
name | String | The name of the API key that generated the folder. |
Example request and response
# Import the Inkit Python package
import inkit
from inkit.exceptions import InkitResponseException
# Import json package
import json
# Replace the string below with your API key
inkit.api_token = "ENTER YOUR API KEY"
try:
# Get all folders
resp = inkit.Folder.list()
# Print the repsonse code of the API call
print(json.dumps(dict(resp.data), indent = 3))
except InkitResponseException as err:
# Print any error
print(err.response.data)
// Import the Inkit Node.js package
const Inkit = require("inkit");
// Replace the string below with your API key
Inkit.apiToken = "ENTER YOUR API KEY";
// Call list folder
listFolders();
// List folders
async function listFolders() {
try {
const result = await Inkit.Folder.list();
// Print the JSON response of the API call
console.log(JSON.stringify(result.data, null, 3));
} catch (error) {
// Print any error
console.error(error.response.status, error.response.statusText);
}
}
{
"items": [
{
"created_at": "Thu, 13 Jul 2023 15:20:29 GMT",
"created_by": {
"first_name": "John",
"id": 11034,
"last_name": "Doe",
"name": "Default"
},
"description": null,
"id": "fold_6UpetHRzr73eyl4jCbfYBl",
"name": "Render",
"updated_at": "Thu, 13 Jul 2023 15:20:29 GMT"
}
],
"metadata": {
"pagination": {
"current_page": 1,
"next_page": null,
"page_count": 1,
"page_size": 25,
"prev_page": null,
"total_count": 1
},
"sort": {
"key": "updated_at",
"order": 1
}
}
}
Updated 12 months ago