Skip to content
Start here

Get extension

client.Registrar.Extensions.Get(ctx, extension, query) (*ExtensionGetResponse, error)
GET/accounts/{account_id}/registrar/extensions/{extension}

Returns metadata and JSON Schema documents describing the expected input structure for registration operations on a specific extension (TLD).

Supports HTTP conditional GET via ETag. Include the ETag value from a previous response in an If-None-Match header to receive a 304 Not Modified when the data has not changed.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
extension string
query ExtensionGetParams
AccountID param.Field[string]

Identifier

maxLength32
ReturnsExpand Collapse
type ExtensionGetResponse struct{…}

Extension entry with metadata and JSON Schema documents for the registration operation.

Metadata ExtensionGetResponseMetadata

Extension metadata

Name string

The full name of the extension. For example, “co.uk”, or “uk”

TLD string

The tld of the extension. For example, for “co.uk”, it’s “uk”. For “uk”, it’s “uk”

RegistrationSchema unknown

JSON Schema describing the expected input structure for registration operations on this extension.

Get extension

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/registrar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  extension, err := client.Registrar.Extensions.Get(
    context.TODO(),
    "com",
    registrar.ExtensionGetParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", extension.Metadata)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "metadata": {
      "name": "name",
      "tld": "tld"
    },
    "registration_schema": {}
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "metadata": {
      "name": "name",
      "tld": "tld"
    },
    "registration_schema": {}
  },
  "success": true
}