如何列出 RingCentral 问候语?

How to List RingCentral Greetings?

有没有办法获得问候语列表?我在尝试调用此端点时收到 "Method Not Allowed" 响应。这是您需要在 Beta 程序中注册的另一个端点吗?

GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/greeting

我想使用这些 ID 通过 POST API:

更新问候语

POST /restapi/v1.0/account/{accountId}/extension/{extensionId}/greeting/{greetingId}

问候语与特定的回答规则相关联,您不能重复使用它们,因此没有真正的理由获取问候语列表。也就是说,您可以通过调用应答规则 API.

来枚举系统中的问候语

枚举

您可以通过拨打 API 来查看您的问候语。此示例显示 1 个自定义问候语和一组默认问候语。

GET /restapi/v1.0/account/~/extension/~/answering-rule/{answeringRuleId}

响应将包含一组问候语,如下面的摘录所示:

{
    "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/22222222/answering-rule/business-hours-rule",
    "id": "business-hours-rule",
    "type": "BusinessHours",
    "enabled": true,
    "schedule": {
        "ref": "BusinessHours"
    },
    "greetings": [
        {
            "type": "Voicemail",
            "custom": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/22222222/greeting/33333333",
                "id": "33333333"
            }
        },
        {
            "type": "Introductory",
            "preset": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/greeting/66301",
                "id": "66301",
                "name": "None"
            }
        },
        {
            "type": "ConnectingAudio",
            "preset": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/greeting/66310",
                "id": "66310",
                "name": "Acoustic"
            }
        },
        {
            "type": "ConnectingMessage",
            "preset": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/greeting/68867",
                "id": "68867",
                "name": "Default"
            }
        },
        {
            "type": "HoldMusic",
            "preset": {
                "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/greeting/197382",
                "id": "197382",
                "name": "Acoustic"
            }
        }
    ],

您可以通过调用 answering-rule 端点获取 answeringRuleId 值的列表。这将包括您的 business-hours-ruleafter-hours-rule ID 以及您的自定义应答规则:

GET /restapi/v1.0/account/~/extension/~/answering-rule

删除

问候语不能重复使用,只要不再被引用就会从系统中删除。您可以通过使用不同的问候语更新规则或删除规则来执行此操作。