Standard API request and response objects
The following request objects apply when generating documents in Inkit through the API:
The following response objects apply when retrieving lists of documents, batches, folders and templates through the API:
merge_parameters
merge_parameters
The merge_paremeters
object is where you store the key-value pairs that you'll use when generating your document. It will replace the fields that you have embedded in your document template with the data you supply here.
For example:
{
"merge_parameters": {
"Name": "John"
}
}
If you use the above merge_paremeters
when you generate your document, Inkit will replace the field Name
in your template with John
.
destinations
destinations
The destinations
object is where you provide details on how and where you want to store a generated document.
Note: You can specify multiple destinations when generating a document.
Inkit Storage
You specify data related to an Inkit Storage destination in a subobject called inkit_storage
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
name | String | No | The name of the generated document. |
folder_id | String | No | The ID of the folder that the document will be generated in. |
expire_after_n_views | Integer | No | The number of views of the generated document before it expires. |
retain_for | Object | No | The amount of time before the generated document expires. |
retain_for
retain_for
Property | Type | Required | Descriptions |
---|---|---|---|
minutes | Integer | No | The number of minutes before the document expires. |
hours | Integer | No | The number of hours before the document expires. |
days | Integer | No | The number of days before the document expires. |
months | Integer | No | The number of months before the document expires. |
years | Integer | No | The number of years before the document expires. |
For example:
{
"destinations": {
"inkit_storage": {
"retain_for": {
"hours": 1
},
"name": "Mail Merge",
"folder_id": "fold_6UpetHRzr73eyl4jCbfYBl",
"expire_after_n_views": 1
}
}
}
If you use the above destinations
object when generating your document, Inkit will save the document as Mail Merge
and will place it in the folder specified by the ID fold_6UpetHRzr73eyl4jCbfYBl
. The document will expire either after one view or one hour after its generation, whichever comes first.
Salesforce
You specify data related to a Salesforce destination in a subobject called salesforce
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
record_id | String | Yes | The Salesforce LinkedEntityId . |
salesforce_type | String | Yes | Whether you are sending the generated document as a link or as a file to Salesforce. The default is link . |
file_name | String | No | The name of the generated document. |
description | String | No | The description of the generated document. |
sandbox | Boolean | No | Whether you are using the Salesforce sandbox. The default is false . |
For example:
{
"destinations": {
"salesforce": {
"record_id": "Your salesforce LinkedEntityId",
"salesforce_type": "link",
"file_name": "My awesome PDF",
"description": "Salesforce PDF description"
}
}
}
Sepire
You specify data related to a Sepire destination in a subobject called sepire
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
address_line_1 | String | No | The first line of the recipient's address. |
address_line_2 | String | No | The second line of the recipient's address. |
address_city | String | No | The recipient's city. |
address_zip | String | No | The recipient's zip code. |
address_state | String | No | The recipient's state. |
address_country | String | No | The recipient's country. |
first_name | String | No | The recipient's first name. |
last_name | String | No | The recipient's last name. |
verify_address | Boolean | No | Whether to verify the address. |
mail_product_name | String | No | Whether the product is a letter or a postcard . |
mail_product_data | Object | No | Product data. |
mail_product_data
mail_product_data
Property | Type | Required | Value ofmail_product_name | Description |
---|---|---|---|---|
mail_type | String | No | letter or postcard | Whether the delivery type is usps_first_class or usps_standard . |
letter_address_placement | String | No | letter | Whether the placement of the address is top_first_page or insert_blank_page . |
letter_return_envelope | Boolean | No | letter | Whether to include a return envelope. |
letter_perforated | Integer | No | letter | Whether perforated (1 ) or not (0 ). |
letter_double_sided | Boolean | No | letter | Whether output should be double-sided. |
letter_color | Boolean | No | letter | Whether output should be in color. |
letter_additional_service | String | No | letter | Whether one of the following additional services is included: certified , certified_return_receipt or registered . |
postcard_size | String | No | postcard | The postcard size, which can be 4x6 , 6x9 or 6x11 . |
For example:
{
"destinations": {
"sepire": {
"address_line_1": "1234 Main St.",
"address_line_2": "#1",
"address_city": "New York",
"address_zip": "10001",
"address_state": "NY",
"address_country": "US",
"first_name": "John",
"last_name": "Doe",
"verify_address": true,
"mail_product_name": "letter",
"mail_product_data": {
"mail_type": "usps_first_class",
"letter_address_placement": "top_first_page",
"letter_return_envelope": true,
"letter_perforated": 1,
"letter_double_sided": true,
"letter_color": true,
"letter_additional_service": "certified",
}
}
}
}
DocuSign
You specify data related to a DocuSign destination in a subobject called docusign
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
signers | List<Object> | Yes | A list of signers of the generated document. |
copy_receivers | Object[] | No | An array of people receiving a copy of the generated document. |
routing | String | No | Whether the routing of the generated document to signers is ordered or unordered . |
signers
signers
Property | Type | Required | Description |
---|---|---|---|
[id] | Object | Yes | The signer specifed by id . |
[id]
[id]
Property | Type | Required | Description |
---|---|---|---|
name | String | Yes | The name of the signer. |
email | String | Yes | The email address of the signer. |
routing_number | Integer | No | The routing number of the signer if routing is set to ordered . |
copy_receivers
copy_receivers
Property | Type | Required | Description |
---|---|---|---|
name | String | Yes | The name of the person receiving a copy of the generated document. |
email | String | Yes | The email address of the person receiving a copy of the generated document. |
For example:
{
"destinations": {
"docusign": {
"signers": {
"1": {
"name": "John Doe",
"email": "[email protected]",
"routing_number": 2
},
"2": {
"name": "Sally Smith",
"email": "[email protected]",
"routing_number": 1
}
},
"copy_receivers": [{
"name": "Tom Jones",
"email": "[email protected]"
}],
"routing": "ordered"
}
}
}
Magic Link
You specify data related to a Magic Link destination in a subobject called magic_link
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
auth_email | String | Yes | The authorization email address. |
recipient_email | String | Yes | The recipient email address. |
name | String | No | The name of the generated document. |
description | String | No | The description of the generated document. |
auth_method | String | No | Whether the authorization method is email or social . |
retain_from_created | Object | No | The amount of time before the generated document expires from the time it was created. |
retain_from_first_opened | Object | No | The amount of time before the generated document expires from the time it was first opened. |
expire_after_n_views | Integer | No | The number of views of the generated document before it expires. |
retain_from_created
and retain_from_first_opened
retain_from_created
and retain_from_first_opened
Property | Type | Required | Descriptions |
---|---|---|---|
minutes | Integer | No | The number of minutes before the document expires. |
hours | Integer | No | The number of hours before the document expires. |
days | Integer | No | The number of days before the document expires. |
months | Integer | No | The number of months before the document expires. |
For example:
{
"destinations": {
"magic_link": {
"retain_from_created": {
"hours": 1
},
"auth_email": "[email protected]",
"recipient_email": "[email protected]",
"auth_method": "email",
"name": "Mail Merge",
"expire_after_n_views": 1
}
}
}
Amazon S3
You specify data related to an Amazon S3 destination in a subobject called amazon_s3
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
bucket_name | String | Yes | The name of the Amazon S3 bucket where the document will be generated. |
file_name | String | Yes | The name of the document generated. |
For example:
{
"destinations": {
"amazon_s3": {
"bucket_name": "mybucket",
"file_name": "test",
}
}
}
Google Drive
You specify data related to an Google Drive destination in a subobject called google_drive
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
folder_id | String | Yes | The name of the Google Drive folder where the document will be generated. |
file_name | String | Yes | The name of the document generated. |
For example:
{
"destinations": {
"google_drive": {
"folder_id": "12HCqdH7SEJT7USqIpmxqcyn0m3gDTu8b",
"file_name": "test",
}
}
}
Dropbox
You specify data related to an Dropbox destination in a subobject called dropbox
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
path | String | Yes | The Dropbox path where the document will be generated. |
file_name | String | Yes | The name of the document generated. |
For example:
{
"destinations": {
"dropbox": {
"path": "/",
"file_name": "test",
}
}
}
Box
You specify data related to an Box destination in a subobject called box
, which has the following properties:
Property | Type | Required | Description |
---|---|---|---|
parent_id | String | Yes | The Box parent ID of the document generated. |
file_name | String | Yes | The name of the document generated. |
For example:
{
"destinations": {
"box": {
"parent_id": "0",
"file_name": "test",
}
}
}
metadata
metadata
All list methods in the Inkit API return a metadata
object that has the following properties:
Property | Type | Description |
---|---|---|
pagination | Object | List pagination data, which allows you to page through lists. |
sort | Object | List sort data. |
pagination
pagination
Property | Type | Description |
---|---|---|
current_page | Integer | The current page of the list. |
next_page | Integer | The next page of the list. |
page_count | Integer | The number of pages in the list. |
page_size | Integer | The number of records in each page of the list. |
prev_page | Integer | The previous page of the list. |
total_count | Integer | The total number of records in the list. |
sort
sort
Property | Type | Description |
---|---|---|
key | String | The key used to sort the list. |
order | Integer | The sort order of the list. 0 means ascending while 1 means descending. |
For example:
{
"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 4 months ago