Get a Dialing Context

Complete these tasks to get a list of a dialing-context.

Table - Prerequisites

Prerequisite More Information
Authenticate Authenticate

This example assumes you have exported the access token to the variable $TOKEN.

  1. List the dialing context.

    Use the filter parameter to list all immediate child contexts of a parent context.

    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&filter=<parentKey>"
  2. Retrieve a specified dialing-context along with its dial-patterns.
    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>"
  3. Retrieve a specific dial-pattern for a dialing-context.
    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>&dial-pattern=<removePrefix>/<pattern>"
  4. Retrieve a specific dial-pattern for a dialing-context when only the pattern is present.
    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>&dial-pattern=/<pattern>"
  5. Retrieve a specific dial-pattern for a dialing-context when only the remove-prefix is present.
    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.2/configuration/configElements?elementType=dialing-context&name=<childKey>&parent=<parentKey>&dial-pattern=<removePrefix>/"