Skip to content

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 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.

Terminal window
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.

Your serverSIPRTCProviderSMS route, Meta, ViberRecipientPOST …/Messageshands the message over201 · sid, status sentdeliversdelivery reportupdates the message recordGET …/Messages/{sid}status delivered
Sending a message and following its delivery

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.

Every message sent or received is recorded. List them newest first, or fetch one by its sid:

Terminal window
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.

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.

  • Email sends through a mailbox configured on your account; from must be that mailbox.
  • Fax sends a document you uploaded as Media, and lists received faxes. To receive faxes on a number, return <Receive> from its voice application.