Macros
DIY Surveys support the principle ability to insert values into a message. This is achieved through its Macro Capability. Macros can be used during the recipient upload process and the Messaging process.
Formatting Macros
Macros take the basic format as follows:
Name
Description
name
The name of the macro
parameters
an optional set of parameters depending on the type of macro
An example of a macro is the tiny
, which takes the basic format:
The above macro will convert the long URL provided into a short version and based on your account settings will use either the default tiny URL or a specific one associated with your account.
Parameters
Parameters have to be separated by commas. If a parameter includes a parameter then it needs to be surrounded by double quotes ("
). For example:
The above macro will convert the long URL into a tiny URL using the domain name provided as the second parameter as the tiny URL.
In the above examples the parameters are literal entries in the message. It is also possible to refer to external references by using reference macros. For example it is possible to refer to values provided along with the method call when sending a message:
In this example the {long}
and {short}
references must be included in the method to send a message. For example:
If there is a conflict with the macro list supplied in the API call and the standard macros the macro list takes precedence.
Last updated
Was this helpful?