2

I set up a test account for twilio and my method in C# is sending sms correctly. But the status in response object (SMSMessage) is queued. I understand that if I pass a call back url, then twilio will update the status when it does get updated. My question is, how do I test it? I searched the internet and found that if I have thread.sleep(1000) and then hold on to the sid returned in response and make a call to the url https://api.twilio.com/2010-04-01/Accounts/AC123/SMS/Messages/08jdsxxxxxx.json where 08jdsxxxxxx is the sid returned then I could peek into the response. But this is giving me 401 error.

How to debug the message status changes? From a developer perspective, how to set up a local environment for callbackurl?

I searched the internet but couldn't find my info, their documentation does provide more info either.

Many thanks.

tess
  • 21
  • 2
  • 1
    I use a tool called ngrok: https://ngrok.com/ ...You can use this to setup secure tunnels to your localhost. It's very nifty, easy to use, and invaluable for developing with webhooks locally. You just set the callbackurl to whatever.ngrok.com, and ngrok will route it right to you! – Chris Jenkins May 13 '15 at 17:18

1 Answers1

3

Twilio developer evangelist here.

There are several ways you can do that, but because you said you're suing C#, there are two way I normally do it that give me all the flexibility I need. If I'm still inspecting callbacks and want to be using debugging, I use ngrok, which is as free application that tunnels requests from outside into your network.

My colleague Devin wrote an article explaining how to do this very thing. Check it out and I'm sure you will be able to do exactly what you're trying to.

The other option would be to create a free Azure account, and deploy your application there. That way you will can test live webhooks. Azure also has provisions that let you set breakpoint in your code for debugging, but ngrok makes it much easier, and you won't need to publish your code every single time.

Marcos Placona
  • 20,531
  • 11
  • 62
  • 92