Skip to main content

Send Message With Options

Request#

You need to send a POST request to:

https://yoai.yophone.com/api/pub/sendMessage

Request body params format (JSON)#

  • to (required):
    The unique identifier for the target chat or the username of the target channel.

  • text (required):
    The text of the message to be sent.

  • options (required):
    A list of {label:"label","value":"value"} to select up to 20 options.

Request example (POST):#

Expecting Message format#

{    "to": "123456789",    "text": "Hello, this is a message from my YoAI!",    "options": [        {            "label": "some label",            "value": "some value"        }    ]}

Request example#

curl -X POST https://yoai.yophone.com/api/pub/sendMessage \-H "Content-Type: application/json" \-H "X-YoAI-API-Key: your YoAI api token" \-d '{  "to": "123456789",  "text": "I love YoAI",  "options": [    {      "label": "some label",      "value": "some value"    }  ]}'

Response Example:#

The response is JSON data with status code 200

Message response format#

{    "success": true,    "code": 200,    "data": {}}