SMS
Send and receive SMS from phones, the dashboard and the API.
Every line sends and receives SMS on its SIM. simtrunk doesn't charge for SMS; your carrier bills them as usual.
Received SMS
An SMS to the SIM's number shows in the line's conversations, reaches the phones registered to the line as a SIP MESSAGE, and goes to your webhooks as simtrunk.sms.received.
Sending
- From a phone: send a SIP MESSAGE to a number; it leaves on the line.
- From the dashboard: open the line's conversations and write.
- From the API: with a key that has the
sms:writescope.
curl https://api.simtrunk.com/v1/lines/LINE_ID/sms \ -H "Authorization: Bearer $SIMTRUNK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"to": "+258840000000", "body": "Your order is ready."}'to is a national or international (+…) number. Long texts go as several parts.
Requires the scope sms:write.
apiKeyAuthorizationBearer <token>An API key, or an access token for one, through the API gateway.
id*stringapplication/json- body
to*stringThe number, national or international (+...).
body*stringThe text; long ones go as concatenated parts.
OK
application/json- response
ok*booleancurl -X POST 'https://api.simtrunk.com/v1/lines/string/sms' \ -H 'Content-Type: application/json' \ -d '{ "to": "string", "body": "string"}'{ "ok": true}Reading conversations
GET /v1/lines/{id}/threads lists a line's conversations, and GET /v1/lines/{id}/messages a conversation's messages (scope sms:read). Viewers don't see message content.
Webhooks
| Topic | When |
|---|---|
simtrunk.sms.received | An SMS arrived |
simtrunk.sms.sent | An SMS left |
simtrunk.sms.failed | An SMS could not be sent |
How is this guide?
Last updated on