This API method fetches a zone configuration

Request

GET /zone/zone_name HTTP/1.0
Host: api.gslb.me 
Accept: encoding_type
Authorization: Basic base64_credentials

Where:

  • zone_name is the name of the zone you want to get configuration for (ie.: mydomain.com)
  • base64_credentials is username:password in base64-encoded format (HTTP Basic Authentication)
  • encoding_type is either application/xml or application/json (if the “Accept” header is omitted, response will be JSON-encoded)

Sample requests:

  • Raw request:
GET /zone/mydomain.com HTTP/1.0
Host: api.gslb.me 
Accept: application/json
Authorization: Basic dGVzdHVzZXJAZ3NsYi5tZTp0ZXN0cGFzc3dvcmQK
  • Using curl:
curl -u testuser@gslb.me:testpassword -H "Accept: application/json" -k https://api.gslb.me/zone/mydomain.com

Response

  • In case of invalid zone:
HTTP/1.1 404 Not Found
Content-Type: application/json

{"message":"Zone not found","returncode":"2"}
  • In case of internal error:
HTTP/1.1 500 Server Error
Content-Type: application/json

{"message":"Internal error, please contact support@gslb.me","returncode":"4"}
  • In case of success:
HTTP/1.1 200 OK
Content-Type: application/json

{
  "geohosts":null,
  "rrsets":
  {
    "rrset":
    [
      {"id":"414","name":"@","readonly":"true","TTL":"86400","type":"NS","value":"ns1.gslb.me."},
      {"id":"415","name":"@","readonly":"true","TTL":"86400","type":"NS","value":"ns2.gslb.me."},
      {"id":"416","name":"@","readonly":"true","TTL":"86400","type":"NS","value":"ns3.gslb.me."},
      {"id":"417","name":"@","readonly":"true","TTL":"86400","type":"NS","value":"ns4.gslb.me."},
      {"id":"2090","name":"mail","readonly":"false","TTL":"86400","type":"CNAME","value":"@"},
      {"id":"2092","name":"@","readonly":"false","TTL":"86400","type":"CNAME","value":"gslb.me."}
    ]
  },
  "zone":
  {
    "active":"true", "expire":"1209600", "name":"mydomain.com", "needscommit":"false",
    "postmaster":"postmaster@mydomain.com", "refresh":"3600", "retry":"600",
    "serialnumber":"1365066235", "sourceHost":"ns1.gslb.me", "ttl":"3600"
  }
}

Where:

  • geohosts is an array detailing all geohosts for the requested zone (see “Get Geohost Configuration” for the format of each array item)
  • rrsets is an array detailing all records (record sets) for the requested zone:
  • id: internal id, to be used for deleting/modifying the rrset (see rrset methods)
  • name: the rrset name
  • readonly: true if the rrset can be modified/deleted, false otherwise
  • TTL: Time-To-Live in seconds
  • type: the rrset type. Allowed types are A, AAAA, CNAME, LOC, MX, NS, RP, SOA, SPF, SRV, TXT
  • value: the rrset value
  • zone lists all parameters for the zone:
  • active: zone can be either enabled or disabled
  • expire: the SOA expire field
  • name: the zone name
  • needscommit: if true the zone has uncommitted changes that need to be committed in order to become active
  • postmaster: the SOA postmaster field
  • refresh: the SOA refresh field
  • retry: the SOA retry field
  • serialnumber: the SOA serial number field
  • sourcehost: the SOA source host field
  • TTL: the SOA TTL field