Postcards

reading time 5 minutes

The guide how to use Postcards API.

This API endpoint uses an HTTP POST request. You must provide api_token within the body, which can be found under the Settings section in the Inkit application (see below).

Postcard Webhook Endpoint: https://internal.inkit.io/integrations/webhook

curl --header "Content-Type: application/json" -d
'{
"api_token":"<token>",
"template_id":"<template_id>",
"first_name": "Elon",
"last_name": "Musk",
"email":"[email protected]",
"company":"SpaceX",
"phone":"3107099497",
"address_line_1": "1 Rocket Road",
"address_line_2": "Suite 1",
"address_city": "Hawthorne", 
"address_state": "CA",
"address_zip": "90250",
"address_country": "US",
"source": "Webhook"
}'
-H "Content-Type: application/json" -X POST https://internal.inkit.io/integrations/webhook

📘

Note

Any field that doesn't exist in the data structure will be stored as custom data.
Custom data can be used for displaying dynamic data if the merge fields are selected in the template.

Request Schema

📘

FieldTypeDescription
api_tokenstringAuthorization token which allow to use API calls (see below)
template_idstringID of the template from the Inkit UI (see below)
first_namestringThe first name of the contact (optional but either first_name or last_name is required)
last_namestringThe last name of the contact (optional but either first_name or last_name is required)
emailstringThe email address of the contact (optional)
companystringThe company name that the contact belongs to (optional)
phonestringThe phone number of the contact (optional)
address_line_1stringThe primary line, or street address of the contact (64-character limit)
address_line_2stringThe apartment or suite number (optional)
address_citystringThe city of the contact's address
address_statestringThe two-letter (2) state code of the contact's address
address_zipstringThe ZIP Code of the contact's address
address_countrystringThe two-letter (2) ISO alpha-2 country code of the contact's address

API Token and Template ID

1. Template ID is located and can be copied under the Templates section in the app.

2872

2. API Token

You can find the information how to obtain API token by clicking on this link.

Response

202 Accepted HTTP response will be returned for successful post request.
Otherwise, you will receive an error message. The meaning of them you can find here.

Questions?

We're happy to help get your code set up or answer questions you might have.
Search our documentation, check the help center, or connect with our sales team.
Ask our support team ([email protected]) questions if you run into any technical roadblocks.


What’s Next