POST - Create an NAPTR record in a Zone

Purpose

This API is used to create a new NAPTR (Naming Authority Pointer) DNS record within a specified zone in DDI Central. NAPTR records are used in advanced service discovery protocols, including ENUM for VoIP and SIP, by allowing mapping of regular expressions to services such as voice, email, or messaging. This API enables adding flexible and prioritized routing logic to DNS zones.

Request URL

Method: POST

https://{appconsole_IP}:{9443}/api/dns/zone/{zone_pk}/NAPTR/

Request Headers

The following headers must be included in the API request for successful authentication and data submission:

Authorization: DDI Central's OAuth implementation uses the Bearer authentication scheme. Hence, while making API calls, access_token obtained via the OAuth 2.0 Client Credentials Grant must be included in the Authorization header of API requests. This token verifies the client’s identity and ensures appropriate permissions for accessing resources.

The Authorization Header follows the format below:

headers = { "Authorization": "Bearer {bearer_tk}" }


Content-Type: Required in the header to indicate the media type of the resource being sent. It helps the server at the receiving end understand how to process the transmitted request body.

The Content-Type Header follows the format below:

headers ={ "Content-Type": "application/json" }

Path Parameters

  • zone_pk*  long
    • The primary key that uniquely identifies the DNS zone where the NAPTR record should be created. Ensures the record is added to the correct zone in DDI Central.

Request Body

  • domain_name*  string
    • The fully qualified domain name (FQDN) for the NAPTR record (e.g., "na94.green.com.").
  • domain_ttl*  integer
    • The time-to-live (TTL) for the DNS record in seconds (e.g., 86400).
  • zone_name*  string
    • The name of the DNS zone to which the record belongs (e.g., "green.com").
  • cluster_name*  string
    • The name of the cluster hosting the zone (e.g., "local-cluster"), used to scope the record creation to the correct DDI site.
  • records*  array
    • An array of NAPTR record objects, each containing:
      • order: (string/integer) Determines processing order (lower values are higher priority)
      • preference: (string/integer) Determines order among records with the same order value
      • flag: (string) Used to control how the next lookup stage is handled (e.g., "U" or "S")
      • service: (string) Identifies the service (e.g., "E2U+h323")
      • regexp: (string) A substitution expression used to rewrite the domain
      • replacement: (string) The next domain name to query

 

- Mandatory parameter.

 

Sample Request

Copied
{
    "domain_name": "na94.green.com.",
    "domain_ttl": 86400,
    "zone_name": "green.com.",
    "cluster_name": "local-cluster",
    "records": [
        {
        "order": "13",
        "preference": "10",
        "flag": "U",
        "service": "E2U+h323",
        "regexp": "!^.*$!sip:customer-service@green.com!",
        "replacement": "green.com."
        },
        {
        "order": "14",
        "preference": "11",
        "flag": "S",
        "service": "E2U+email",
        "regexp": "!^.*$!sip:consumer-service@green.com!",
        "replacement": "green.com."
        }
    ]
}
                                  

Sample Response

Copied
{
    "naptr_domain_id": 112,
    "zone_id": 12145,
    "domain_name": "na94.green.com.",
    "domain_ttl": 86400,
    "zone_name": "green.com.",
    "cluster_name": "chennai2",
    "records": [
        {
        "order": 13,
        "preference": 10,
        "flag": "U",
        "service": "E2U+h323",
        "regexp": "!^.*$!sip:customer-service@green.com!",
        "replacement": "green.com."
        },
        {
        "order": 14,
        "preference": 11,
        "flag": "S",
        "service": "E2U+email",
        "regexp": "!^.*$!sip:consumer-service@green.com!",
        "replacement": "green.com."
        }
    ]
}