Scriptable API – Cordial Knowledge Base

How can we help?

Overview

Built atop our asynchronous API, Cordial's Scriptable API allows you to set custom authentication, responses, and payload schemas that align with Cordial's data structure using Smarty scripts. This feature streamlines the process of facilitating integrations between Cordial and other applications that provide value for your business.

When to use the Scriptable API v. Asynchronous API
Our Scriptable API should only be used in cases when you can't use the asynchronous API on its own, such as when custom authentication is required or your data needs to undergo a transformation in order to align with Cordial's schema.

How it works

Here's the workflow for our Scriptable API:

Create Scriptable API endpoint

  1. To create a Scriptable API endpoint in Cordial, log in and navigate to Integrations > Scriptable API.

  2. Select New and create a name for your endpoint.

  3. Select Edit under Scriptable API Payload to configure the payload for your endpoint.

  4. Select the Authentication type: API Key or Scripted.

API key is Cordial's preferred authentication method. Scripted should only be used for integrations that don't allow you to use Cordial API keys for authentication.

  1. Add optional Secrets and keys below the Transformation editor.

  2. Save your configured payload and click Enable.

  3. You can copy your Scriptable API URL by clicking the arrow under the name.

  4. Once your Scriptable API is saved, you can also copy the URL by navigating back to Integrations > Scriptable API and clicking the Copy to clipboard icon.

  5. You can now use the URL you created to send API calls.

Scriptable utilities

Scriptable API utilities create additional capabilities for our Scriptable API, using Smarty scripts to transform data for compatibility and provide authentication.

Remove Scriptable endpoint

You can remove a Scriptable API endpoint by hovering over the arrow in the table row and clicking Remove, or by selecting the endpoint and clicking the X button.