Messaging overview
One endpoint sends on every messaging channel; the channel field picks it.
| Channel | channel |
from is |
to is |
|---|---|---|---|
| SMS | sms |
a phone number on your account (or your parent account), or a registered alphanumeric sender ID | an E.164 phone number |
whatsapp |
a WhatsApp number on your account, connected through Meta | an E.164 phone number | |
| Viber | viber |
the webhook SID of a Viber bot connected to your account | the recipient’s Viber user ID |
| Messenger | facebook |
the ID of a Facebook page connected to your account | the recipient’s page-scoped ID (PSID) |
Before you send, connect the channel: buy or bring a number for SMS, and connect WhatsApp, Messenger or Viber under Channels.
Send a message
Section titled “Send a message”curl -u "$SIPRTC_AUTH_ID:$SIPRTC_AUTH_SECRET" \ -H 'Content-Type: application/json' \ "https://api.siprtc.io/v1/Accounts/$SIPRTC_AUTH_ID/Messages" \ -d '{ "channel": "sms", "from": "+15550100001", "to": "+15550100002", "body": "Your appointment is confirmed for 10:30 tomorrow." }'A 201 means the provider accepted the message. The response carries the
message sid; its later delivery status is recorded on the message record.
SMS and WhatsApp sends need a positive balance, and every refusal — an
unknown sender, an invalid number, a low balance, a provider error — is a
400 whose body says why. Every field is described in
Send a message.
Attachments
Section titled “Attachments”Set hasAttachment to true and list the files in mediaFileContents.
Attachments are supported on WhatsApp and Viber, not on SMS. On WhatsApp the
body becomes the caption of the first attachment.
Read message records
Section titled “Read message records”Every message sent or received is recorded. List them newest first, or fetch
one by its sid:
curl -u "$SIPRTC_AUTH_ID:$SIPRTC_AUTH_SECRET" \ "https://api.siprtc.io/v1/Accounts/$SIPRTC_AUTH_ID/Messages?PageSize=20&Page=1"status is the latest status the provider reported — for example sent,
delivered, failed or received — and date_delivered is set once
delivery is confirmed.
Conversations
Section titled “Conversations”Messages exchanged with the same contact on the same sender are grouped into a conversation. Use Conversations to read a thread, or download its transcript.