SMS

Migrating from Twilio

Most of a Twilio Programmable Messaging integration moves by changing the base URL, the key and the request format.

Migrating from Twilio

Most of a Twilio Programmable Messaging integration moves by changing the base URL, the key and the request format. With the SDK, honkio.messages.send() replaces the Twilio client's messages.create().

TwilioHonkIONotes
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.jsonhttps://api.honkio.ca/v1/messagesTwilio's HTTP Basic Account SID and Auth Token become one Bearer API key, and form encoded fields become a JSON body.
To, From, Bodyto, from, bodySame idea, lowercase field names in a JSON body.
StatusCallback (per message)POST /v1/webhooks (account level)Register an endpoint and the events it should receive once; there is no per message callback URL.
queued, sending, sent, delivered, undelivered, failed, receivedQUEUED, SENDING, SENT, DELIVERED, UNDELIVERED, FAILED, RECEIVEDThe common states carry over, in upper case. Twilio's accepted, scheduled, receiving, read, canceled and partially_delivered have no equivalent.
MessagingServiceSidnot availableEach send names one of your own numbers as from directly.
MediaUrl (MMS)not availableSMS only; there is no media attachment field.
Per number webhook URL, form encoded, X-Twilio-Signaturemessage.received webhook, X-HonkIO-SignatureOne account level webhook receives inbound texts for every number, as JSON.
Advanced Opt-Out keywordsbuilt inSTOP, START and HELP, and their common variants, are recognized automatically on every number; nothing to configure.
POST /IncomingPhoneNumbers.jsonPOST /v1/phone-numbersCanadian numbers only; search first with GET /v1/phone-numbers/search.

Known differences

  • Recipients must be Canadian phone numbers; a non-Canadian destination is refused before anything is charged.
  • CASL consent is required before you can send: a missing or expired consent, or a recorded opt-out, is refused with 451 NO_CONSENT, CONSENT_EXPIRED or OPT_OUT_BLOCKED.
  • Live sending needs a verified account phone number; a live send before that is refused with 403 ACCOUNT_NOT_VERIFIED.
  • Test keys (mk_test_) simulate delivery: nothing reaches the carrier and nothing is charged.
  • Billing is per SMS segment, in Canadian dollars.
  • Data is stored in Canada.