We are not currently able to set a messageId when sending messages via a Twilio channel.
As described below, without using a messageServiceId this will result in message blocking by Twilio.
I suspect this may be something that should be implemented as a default in the channel configuration.
And possibly make it overridable when sending a message (we don't need that, just a thought).
There is an API explorer available in Twilio that shows use of the Messaging Services SID:
curl 'https://api.twilio.com/2010-04-01/Accounts/ACCOUNTREMOVED/Messages.json' -X POST \ --data-urlencode 'From=+15555555555' \ --data-urlencode 'MessagingServiceSid=IDREMOVED' \ -u TOKENREMOVED:[AuthToken]
Email notification from Twilio:
You’re receiving this email from Twilio because you’ve sent SMS or MMS messages to U.S. phone numbers from a ten-digit long code (10DLC) phone number in the past 60 days.
What do you need to know?
Effective July 5, 2023, all SMS and MMS messages sent to U.S. phone numbers using 10DLC phone numbers must be sent via a registered application-to-person (A2P) campaign. This will require additional time when setting up new phone numbers or new messaging campaigns, for collection, submission, and processing of registration data, and third-party approval of your messaging campaigns.
If you send messages using unregistered phone numbers, they will be subject to a gradual increase of message blocking by Twilio, beginning on July 5, 2023, ultimately leading to a full block of all U.S.-bound messages sent after August 31, 2023. Blocked messages will receive new error code 30034 designated for unregistered 10DLC messages. Twilio messaging rates will still apply, even for blocked messages.
To check the A2P 10DLC registration status of your Twilio phone numbers, use our How do I check that I have completed US A2P 10DLC registration? guide.
Why is this happening?
The gradual increase in message blocking starting on July 5, 2023, gives customers an opportunity to take action by moving messaging to registered A2P campaigns before Twilio fully blocks unregistered messages on August 31, 2023.
U.S. A2P 10DLC registration is required by all major U.S. telecommunications carriers. Twilio introduced 10DLC registration options in 2021 and this is the next step in our effort to help create a fully-verified U.S. messaging ecosystem.
What do you need to do?
If you already send all of your U.S. messaging using registered A2P campaigns, you don’t need to do anything.
If your service or application relies on provisioning new 10DLC phone numbers to send messages to U.S. recipients, you’ll need to associate those numbers with an existing approved A2P campaign, or begin a new A2P campaign registration before sending messages.
Note that A2P campaign registration takes time, and requires Twilio to cooperate with third parties for carrier approval. For the latest information on processing times, see our A2P 10DLC Campaign Vetting Changes guide. We also have a pre-recorded webinar, Level Up with Compliance: Understanding A2P 10DLC Regulations as an ISV, with tips for Twilio customers who register A2P campaigns for their end customers. If you have additional questions, we’ll be hosting a live Level Up event on Thursday May 18, 2023, 10 a.m. PDT. Register now.
As an alternative to A2P 10DLC, you may also consider using Toll-Free phone numbers and complete Toll Free Verification for your use cases.