Wednesday, 26 April 2017

How to Send Pdf as MMS by Twilo Using Nodejs?

I have a Test Twilio Number which is capable to send SMS,MMS,Voice Call . I am Successful in sending SMS and Voice call .

I am facing a challenge to send PDF as MMS .. As per the TwilioDocs Accepted-mime-types PDF is a Supported Type.

While am trying to Send by using the Syntax :-

var accountSid = '<accountSid >';   
var authToken = '<authToken>';       
var client = require('twilio')(accountSid, authToken);
         client.messages.create({
            to: "<validnum>",
            from: "<validFrom>",  
            body: "Test Message ",
            mediaUrl: "http://docdro.id/GAak2pV"
            mediaContentType:"pdf"
        }, function(err, message) {
            if(err){
                console.log('Error Alert For Message '+JSON.stringify(err));
            }else{
                console.log(message.sid);
            }
        });

With the Above Code i can able to send JPG/PNG but PDF is being Failed by an Error:-

(Error: 30008) Unknown error. None

I have no clue Totally !! Somebody help me with a Saving Suggestion Thanks, Prasad.



via Prasad

No comments:

Post a Comment