Send message through Amio API

In previous tutorial, we have embedded Amio Web Chat to a webpage. We will now test that when a message is sent through Amio API, we will receive that message in the chat.

📘

Postman

We recommend you to test different API calls via Postman. Setup takes about 3 minutes.

Send message

Send a text message to your Amio Chat channel using Send Text Message API. To make the call below work, replace the placeholders:

  • {{channel_id}} - is located in your Amio Chat channel in administration
  • {{contact_id}} - is under Contacts tab of your channel. There should be at least one contact, since we have already sent some messages in the previous step of this tutorial.
  • {{organization_access_token}} - find it in Settings - API
curl -X POST \
  https://api.amio.io/v1/messages \
  -H 'authorization: Bearer {{organization_access_token}}' \
  -H 'content-type: application/json' \
  -d '{
  "channel": {
    "id": "{{channel_id}}"
  },
  "contact": {
    "id": "{{contact_id}}"
  },
  "content": {
    "type": "text",
    "payload": "Hello world!"
  }
}'

Check browser received message

Open your webpage in the browser. You should see the message in the chat window.

998