Using data buckets


After creating data buckets, you can use them through the data templating helpers or by directly referencing them in a route response.

 Using data helpers

Two helpers are available: data and dataRaw. They work in a similar way to the body and bodyRaw helpers.

They can be used anywhere templating helpers are supported: body editor, files, headers keys and values, etc., and allow you to partially reuse your data bucket content and compose dynamic responses body easily.

Both helpers support retrieving the data bucket by its unique ID or name. It also allows you to retrieve only part of the data bucket using an optional object path:

Copy
{{data 'ID_or_name' 'object.path'}}

Head over to the data helpers' documentation to see more examples.

 Referencing in a route response

A data bucket can also be directly linked to a route response. Linking a data bucket will serve the generated data bucket content "as-is".

To link a data bucket to a route response, choose "Data" in the body selector and select your data bucket.

Using data bucket in a route response