c# - How to get media from Twilio incoming MMS that hits Web API -


i have set twilio number post app's api controller. controller hit when send photo message twilio number , response text sent nice. using twilio.mvc , twilio.twiml nuget packages.

i'm wondering how can access image photo message in controller. code below, twiliorequest comes in null. null regardless of if send sms or mms twilio number.

am using twiliorequest or there other parameter can use information message in controller? messages sending , being responded properly, not know how view , use content/media sent twilio number.

    // post: api/testresponse     public httpresponsemessage post(twiliorequest twiliorequest)     {         var twilioresponse = new twilioresponse();          twilioresponse.sms("this test response text");          return request.createresponse(httpstatuscode.ok, twilioresponse.element, new xmlmediatypeformatter());      } 

thank time. please let me know if being unclear or if need additional information me.

the mms parameters directly in request object. here gist of worked mvc project:

var tmp= request.params["nummedia"]; int nummedia= int.parse(tmp); if(nummedia > 0) {     var msg = "found " + nummedia + " mms things";      (int = 0; < nummedia; i++)     {         var mediatype = request.params["mediacontenttype" + i];         var mediaurl = request.params["mediaurl" + i];         //save info database or download media     }     //do 'msg' } 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -