Skip to content
This repository was archived by the owner on Aug 12, 2022. It is now read-only.

Message payload

mandre42 edited this page Mar 30, 2017 · 3 revisions

This page references all the messages formats you can send with the Connect API.

Buttons can either be:

  • postback: the basic type, once the button is tapped, the value is sent as a payload incoming message.
  • web_url: when this button is tapped, the Url in the value field is loaded.
  • phone_number: when this button is tapped, the phone number in the value field is called

You can find more information here.

Text message:

<?php
(object)[
  "type" => "text",
  "content" => "MY_TEXT"
]

Quick Replies:

<?php
(object)[
  "type" => "quickReplies",
  "content" => (object)[
    "title" => "TITLE",
    "buttons" => [
      (object)[
        "title" => "BUTTON_TITLE",
        "value" => "BUTTON_VALUE"
      ]
    ]
  ]
]

Cards:

<?php
(object)[
  "type" => "card",
  "content" => (object)[
    "title" => "CARD_TITLE",
    "subtitle" => "CARD_SUBTITLE",
    "imageUrl" => "IMAGE_URL",
    "buttons" => [
      (object)[
        "title" => "BUTTON_TITLE",
        "type" => "BUTTON_TYPE", // See Facebook Messenger button formats
        "value" => "BUTTON_VALUE"
      ]
    ]
  ]
]

Pictures:

<?php
(object)[
  "type" => "picture",
  "content" => "IMAGE_URL"
]

Videos:

<?php
(object)[
  "type" => "video",
  "content" => "VIDEO_URL"
]

Clone this wiki locally