简体   繁体   中英

How to List RingCentral Greetings?

Is there a way to get a list of greetings? I got a "Method Not Allowed" response trying to call this endpoint. Is this another one of those endpoints where you need to be registered in the Beta program?

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

I want to use these ids to update greetings using the POST API:

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

Greetings are associated specific answering rule and you cannot reuse them so there's no real reason to get a list of greetings. That being said, you can enumerate the greetings in your system by calling the Answering Rule API.

Enumeration

You can view your greetings by calling the API for your answering rule. This example shows 1 custom greeting with a set of default greetings.

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

The response will have a set of greetings as show in the excerpt below:

{
    "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"
            }
        }
    ],

You can get a list of your answeringRuleId values by calling the answering-rule endpoint. This will include both your business-hours-rule and after-hours-rule ids as well as your custom answering rules:

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

Deletion

Greetings cannot be reused and are deleted from the system as long as they are no longer referenced. You can do this by either updating the rule with a different greeting or deleting the rule.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM