4

we use Twilio (SMS sending platform) to send SMS via Parse Cloud Code. We create the following js method to perform that :

var client = require('twilio')(CONSTANTS.SMS_TWILIO_ACCOUNT_SID, CONSTANTS.SMS_TWILIO_AUTH_TOKEN);

function sendSMS(from, to, message, success, error) {
  
  console.log("from:" + from + " to:" + to + " message:" +message);

  client.sendSms({
    to:to,
    from: from,
    body: message
  }, function(err, responseData) {
    if (err) {
      error(err, responseData);
    } else {
      success(err, responseData);
    }
  });
}

This code work perfectly until this now. During this night, we received always the following error in Parse logs console :

{"status":0,"message":"Unable to complete HTTP request"}

On device, the error return by Parse contain code error 141 :

{"status":0,"message":"Unable to complete HTTP request"} (Code: 141, Version: 1.12.0)

I try to send SMS directly from Twilio Website and it work perfectly. Do think Parse have an issue with HTTP request send from Cloud Code?

Regards

3
  • 1
    There is currently a known issue happening between Parse and Twilio. You can watch this Github issue for updates: github.com/twilio/twilio-node/issues/152. The issue also has work-around in the thread. Commented Feb 25, 2016 at 14:03
  • 1
    Looks like Parse have also opened an issue on their end as well: developers.facebook.com/bugs/1696266953962575 Commented Feb 25, 2016 at 14:08
  • Running into this with my app as well - using programmable SMSes from Parse cloud code using the twilio module. Code did not change - this started happening a few hours ago. Commented Feb 25, 2016 at 22:01

1 Answer 1

2

Twilio Support here.

We have a temporary alternate endpoint in place that you can use: api.twilio.com:8443

Example:

Parse.Cloud.httpRequest({
    method: "POST",
    url: "https://{your AccountSID}:{your AuthToken}@api.twilio.com:8443/2010-04-01/Accounts/{your AccountSID}/Messages.json",
    body: {
        To: "",
        From: "",
        Body: ""
    }
}).then(
    function(httpResponse) {
        console.log(httpResponse.text); // SUCCESS
    },
    function(httpResponse) {
        console.log(httpResponse.text); // ERROR
    }
);
}
Sign up to request clarification or add additional context in comments.

1 Comment

Following up on this, Parse has now reverted the change to their certificates which should resolve the issue. This work-around should no longer be required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.