Testing tools and phone numbers
Postman
Section titled “Postman”Postman lets you send HTTP requests to the API without writing code. Amio publishes a collection of ready-made requests in the amio-postman-collection repository. Import it into Postman and set your access token in the environment variables. See Authentication for where to find the token.
Receive webhooks on your computer
Section titled “Receive webhooks on your computer”Amio sends webhooks to a public HTTPS address. To test on your own machine, use a tunnel such as ngrok.
- Start your app on a port, for example 8080.
- Run
ngrok http 8080. ngrok prints a publichttpsforwarding address. - In the channel’s Webhook tab in app.amio.io, set Webhook Url to the forwarding address plus the path of your handler, for example
https://<forwarding address>/webhooks/amio. - Send a message to the channel. The request appears in your app. You can also see it in the ngrok web console at
http://127.0.0.1:4040and in the logs of the Amio administration.
Phone number format
Section titled “Phone number format”Amio stores and returns every phone number in E.164 format without the leading +, for example 15558576309. When you send a message you can write the number in any format: Amio removes every character that is not a digit, and a leading 00 as well. So +1 (555) 857-6309 and 001-555-857-6309 both become 15558576309. Webhooks and responses always contain the normalized number.
Every contact also has a unique ID. Use it to track a contact instead of the phone number.