Skip to main content

Action Object — URI

A URI action opens an external link or triggers a system action.

Basic usage​

A URI action makes tapping a button navigate to an external site, place a call, compose an email or invoke another URI scheme. Several URI formats and system integrations are supported.

Structure​

JSON​

{
"type": "URI",
"uri": "https://www.example.com"
}

Properties​

type (required)​

The action's type, always "URI".

uri (required)​

The URI to open. https://, tel:, mailto: and other schemes are supported.

Examples​

To send a button with a URI action from Push Message:

  1. Choose Expression in the Template field's dropdown.
  2. Enter the following JavaScript in the editor.

A contact menu​

(() => {
return {
type: 'BUTTON',
title: 'Contact us',
text: 'How would you like to get in touch?',
buttons: [
{
label: 'Call us',
action: {
type: 'URI',
uri: 'tel:+886-2-1234-5678',
},
},
{
label: 'Our website',
action: {
type: 'URI',
uri: 'https://www.company.com',
},
},
{
label: 'Email us',
action: {
type: 'URI',
uri: 'mailto:support@company.com',
},
},
],
};
})()
(() => {
return {
type: 'BUTTON',
title: 'More resources',
text: 'Related resources and tools:',
buttons: [
{
label: 'Product manual',
action: {
type: 'URI',
uri: 'https://docs.company.com/manual.pdf',
},
},
{
label: 'Video tutorial',
action: {
type: 'URI',
uri: 'https://www.youtube.com/watch?v=example',
},
},
],
};
})()