【问题标题】:Fax "from" and "callerId" parameters missing from RingCentral fax APIRingCentral 传真 API 中缺少传真“from”和“callerId”参数
【发布时间】:2018-04-30 11:33:03
【问题描述】:

我一直在尝试使用 RingCentral API 发送传真,但无法指定 From 传真电话号码来发送传真。它仅使用公司传真号码发送传真。我无法从号码中找到使用传真的选项。我正在使用以下端点发送传真:

https://platform.ringcentral.com/restapi/v1.0/account/:accountId/extension/:extensionId/fax

【问题讨论】:

    标签: api post fax ringcentral caller-id


    【解决方案1】:

    在 RingCentral 系统中,From(或发送)传真号码是传真呼叫者 ID 值。您可以更新此扩展程序以用于您的传真,但该值在发送传真 API 本身中不可用。要在每次发送的基础上更改此设置,您可以在每次传真请求之前更新呼叫者 ID 值。

    您可以使用两种方法更新传真呼叫者 ID:

    1. 通过 API 或
    2. 使用在线帐户门户 (https://service.ringcentral.com),下面将介绍这两种方法。

    两者都在下面描述。让我知道这是否适合您。

    1) 更新传真来电显示

    要更新传真呼叫者 ID,请致电 PUT extension/caller-id 端点并使用您有兴趣使用的号码的电话号码 ID 为 FaxNumber 功能更新 callerId。您可以通过调用下一节中显示的extension/phone-number 来获取此列表。

    PUT /restapi/v1.0/account/{accountId}/extension/{extensionId}/caller-id
    Authorization: Bearer {accessToken}
    Content-Type: application/json
    
    {
      "byFeature": [
        {
          "feature": "FaxNumber",
          "callerId": {
            "phoneInfo": {
              "id": 33333333
            }
          }
        }
      ]
    }
    

    有关更多信息,请参阅 API 参考:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefUpdateCallerId

    1.1) 列出您可用的来电显示号码

    要获取您可以使用的号码列表,请调用GET extension/phone-number 端点:

    GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/phone-number
    Authorization: Bearer {accessToken}
    

    在您的 JSON 响应中,您将在 records 属性中获得电话号码列表。您可以使用的数字将具有以下属性值:

    • features 属性将具有 CallerId
    • type 属性将设置为 VoiceFaxFaxOnly

    以下是显示一个数字的 JSON 响应的摘录。你应该有更多的数字和一个paging 对象。

    {
      "uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/22222222/phone-number?page=1&perPage=100",
      "records":[
        {
          "id":33333333,
          "phoneNumber":"+16505550100",
          "paymentType":"Local",
          "location":"Belmont, CA",
          "type":"VoiceFax",
          "usageType":"DirectNumber",
          "status":"Normal",
          "country":{
            "uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1",
            "id":"1",
            "name":"United States"
          },
          "features":[
            "SmsSender",
            "CallerId",
            "MmsSender"
          ]
        }
      ]
    }
    

    有关更多信息,请参阅 API 参考:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefUserPhoneNumbers.html

    1.2) 读取传真来电显示值

    RingCentral 支持多个呼叫者 ID 值。要读取扩展程序的值,请对 extension/caller-id 端点进行以下 API 调用:

    GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/caller-id
    Authorization: Bearer {accessToken}
    

    您将收到如下响应,其中包含 byFeature 属性中的一组呼叫者 ID 值。查找将feature 属性设置为FaxNumber 的功能。我只在下面显示 FaxNumber 功能调用者 ID,但该数组包含以下功能:CallFlipFaxNumberRingMeRingOutMobileAppAlternate

    {
      "uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/22222222/caller-id",
      "byFeature":[
        {
          "feature":"FaxNumber",
          "callerId":{
            "type":"PhoneNumber",
            "phoneInfo":{
              "uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/phone-number/33333333",
              "id":"33333333",
              "phoneNumber":"+16505550100"
            }
          }
        }
      ]
    }
    

    有关更多信息,请参阅 API 参考:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefGetCallerId

    2) 使用在线帐户门户

    您还可以在以下在线帐户门户中更改来电显示值:

    Settings > Outbound Calls > Caller ID > By Feature > Fax Number

    此知识库文章中提供了更多信息:

    https://success.ringcentral.com/articles/RC_Knowledge_Article/3614

    【讨论】:

    • 您能否解释一下使用 RIngCentral SDK 的方法。其实我用的是java SDK。
    • 感谢您发布 Java 答案。我更新了格式。点击“编辑”查看是如何完成的。
    • 感谢@Grokify 使代码更具可读性..
    【解决方案2】:

    这对我使用 RingCentral Java SDK 时有用。

    1. 获取可用于传真/通话的发件人/来电者号码列表
    RestClient rc = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER);
    rc.authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD);
    
    GetExtensionPhoneNumbersResponse numbers = rc.restapi().account().extension().phonenumber().get();
    
    1. 更新发件人/来电者号码
    RestClient rc = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER);
    rc.authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD);
              
    ExtensionCallerIdInfo resp = rc.restapi().account().extension().callerid().get();
    
    for (CallerIdByFeature e : resp.byFeature) {
        if (e.callerId.phoneInfo != null) {
            e.callerId.phoneInfo.phoneNumber("**********");
        }
    }
    resp = rc.restapi().account().extension().callerid().put(resp);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多