无法通过twilio接收短信 [英] Unable to Receive the SMS via twilio

查看:896
本文介绍了无法通过twilio接收短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有twilio电话号码,视觉力页面和控制器.我有参考文档我已经关注.我通过twilio发送了 sms ,但无法接收短信.客户向twilio号码发送短信,它可以还原短信,但无法在 Salesforce Apex

I have twilio phone number,Visual force page and Controller.I have reference Document I have followed.I send an sms via twilio but unable to receive the sms. Customer Send an sms to twilio number it can revert back the sms but unable to receive the sms details in Salesforce Apex

视觉力页面

<apex:page controller="TwilioRequestControllerContacts" action="{!init}" showHeader="false" sidebar="false">
    <center>
        <apex:pageBlock title="Twilio Request Listener"></apex:pageBlock>          
    </center>
</apex:page>

控制器

public with sharing class TwilioRequestControllerContacts 
    {
        public String fromNumber      = ApexPages.currentPage().getParameters().get('From');
        public String toNumber        = ApexPages.currentPage().getParameters().get('To');
        public String body            = ApexPages.currentPage().getParameters().get('Body');
        public PageReference init()
        {
        try
        {           
           System.debug('STEP 0 FROM: ==========>' + fromNumber); 
           System.debug('STEP 1 TO: ===============>' + toNumber);
           System.debug('STEP 2 BODY: ==========>' + body); 
IF(fromNumber != NULL && toNumber = !NULL){
Case c = new Case(Subject = toNumber+fromNumber,Description =body);
insert c;
}

          }
catch(exception e){}
        RETURN null;
       }  
    }

这里动态发送SMS规范,而客户发送短信是可以的.但无法接收短信详细信息. 我在做正确的方法还是不能请某人帮助我

Here SMS conformation sent dynamically while customer send an sms it is ok. But unable to receive the SMS details. I am doing correct way or not can some one please help me

推荐答案

最后,我在客户发送SMS twilio电话号码时创建了一个案例.

Finally I have created a Case while Customer Sent an SMS twilio Phone number.

步骤:

  • 在沙盒中安装Twilio之后,我们需要创建一个Visualforce页面和一个指定的控制器.
  • 创建一个Force.com网站,并将Visualforce页面添加到您的网站.然后提供网站网址( https://sandbox.force.com/sms ).

路径:Setup>开发人员>新建"

Path :Setup > Developer > "New"

注意:网站网址和Twilio帐户SMS网址必须并且应该相同,否则HTTP发布请求将不会发布到您的Visualforce页面.

Note : The Site Url and Twilio Account SMS Url must and should be same other wise the HTTP post request will not post to your Visualforce page.

  • 授予站点对Controller和Case对象的访问权限.在网站详细信息"页面上,单击公共访问设置"以访问网站的访客用户配置文件.在案例对象上启用读取和编辑访问权限.将控制器Apex类添加到已启用Apex类访问"列表中.
  • 在沙箱中创建远程站点设置,即Twilio API的Endpoint Url.

路径:设置>管理>安全控制>远程站点设置>新建远程站点"

Path :Setup > Administer > Security Controls > Remote Site Settings > "New Remote Site"

然后将短信发送到您的Twilio电话号码.它将在沙箱中创建一个新案例.对于Salesforce,这是Twilio API的惊人概念.

Then send an SMS to your Twilio phone number. It will create a new case in the Sandbox. It is amazing concept of Twilio API for the Salesforce.

这篇关于无法通过twilio接收短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