Skip to main content

Send Message With Media URLs

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.

  • mediaURLs (required):
    A list of media URLs.

Request example (POST):#

Expecting Message format#

{    "to": "123456789",    "text": "Hello, this is a message from my YoAI!",    "mediaURLs": ["https://picsum.photos/200/300"]}

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",  "mediaURLs": ["https://picsum.photos/200/300"]}'

Response Example:#

The response is JSON data with status code 200

Message response format#

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