Skip to content

Macro Reference

This section contains a full list of macros that can be used with the DIY Surveys API. Please check here for more information on how macros can be used.

Messages

The following macros can be used when sending a message:

Name Format Description
source {source} The source the message was sent from.
destination {destination} The destinations the message will be sent to.
brand {brand(name)} The branding to apply to the source if the network allows it.
tiny {tiny(longUrl[,tinyDomain[,reuse[,slashtag]]])} Shortens a destination URL. Supply a fourth parameter to choose a static path. See Tiny URL macro below.

Tiny URL macro

The tiny macro supports generated short links and static links with a named path.

{tiny(longUrl[,tinyDomain[,reuse[,slashtag]]])}

Square brackets indicate optional parameters; do not include the brackets in the message.

Position Parameter Description
1 longUrl Required. The complete destination URL. It can contain supported recipient or message macros.
2 tinyDomain Optional. A Tiny URL domain configured for the account. If omitted, the service uses the applicable configured domain.
3 reuse Optional. Requests reuse of an existing link. Defaults to false. Use lowercase true or false.
4 slashtag Optional. The fixed path name after the domain, such as privacy. Omit it or leave it empty for a generated short code.

To supply a slashtag, include the preceding parameters in their correct positions. slashtag chooses the named path; reuse does not.

Using the configured domain:

{tiny(https://www.example.com)}

Using a specific domain:

{tiny(https://www.example.com,links.example.com)}
{tiny(https://www.example.com/privacy,links.example.com,false,privacy)}

With links.example.com configured for the account and HTTPS enabled, this inserts:

https://links.example.com/privacy

The domains in these examples are placeholders. Supply a configured Tiny URL domain and a destination of your own.

Choose an unused slashtag when creating a new static link. Use static links for a common destination, such as a privacy policy. Use recipient-specific links when destinations differ between recipients; do not assign those destinations the same static slashtag.

For direct API registration, request fields, responses and domain setup, see TinyUrl. For a complete message request, see Macros.

Recipients

The following macros can be used when sending a message that refers to a recipient:

Name Format Description
first {first} the first name of a recipient
last {last} the last name of a recipient
telno {telno} the mobile number associated with the recipient

Surveys

The following macros can be used when sending a message that is associated with a recipient within a survey. This includes all of the above macros in the recipients list and the following:

Name Format Description
surveyname {surveyname} the name of the survey
surveydescription {surveydescription} the description of the survey