Retrieve Document Information

Retrieves information about a generated document

Endpoint URLSDK Method
https://api.inkit.com/v1/document/{documentId} (GET)Document.get()

Request properties

PropertyTypeRequiredDescription
documentIdStringYesThe ID of a document that was previously generated.

Response properties

PropertyTypeDescription
created_atStringThe date and time the document was generated.
created_byObjectThe user or API name that generated the document.
descriptionStringThe description of the document object.
expire_after_n_viewsIntegerThe number of views before the document expires.
expire_atStringThe date and time the document expires.
expire_views_leftIntegerThe number of views remaining before the document expires.
folder_idStringThe ID of the folder where the document resides.
idStringThe ID of the document object.
nameStringThe name of the document object.
overridden_fieldsStringDeprecated.
render_idStringThe render ID associated with the document.
statusStringThe document generation status.

created_by

PropertyTypeDescription
first_nameStringThe first name of the user who generated the document.
last_nameStringThe last name of the user who generated the document.
nameStringThe 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"
}