List Documents
Lists documents and folders created
Endpoint URL | SDK Method |
---|---|
https://api.inkit.com/v1/document (GET) | Document.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. |
data_id | String | No | A comma-delimited list of Render IDs to return. |
destination_name | String | No | The request will only return records with this destination name. |
destination_status | String | No | The request will only return records with this destination status. |
Response properties
items
items
Property | Type | Description |
---|---|---|
created_at | String | The date and time the document or folder was created. |
created_by | Object | The user or API name that created the document or folder. |
description | String | The description of the document or folder. |
id | String | The ID of the document or folder created. |
modified_at | String | The date and time the document or folder was modified. |
name | String | The name of the document or folder. |
created_by
created_by
Property | Type | Description |
---|---|---|
first_name | String | The first name of the user who created the document or folder. |
last_name | String | The last name of the user who created the document or folder. |
name | String | The name of the API key that created the document or 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:
# List all documents and folders created
resp = inkit.Document.list()
# Print the JSON repsonse 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 document list
getDocumentList();
// List documents and folders created
async function getDocumentList() {
try {
const result = await Inkit.Document.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);
}
}
curl --request GET \
--url https://api.inkit.com/v1/document \
--header 'X-Inkit-API-Token: ENTER YOUR API KEY' \
--header 'accept: application/json'
{
"items": [
{
"created_at": "2023-07-13T15:20:29.270479Z",
"created_by": {
"first_name": "John",
"last_name": "Doe",
"name": "Default"
},
"description": null,
"id": "fold_6UpetHRzr73eyl4jCbfYBl",
"modified_at": "2023-07-13T15:20:29.270491Z",
"name": "Render"
},
{
"created_at": "2023-07-31T15:53:32.890830Z",
"created_by": {
"first_name": null,
"last_name": null,
"name": "John Doe"
},
"description": null,
"expire_after_n_views": null,
"expire_at": null,
"folder_id": null,
"id": "doc_3vlYXJc6sLKHYc57yGhWZS",
"name": "Mail Merge Ruby",
"render_id": "rend_2xR06TmBDXtJe6yvukJXS6",
"status": "Completed"
},
],
"metadata": {
"pagination": {
"current_page": 1,
"next_page": 2,
"page_count": 3,
"page_size": 25,
"prev_page": 3,
"total_count": 64
},
"sort": {
"key": "modified_at",
"order": 1
}
}
}
Updated about 1 year ago