简体   繁体   English

Salesforce:如何获取接收者的RingCentral扩展号码

[英]Salesforce: How do I get RingCentral extension number of receiver

I've installed RingCentral app and want to create cases based on conditions on extension number of receiver. 我已经安装了RingCentral应用程序,并希望根据接收方分机号上的条件创建案例。

A new task automatically gets created once you receive any call, I am going to write trigger to generate cases if receiver's extension matches my criteria. 接到任何电话后,将自动创建一个新任务,如果接收方的分机符合我的条件,我将编写触发器以生成案例。

Please let me know any workaround to get receiver extension number. 请让我知道获取接收方分机号码的任何解决方法。

Thanks 谢谢

I am not sure what you meant by saying that you have installed RingCentral app? 我不确定您是说安装了RingCentral应用程序是什么意思? But if you somehow have the phone number (from an incoming call, in coming sms, call-log etc.) and you want to detect the extension number of that phone number. 但是,如果您以某种方式拥有电话号码(从打来的电话,传入的短信,通话记录等),并且您想检测该电话号码的分机号。 Then the first requirement is that, that phone number must belong to the same RingCentral account you are logged in. The second requirement is you must login with the main account number of with an extension that has the Super Admin role. 然后,第一个要求是,该电话号码必须属于您登录的同一RingCentral帐户。第二个要求是,您必须使用具有Super Admin角色的分机的主帐户登录。 Below is some code in node JS to get extension number. 以下是节点JS中的一些代码,用于获取分机号。

var incallNumber = "+1234567890"
platform.get('/account/~/phone-number', {
usageType: 'DirectNumber'
})
.then(function(resp){
  console.log(resp)
  var json = resp.json()
  for (var record of json.records){
    //if (incallNumber == record.phoneNumber){
      console.log('Phone number: ' + record.phoneNumber)
      if (record.extension.hasOwnProperty('extensionNumber'))
        console.log('Extension number: ' + record.extension.extensionNumber)
      else
        console.log('No extension number')
      console.log('---')
    //}
  }
})

You can then replace the incallNumber with your number and uncomment the if condition to match them. 然后,您可以将incallNumber替换为您的号码,并取消注释if条件以使其匹配。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM