Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Text Messages < Late Binding | Conditional Formatting >
Back to Text Messages    Comments List
Twilio Return Code 201 issue Pinned    Upload Images   Link   Email  
Richard Pitassy        
2 years ago
It appears that Twilio Return Level 201 does not necessarily mean that the text message was successfully delivered.  I ran a test by sending a text to a known landline.  It resulted in a Return Level 201 and a "SUCCESS" Result Text message on my form.  However, my Twilio message log shows the message as Undelivered -  "Error: 30006 Landline or unreachable carrier..."  I believe that a Delivered Message Returns Error Code 0.

Is there a way to modify the code shown in the SMS Extended Cut video to capture the Twilio Error Code instead of, or in addition to, the Return Level?

I have tested this a few times with the same result each time. Otherwise, works GREAT!

Thanks.
Richard Rost             
2 years ago
Yeah, that 201 code probably means "your message has been received by our system and will be sent," however it doesn't necessarily indicate that it was successfully sent to the recipient. Any number of errors could have happened along the way like, for example, you tried texting a landline.

As I believe I mentioned in the video, I don't use this service myself for sending SMS messages, so it's not something I'm super familiar with. I'll have to dig a bit to find out more info. You may be better off emailing their tech support for an answer. They've always been super helpful to me. I'm curious to hear what they say.
Richard Pitassy        
2 years ago
Thanks Richard.  I'll check with them and let you know what they say.
Richard Pitassy        
2 years ago
Richard:  As you suggested I reached out to Twilio on this issue and here is the response I got:

Joced N (Twilio)
Sep 1, 2022, 11:03 AM PDT
Hello Richard,
Thanks for contact Twilio support, I will be happy to help you here; actually, that's expected because the return level makes reference to the HTTP status, it could be 2XX when your request is reaching Twilio and we are sending the message with no problem, but delivery status is a different parameter.
The best way to update the delivery status is setting a webhook to receive our status callback when message status is changing. The information on how to do it is on this article, (link below)  there is no code example for VBA, but the process on Twilio is basically the same, you just need to change the code to get the information on VBA.
Please let me know if I was clear enough and if you need further help.
Regards,
Joced N | Twilio Technical Support

https://www.twilio.com/docs/sms/tutorials/how-to-confirm-delivery

I've looked at the referenced article but I don't have a clue how to translate their code into my VBA code.  Hope you can help.  Thanks.
Alex Hedley             
2 years ago
C#
https://www.twilio.com/docs/sms/tutorials/confirm-delivery-csharp-aspnet-mvc?code-sample=code-send-an-sms-with-a-statuscallback-url&code-language=C%23&code-sdk-version=5.x#linkcode

// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Program
{
    static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var message = MessageResource.Create(
            body: "McAvoy or Stewart? These timelines can get so confusing.",
            from: new Twilio.Types.PhoneNumber("+15017122661"),
            statusCallback: new Uri("https://your-bin-id-here.x.pipedream.net/sms_status_callback"),
            to: new Twilio.Types.PhoneNumber("+15558675310")
        );

        Console.WriteLine(message.Sid);
    }
}
Alex Hedley             
2 years ago
CSharp Lib (GitHub)
Richard Pitassy        
2 years ago
Alex:  Thanks for the information.  I saw this code on the Twilio website but I'm afraid it's way over my head.  I don't understand how I could use C# code in my VBA application.  I have a feeling that ignorance on this issue is causing me to ask for more help than is appropriate for this forum.  If so, I completely understand.  Richard said he would be curious to see Twilio's response so I'm hoping he takes a look.
Kevin Robertson            
2 years ago
Richard Pitassy        
2 years ago
In the meantime, I'm working around the issue by using a Customer lookup combobox which is based on a query limited to customers with verified (by me) cell phone numbers.  (I don't like asking new customers if the number they are giving us is a cell phone.)  We only enter 2 - 5 new customers a day to there is no real burden in verifying each one as a cell phone on the Internet.
Richard Rost             
2 years ago
Looks like the link Kevin provided has the code that would allow you to set up the "webhook" to get a status. I don't have time right now to walk through and test it, but perhaps in the future I'll get some free time to check it out.
Scott Axton            
2 years ago

Richard -
You said, "I don't like asking new customers if the number they are giving us is a cell phone."

