rubyringcentralringoutcaller-id

Is it possible to set the caller id (CID/CLID) to Blocked in RingOut?


I'm using the RingCentral RingOut API and I'm wondering if I can block the caller ID?

The RingOut API only shows the phoneNumber property in the request format but RingCentral Online Account Portal can block the caller ID. Is there a way to do this?

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

Request:

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

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

I am using the 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
})

Solution

  • You can accomplish this by setting the default RingOut Caller ID setting to Blocked for the extension and then making a RingOut call without an explicit callerId value so the default value will be used. You need to update the extension Caller ID setting separately from and before calling the the RingOut API. It's not currently possible set Caller ID to blocked in the RingOut API call itself.

    To set the caller ID to Blocked in an account, use the Update Caller ID API:

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

    Here are some examples using HTTP and the Ruby SDK:

    Update Caller ID API via HTTP

    PUT /restapi/v1.0/account/~/extension/~/caller-id
    Authorization: Bearer <myAccessToken>
    
    {
      "byFeature": [
        {
          "feature": "RingOut",
          "callerId": {
            "type": "Blocked"
          }
        }
      ]
    }
    

    Update Caller ID API via Ruby SDK

    Using the ringcentral-ruby SDK:

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

    Update Caller ID via Web UI

    You can also update this setting using the Online Account Portal (https://service.ringcentral.com):

    Settings > Outbound Calls/Faxes > Caller ID > By Feature > RingOut from Web > Edit

    RingCentral Update Caller ID

    Making the RingOut Call

    When you make the RingOut call, simply omit the callerId property, and it will use the blocked value.