Twilight test SMS does not call StatusCallback

I noticed that when I send a test SMS message with the Twilio API, everything works as described in the documentation , but the StatusCallback system is not called. The same parameter works fine with real credentials, I get a callback. Is this expected behavior?

This is how I send SMS:

/* Test credentials */ var account_sid = "<<test acc>>"; var auth_token = "<<test auth>>"; var fromNumber = "+15005550006"; // test number var fromNumberEnc = encodeURIComponent(fromNumber); var toNumberEnc = encodeURIComponent(toNumber); var textEnc = encodeURIComponent(text); var body = "From=" + fromNumberEnc + "&To=" + toNumberEnc + "&Body=" + textEnc + "&StatusCallback=" + "https%3A%2F%2Fexample.com%2Ftwiliocallback"; httpRequest.post({ url: "https://" + account_sid + ":" + auth_token + "@api.twilio.com/2010-04-01/Accounts/" + account_sid + "/SMS/Messages.json", headers: { 'content-type': 'application/x-www-form-urlencoded' }, body: body }, function (err, resp, body) { console.log(body); }); 
+4
source share
1 answer

Rob from Twilio is here.

The big question here is about using Twilio test credentials when creating against SMS API. You are right - StatusCallbacks do not start for the Messages resource when called with test credentials. In the documentation section of the StatusCallback link, you indicate that the API response will return the value that you set for the StatusCallback parameter when testing the purchase of a phone number without creating a message or phone call.

I am testing StatusCallbacks by mocking the StatusCallback request in my test using the parameters in the documentation here . The corresponding parameter that you want to test in the new message resource, MessageStatus .

+4
source

Source: https://habr.com/ru/post/1493658/


All Articles