How to send SMS messages with Modica
Configure Modica credentials, sender settings, and delivery status webhooks in Knock.
Knock integrates with Modica to send SMS notifications to your recipients.
Features
#- Delivery tracking
- Bounce support
- Knock link tracking
- Per environment configuration
- Sandbox mode
Getting started
#You can create a new Modica channel in the dashboard under the Channels and sources page in your account settings. From there, you'll need to configure the channel for each environment you have.
Knock sends messages through Modica's REST API v2, which authenticates each request with your gateway application name and password. You can find both on the REST API v2 configuration page in Modica.
Channel configuration
#Configure the following settings per environment. Navigate to Channels and sources in your dashboard account settings and select your Modica channel. Under Environment configurations, click the environment you'd like to configure to expand its settings, then click "Save changes" when you're done. Expand Advanced for additional options, including overrides and conditions.
Recipient data requirements
#In order to send an SMS notification you'll need a valid phone_number property set on your recipient. Modica expects the number in international format, for example +64211234567.
Delivery status webhooks
#When enabled, Modica sends delivery receipts directly to Knock, so message statuses update as soon as the carrier reports them. Without a webhook, Knock polls Modica for delivery status, and a receipt that arrives after polling ends won't update the message.
Modica only sends delivery receipts to a callback URL you've configured, so you'll need to set this up in both Knock and Modica.
Supported delivery statuses
#When delivery status webhooks are enabled for Modica, Knock updates message statuses based on these delivery receipts:
Other Modica statuses, such as sent, don't change the message status in Knock. Learn more about the bounced status in the message statuses docs.
Troubleshooting
#If delivery status updates aren't appearing in Knock:
- Check the DLR callback URL. Verify that the URL on the REST API v2 configuration page in Modica matches the webhook URL for the environment you're sending from.
- Verify the phone number format. Ensure recipients have phone numbers in international format, such as
+64211234567. - Check your gateway's API version. A
Cannot_Routeerror usually means your Modica gateway isn't set up for REST API v2. Modica's support team can confirm which version your gateway uses.