Documill Leap

Create an API Action Template

Available to Organization Admin.

Create an API Action Template

Create an API Action Template to define a request that Project Owners can add to their workflows as an API Action Step.

  1. Open the Organization page and scroll to “API Action Templates” section.

  2. Click [Create new API Action].

Preview
Create API Action - 1.png


  1. Enter a Name and a Description. Project owners see these when they choose a template, so describe what the template does, for example Posts a "deal won" message to #sales.

  2. Under Request, choose the Authorization type and fill in Authorization, HTTP method, Url and Content type.

  3. Under Request Body, click Add body (or Add part for multipart/form-data) and enter the content. Add a parameter for every ${name} placeholder you use.

  4. Under Response, choose whether to Replace workflow file and pick the Error handler.

  5. Click [Save].

Preview
Create API Action - 2.png



API Action Template options

Name and Description

Option

Description

Name

Required. Up to 100 characters. Shown to Project owners when they choose a template.

Description

Optional. Up to 100 characters. Use it to say what the template does and where it sends data.

Request

Option

Description

Authorization type

Authorization

Only with Custom. Sent as the Authorization header exactly as you enter it, for example Bearer abc123. Leave it empty if the receiving system does not need it, for example a Slack webhook.

HTTP method

GET, POST, PUT, PATCH, DELETE or HEAD. POST requires a request body.

Url

With Custom: the full address, starting with https://.

Salesforce URI

With Use Salesforce connection: the path after your Salesforce domain, starting with /, for example /services/data/v60.0/sobjects/Task.

Content type

Shown for POST, PUT and PATCH. application/json, text/plain or multipart/form-data.

Request Body

The request body is not available for GET. For application/json and text/plain, the request has one body. For multipart/form-data, you can add several parts, for example a JSON part with details and a part that carries the workflow file.

Option

Description

Name

Only for multipart/form-data. The part's name, as expected by the receiving system.

Workflow file

Select Include workflow file to send the Project's workflow file in this part instead of text content.

Content type

Only for multipart/form-data parts without the workflow file. application/json or text/plain.

Content

The text sent in the body or part. JSON content must be valid JSON. Insert parameters as ${parameterName}.

Parameters

Parameters let Project owners fill in values that change from Project to Project, such as a customer name. Write a parameter in the content as ${parameterName} and add it to the parameter list below the content.

Option

Description

Name

The name used inside ${ }. Must be unique within the template.

Default value

Used when the Project owner does not enter a value. Project owners can change it in the API Action Step.

Example content with two parameters:

JSON
{ "text": "Deal won! ${customerName} signed the contract (${dealValue})." }

Response

Option

Description

Replace workflow file

When selected, the file returned by the receiving system becomes a new version of the workflow file. If the response has no file name, the current file name is kept.

Select this option only when the service returns a file.

Error handler

What happens when the call fails. Ignore and continue the project: the Project moves on. Let project owner decide: the Project owner is asked how to continue.

Messages when saving

If a required detail is missing, the template is not saved and a message tells you what to fix. The same checks apply when you edit a template.

Message

How to fix it

API Action name is required.

Enter a Name.

API Action url is required.

Enter a Url.

The Salesforce endpoint URI should start with '/'

With Use Salesforce connection, enter a relative path such as /services/data/v60.0/sobjects/Task.

Selected Http method 'POST' requires request body.

Add a request body.

Request parameter names must be defined.

Give every parameter a name.

Parameter names must be unique.

Rename parameters that share a name.

Some of the parameters are not defined.

Add a parameter for each ${name} used in the content.

Invalid request body content: ...

Fix the JSON in the request body content.

Saving failed with message: Given ApiAction url is not considered valid.

Use a full URL that starts with https://.