我一直在尝试使用RingCentral API发送传真,但无法指定From
传真电话号码来发送传真。它只使用公司传真号码发送传真。我无法找到使用号码传真的选项。我使用以下终点发送传真:
https://platform.ringcentral.com/restapi/v1.0/account/:accountId/extension/:extensionId/fax
答案 0 :(得分:1)
在RingCentral系统中,From
(或发送)传真号码是传真来电显示ID。您可以更新此扩展以用于传真,但该值在发送传真API本身中不可用。要在每次发送的基础上更改此设置,您可以在每次传真请求之前更新来电显示值。
您可以使用以下两种方法更新传真来电显示:
两者都在下面描述。如果这对您有用,请告诉我。
1)更新传真来电显示
要更新传真来电显示,请拨打PUT extension/caller-id
端点并使用您感兴趣的号码的电话号码ID更新callerId
功能的FaxNumber
。您可以通过调用下一部分中显示的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
属性将设置为VoiceFax
或FaxOnly
以下是显示一个数字的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支持多个来电显示值。要阅读扩展程序的值,请对extension/caller-id
端点进行以下API调用:
GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/caller-id
Authorization: Bearer {accessToken}
您将在byFeature
属性中收到类似以下内容的响应,其中包含一系列来电显示值。查找feature
属性设置为FaxNumber
的功能。我只在下方显示FaxNumber
功能来电显示,但该数组包含以下功能:CallFlip
,FaxNumber
,RingMe
,RingOut
,{{1} },MobileApp
。
Alternate
有关详情,请参阅API参考:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefGetCallerId
2)使用在线帐户门户
您还可以在以下位置更改在线帐户门户中的来电显示值:
{
"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"
}
}
}
]
}
> Settings
> Outbound Calls
> Caller ID
> By Feature
此知识库文章中提供了更多内容:
https://success.ringcentral.com/articles/RC_Knowledge_Article/3614
答案 1 :(得分:1)
与RingCentral Java SDK一起使用时,这对我有用。
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();
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);