【问题标题】:How to receive the SMS via twilio如何通过 twilio 接收短信
【发布时间】:2014-06-20 11:48:43
【问题描述】:

我有installed the twilio package 和以下组件。如何配置这两个组件?当客户发送短信时,它不会在沙箱中创建案例。我无法接收短信详细信息。什么是 twilio 消息 url 我应该在哪里给销售人员?

我对 twilio 配置完全陌生。有人可以帮忙吗。 每当客户发送短信时,它应该使用 twilio api 在沙箱中自动创建一个案例。

组件一:视觉力法格

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

组件 2:控制器

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);
       System.debug('STEP 3  ==============>');                 
       String account = 'xxxxxxxxxxx';   
       String token = 'xxxxxxxxxxxx';
       TwilioRestClient client = new TwilioRestClient(account,token);
       system.debug('STEP 4 test==3>'+client);
       if(fromNumber != null && toNumber != null) {  
       //my own logic                
        Case ca = new Case(Subject = fromNumber,Description = body,Origin = 'Phone');
           INSERT ca;       
           RETURN null;
       }
    }                
   catch(exception e){
        system.debug('STEP 7 error ==========>'+e);
   }
    RETURN null;
   }  
}

【问题讨论】:

标签: salesforce apex-code twilio visualforce


【解决方案1】:

去看看这篇文章,这一定会对你有所帮助

http://abhithetechknight.blogspot.in/2014/06/salesforce-integration-with-twilio.html

问候, 阿比·特里帕蒂 SFDC 认证开发者

【讨论】:

  • 请在您的答案中包含基本点,并有链接作为参考。这样,如果将来链接断开,您的答案仍然可以独立存在。
  • @user2352 发送短信。我需要在salesforce中使用twilio api接收短信。
  • 我同意@user2352,我也使用twilio api发送了一条短信但无法接收短信
  • 我找到了解决方案。现在我已经通过 Salesforce 中的 twilio API 收到短信了。stackoverflow.com/questions/24339900/…
猜你喜欢
  • 2014-08-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-08-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多