Receive message through Amio API
Receiving messages is done using Message Received webhook call which you receive from Amio server whenever someone sends a message through Amio Web Chat.
For the purpose of this tutorial, we will use Ngrok to route incoming webhook calls to your local machine.
- Download and install Ngrok.
- (Optional) Create a server app with opened url for Amio webhooks, i.e.
http://localhost:<YOUR_APP_PORT>/webhook/amio
and start it. - Start Ngrok for routing to your local server with command
./ngrok http <YOUR_APP_PORT>
.
![aaa.png 530](https://files.readme.io/56d9d7b-aaa.png)
- Copy the forward url from Ngrok (
https://c25d851e.ngrok.io
in our case) and set this url in Amio app (Administration - Channel Detail - Webhook tab). - Open the webpage that you have embedded Amio Web Chat to in the previous step of this tutorial and send a message.
- Observe your local server has received an HTTP POST request.
- You can see all incoming requests in Ngrok web interface as well
http://127.0.0.1:4040
or in Amio Logs.
![Screenshot 2019-04-03 at 12.05.29.png 613](https://files.readme.io/825f212-Screenshot_2019-04-03_at_12.05.29.png)
Updated over 4 years ago