Payloads in Tines explained

What are payloads and how to use them in Tines.

Ruairí Galavan avatar
Written by Ruairí Galavan
Updated over a week ago

What are payloads?

Payloads are a way to send structured data as an event in Tines. Think of payloads as the messages sent between your web browser and a website or application. Where the HTTP request is the transfer of the information, the payload is the actual information being transferred. You can send data using payloads to:

  • another system via an API

  • another story via a send-to-story action

  • or to another action within a story via our event transform action

How can I use Payloads in Tines?

You can use payloads with 3 of the 7 action types in Tines: HTTP requests, event transform message-only mode, and send-to-stories. In the case of HTTP requests, a payload can be the data sent with a HTTP request or the data returned from a HTTP request. So if we are making a request to a weather API to fetch the weather, the payload can be the request for specific weather information, or it can be an actual forecast that is returned.

You can configure the request as a key/value option in the action builder like this:

In plain code, that would look like this:

In the case of the information returned, a payload might look something like:

{

"city": "dublin",

"forecast": "broken clouds"

}

In Tines, when configuring a payload request, you have a number of different data configuration options to choose from. The value option determines the structure of the data in the payload. The different options are; text, boolean, null, numbers, arrays, and objects.

Here is a guide for when to use each payload type.

Value options

Description

Supports

When to use this mode

Text

Values will be automatically converted into text regardless of their initial data type.

  • Hard-coded text

  • Functions

  • Tags

Use this mode when the output of any functions or tags applied should be text or if you are simply typing in text.

Formula

Allow values to retain their initial data type.

  • Functions

Use this option when the output of any functions applied should retain their initial data type (e.g. array, object, integer, boolean).

Number

Only accepts numbers and retains their integer data type.

  • Hard-coded text

Use this option when you want to hard-code a number into a payload. If you’d like to use a formula that should have a number output, use the formula option.

True / False

Only accepts boolean values true or false.

  • Hard-coded text

Use this option when you want to hard-code a boolean (true or false) into a payload. If you’d like to use a formula that should have a boolean output, use the formula option.

Null

Only accepts the value null.

  • Hard-coded text

Use this option when you want to hard-code the value NULL into a payload. If you’d like to use a formula that should have a null output, use the formula option.

Add an object

Allows you to create a JSON object or series of nested JSON objects with key / value pairs in Tines.

  • Hard-coded text

  • Functions

  • Tags

  • Any of the other value options in this table.

Use this option to create a JSON object in Tines. This is often helpful for building API calls and structuring your JSON data.

Please note, you can also create an object within a formula when using the formula value option in payloads.

Add an array

Allows you to create an array or series of nested arrays in Tines.

  • Hard-coded text

  • Functions

  • Tags

  • Any of the other value options in this table.

Use this option to create an array in Tines. This is often helpful for building API calls and structuring your JSON data.

Please note, you can also create an object within a formula when using the formula value option in payloads.

Check out our product docs on HTTP requests here.

Did this answer your question?