Porovnat verze

Klíč

  • Tento řádek byl přidán.
  • Tento řádek byl odstraněn.
  • Formátování bylo změněno.

Api for SMS Chat. Used to send SMS and read SMS history. Documentation is at https://sms-api.voipex.io/documentation/

Authentication

Authentication is through bearer token - same as for IPBX-API:
https://ipexas.atlassian.net/wiki/spaces/VD/pages/626720808/Getting+Started+with+the+API+PBX#Working-with-IPBX-API.

Token can be set in documentation:

...

Image Added

Sending SMS

For SMS sending, you need to order mobile numbers - please contact sales. You can get list of your numbers by calling GET on SMS/allowed-numbers:

curl -X GET "https://sms-api.voipex.io/SMS/allowed-numbers" -H "accept: application/json" -H "Authorization: Bearer eyJhbGci...Oi5c"

For allowed numbers (e.g. +420777888999) you can call POST on /SMS :

curl -X POST "https://sms-api.voipex.io/SMS" -H "accept: application/json" -H "Authorization: Bearer eyJhbGci...Oi5c" -H "Content-Type: application/json" -d "{\"from\":\"+420777888999\",\"to\":\"+420607608609\",\"text\":\"Hello world!\"}"

Receiving SMS

On received SMS or delivery notification, your webhook is called, or email is sent. It depends on your SMS Chat settings. Webhook parameters are:

id: string

from: string

to: string

text: string

direction: IN | OUT

state: FAILED | DELIVERED

createdAt: string

SMS history

All sent and received SMS can be read by GET /SMS. History is maintained for 6 months. Time must be specified in ISO-8601 including timezone specification.

curl -X GET "https://sms-api.voipex.io/SMS?startTime=2021-09-01T00%3A00%3A00.000%2B02%3A00&endTime=2021-10-01T00%3A00%3A00.000%2B02%3A00" -H "accept: application/json" -H "Authorization: Bearer eyJhbGci...Oi5c"