I spend all day on the phone with customers.   If I have them in person or on the phone - NO WAY am I spending the time to look up a number.  I enter 20 or more live and another 60-70+, from forms the customers fill out, per day. The forms have a check box to designate Cell or Land Line.

When I'm talking to them my "script" goes something like this:
(Keep in mind they called me to get a booking or info.)

Me:  "OK, Let me get you into the data base so we can get a reservation set up for you."
I walk them them through my fields as I'm typing. FN, LN, Addr, Zip (Access fills in city and state - I verify city)

Me:  "Just in case I need to get a hold of you, what is a good daytime phone starting with Area code?" (Many people don't
         give out business numbers for personal stuff.  That is why I say "daytime phone".)

Them:  720-555-1212
        I usually recognize local area codes but non-local area codes are usually a dead give away as being cell.  

Me:  I casually ask, "Is that a cell phone?" on all phones.

I haven't kept track but I bet 98% of the numbers I get any more are cells / mobile.  People just don't get upset at all - depending how you ask for the info. Usually they answer, "Yeah, that's my cell."

If they do ask, I just say - "Just curious. It seems like more and more people don't have land lines."  That satisfies 99.9% of the people.

If they tell me, from the first, that the number is a land line I say, "Do you have a cell I can put down as an alternate number?"

Some people don't like to give a cell and that is OK.  More often than not people tell me, "Yeah I still have a land line, but I never answer it.  It's usually just sales people."

It's all how you ask for the info.  I just assume they are going to give me what I need and say "let me have your info."  Rather than, "may I have your info?"  Polite but firm. Professional, yet conversational.  If they absolutely don't want to give it out - no big deal with the exception of a few key pieces of data.

Try it - It might save you a bunch of internet lookup work.

Richard Pitassy        
2 years ago
Yes Scott, you are right. 90+ percent of the numbers we get are cell numbers so I realize I'm trying to solve a problem I don't have.  And I appreciate your advice which is most like exactly what we will do.  My problem is I'm anal especially with the operation of my application.  I have the impluse to MAKE IT WORK LIKE IT'S SUPPOSED TO!  :)  I did send another email to the Twilio folks to see if they would help me futher.  I'm not optimistic but we'll see what happens.  In any event, thanks so much for you info and advice.  For now, I think it's time for me to move on to the next challenge.  Except for the issue, the thing works great.  If I do come up with the VBA solution to this, I'll post it.
Richard Pitassy        
2 years ago
. . . and Richard, thanks again for taking a look.  I'll keep my eye out for anything further form you on this.  Appreciate it.
Scott Axton            
2 years ago
Richard thanks for reading my book.  LOL  I am also pretty anal when it comes to data correctness. (Is that a word?)
The thing I was trying to get across is if you act creepy they perceive it creepy, if you're just in a conversation you can get lots of information that you would otherwise not get.

Please do keep us up to date on what you find out from Twilio.  I haven't implemented this in my db yet but it is on my list to do.  I'm interested !
Richard Pitassy        
2 years ago
Will do Scott!  Appreciate your thoughts and interest.  Just as an aside, we have a staff of sales folks who interact with the customers who have varying degrees of "social skills", if you know what I mean but we'll make it work.  Thanks again and I'll keep you posted on any futher developments.  Dick
Richard Rost             
2 years ago
Along those lines, back in the day in the early 90s when I used to advertise by sending a faxed newsletter to thousands of businesses in Buffalo New York, I would just call companies and very matter of factly say "hey can I get your fax number?" They almost never questioned it because I made it sound like I needed it for some business purpose. I didn't. I was just sending them advertising. Lol
Richard Pitassy        
2 years ago
Sounds like a lawyer!!!  (It's ok, I used to be one) :)
Richard Pitassy        
2 years ago
Further response from Twilio FYI:

Thanks for your reply, I am not sure how much I can help you because I am not an expert with VBA, but I can explain you what
a webhook is and maybe understanding it you can find the best way to use it on your code. The webhook is a url where we can send
you the information of the status callback, and it will handle that information to give you the option to pull it;
I would recommend you to check the webhook options on Google because there are a few service that provide a webhook to get easy
access to information.

Regards,
Joced N | Twilio Technical Support

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Text Messages.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/23/2024 1:08:02 AM. PLT: 1s