This API method fetches all records for a zone

Request

GET /records/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 records 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 /records/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/records/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

{
  "rrset":
  [
    {"id":"510","name":"@","readonly":"true","TTL":"86400","type":"NS","value":"ns1.gslb.me."},
    {"id":"511","name":"@","readonly":"true","TTL":"86400","type":"NS","value":"ns2.gslb.me."},
    {"id":"576","name":"@","readonly":"false","TTL":"86400","type":"MX","value":"10 mail"},
    {"id":"574","name":"@","readonly":"false","TTL":"600","type":"A","value":"1.2.1.2"},
    {"id":"573","name":"*","readonly":"false","TTL":"600","type":"A","value":"9.9.9.9"},
    {"id":"575","name":"mail","readonly":"false","TTL":"86400","type":"A","value":"3.3.3.3"},
    {"id":"572","name":"www","readonly":"false","TTL":"600","type":"CNAME","value":"web.domain2.com."}
  ]
}

Where:

  • rrset is an array detailing all records (record sets) for the requested zone:
  • id: internal id, to be used for deleting/modifying the rrset via Modify Zone Record and Delete Zone Record methods
  • name: the rrset name
  • readonly: true if the rrset can be modified/deleted, false otherwise
  • TTL: Time-To-Live in seconds. This is always 86400 for free users. Subscribers can fully customize TTL
  • type: the rrset type. Allowed types are A, AAAA, CAA, CERT, CNAME, LOC, MX, NS, RP, SOA, SPF, SRV, TXT
  • value: the rrset value