Using Retabler

Receiving Data

Receiving the data is perhaps the most interesting part of importing the data. Once the data has passed the matching and validation steps Retabler POSTs the data to a webhook URL specified by admins on each data model.

Webhook Definition

From there, the receiving endpoint should take the payload and import the data as needed to the system. Retabler POSTs the data to the specified Webhook using a JSON payload with the following format:

{
  "count": 3,
  "records": [
        {
            "Last Name": "Martinez",
            "First Name": "Juan"
        },
        {
            "Last Name": "Perez",
            "First Name": "Juan"
        },
        {
            "Last Name": "Gonzales",
            "First Name": "Miguel"
        }
    ],
    "metadata": {
        "model_id": "fk8a7Avl",
        "model_name": "Users",
        "company_id": "bd5e7ba9-5252-4e1f-bec8-fca38f81d9f4"
    }
}

As you can see this payload contains the following fields:

  • count: The number of records in the payload
  • records: An array of records, each record is a JSON object with the column names as keys and the values as the values.
  • metadata: A JSON object with the following fields:
    • model_id: The ID of the model that the data is being imported into.
    • model_name: The name of the model that the data is being imported into.
    • company_id: this is probably a metadata added by the admin in the app, this serves identifying the tenant or business logic identification data.