How can we help?

Scriptable API

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 augments your ability to facilitate integrations between Cordial and other applications that provide value for your business.

When to use

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.

Contact your CSM to begin using our scriptable API.

How it works

Here's the workflow for our scriptable API:

  • Receive request: Get all settings by Scriptable endpoint ID. 
  • Authentication: By API key (default) or Smarty script. 
  • Transformation script: Transform payload into commands.
  • Response: Can be set to default or custom. 

Create scriptable API endpoint

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

Scriptable API navigation in the UI

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.

    • When using API Key as the authentication type, enter the Smarty script you'll use to transform your data in the Transformation editor

Scriptable API payload configuration

  • When using Scripted as the authentication type, enter the appropriate Smarty script into the Authentication script and Transformation editor panes.

Scriptable API payload configuration

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

6. Save your configured payload and click Enable

7. You can copy your scriptable API URL by clicking the arrow under the name.

Copy scriptable API URL to clipboard

8. 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. 

Copy API URL to clipboard

9. 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.

Comments

0 comments

Please sign in to leave a comment.