是否可以在RingOut中将呼叫者ID(CID / CLID)设置为阻止?

时间:2018-05-07 16:12:51

标签: ruby ringcentral ringout caller-id

我使用的是RingCentral RingOut API,我想知道我是否可以屏蔽caller ID

RingOut API仅在请求格式中显示phoneNumber属性,但RingCentral在线帐户门户可以阻止来电显示。有没有办法做到这一点?

API参考:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefMakeRingOut

请求:

POST /restapi/v1.0/account/~/extension/~/ring-out HTTP/1.1

{
    "from": {"phoneNumber": "+14155550100"},
    "callerId": {"phoneNumber": "+16505550100"},
    "to": {"phoneNumber": "+12125550100"},
    "playPrompt": true
}

我正在使用Ruby SDK:https://github.com/ringcentral/ringcentral-ruby

rc.post('/restapi/v1.0/account/~/extension/~/ring-out', payload: {
  from: {phoneNumber: "+14155550100"},
  callerId: {phoneNumber: "+16505550100"},
  to: {phoneNumber: "+12125550100"},
  playPrompt: true
})

1 个答案:

答案 0 :(得分:2)

您可以通过为扩展程序将默认的RingOut来电显示设置设置为Blocked,然后在没有明确callerId值的情况下进行RingOut调用来完成此操作,以便使用默认值。您需要在调用RingOut API之前和之前单独更新扩展来电显示设置。目前无法在RingOut API调用本身中设置调用者ID。

要在帐户中将来电显示设置为Blocked,请使用更新来电显示API:

API参考:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefUpdateCallerId

以下是使用HTTP和Ruby SDK的一些示例:

通过HTTP更新来电显示API

PUT /restapi/v1.0/account/~/extension/~/caller-id
Authorization: Bearer <myAccessToken>

{
  "byFeature": [
    {
      "feature": "RingOut",
      "callerId": {
        "type": "Blocked"
      }
    }
  ]
}

通过Ruby SDK更新来电显示API

使用ringcentral-ruby SDK

rc.put('/restapi/v1.0/account/~/extension/~/caller-id', payload: {
  byFeature: [
    {
      feature: "RingOut",
      callerId: {
        type: "Blocked"
      }
    }
  ]
})

通过网络用户界面更新来电显示

您还可以使用在线帐户门户(https://service.ringcentral.com)更新此设置:

Settings&gt; Outbound Calls/Faxes&gt; Caller ID&gt; By Feature&gt; RingOut from Web&gt; Edit

RingCentral Update Caller ID

拨打RingOut电话

当你进行RingOut调用时,只需省略callerId属性,它就会使用被阻止的值。