Retrieve Document Information
Retrieves information about a generated document
Endpoint URL | SDK Method |
---|---|
https://api.inkit.com/v1/document/{documentId} (GET) | Document.get() |
Request properties
Property | Type | Required | Description |
---|---|---|---|
documentId | String | Yes | The ID of a document that was previously generated. |
Response properties
Property | Type | Description |
---|---|---|
created_at | String | The date and time the document was generated. |
created_by | Object | The user or API name that generated the document. |
description | String | The description of the document object. |
expire_after_n_views | Integer | The number of views before the document expires. |
expire_at | String | The date and time the document expires. |
expire_views_left | Integer | The number of views remaining before the document expires. |
folder_id | String | The ID of the folder where the document resides. |
id | String | The ID of the document object. |
name | String | The name of the document object. |
overridden_fields | String | Deprecated. |
render_id | String | The render ID associated with the document. |
status | String | The document generation status. |
created_by
created_by
Property | Type | Description |
---|---|---|
first_name | String | The first name of the user who generated the document. |
last_name | String | The last name of the user who generated the document. |
name | String | The name of the API key that generated the document. |
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 data about a document
resp = inkit.Document.get('ENTER YOUR DOCUMENT ID')
# Print the JSON repsonse of the API call
print(json.dumps(resp.data, indent = 3))
except InkitResponseException as err:
# Print any error
print(err.response.data)
// Import Inkit Node.js package
const Inkit = require("inkit");
// Replace the string below with your API key
Inkit.apiToken = "ENTER YOUR API KEY";
// Call document get
getDocument();
// Get data about a document
async function getDocument() {
try {
const result = await Inkit.Document.get('ENTER YOUR DOCUMENT ID');
// 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/ENTER_YOUR_DOCUMENT_ID \
--header 'X-Inkit-API-Token: ENTER YOUR API KEY' \
--header 'accept: application/json'
{
"created_at": "2023-08-10T13:56:56.355719Z",
"created_by": {
"first_name": "John",
"last_name": "Doe",
"name": "Default"
},
"description": null,
"expire_after_n_views": 1,
"expire_at": "2023-08-10T14:56:56.354788Z",
"expire_views_left": 1,
"folder_id": "fold_6UpetHRzr73eyl4jCbfYBl",
"id": "doc_5pqriA5z3nP8Dbowa8teP7",
"name": "test",
"overridden_fields": [],
"render_id": "rend_4zPWu29bxbhPWpRwXUBQcx",
"status": "Completed"
}
Updated about 1 year ago