Modify Zone Record

This API method modifies an existing zone record. . After modifying one or more records the Commit Zone API method must be called in order to make the change(s) active.

Request

PUT /record/zone_name/record_id/record_name/record_type/record_value/record_TTL HTTP/1.0
Host: api.gslb.me 
Accept: encoding_type
Content-Length: 0
Authorization: Basic base64_credentials

Where:

  • zone_name is the name of the zone for which you want to modify a record for (ie.: mydomain.com)
  • record_id is the ID of the record you want to modify. Records IDs can be retrieved using the Get Zone Records method
  • record_name is the name of the record you want to create (ie.: www to create the FQDN www.mydomain.com)
  • record_type is the type of the record you want to create (supported types are A, AAAA, CAA, CERT, CNAME, LOC, MX, NS, RP, SOA, SPF, SRV, TXT)
  • record_value is the value of the record you want to create. The record value must be coherent with the record_type (ie. MX records must be in the “xx FQDN” format where xx is the MX priority, all IPs must be public, etc)
  • record_TTL is the record TTL in seconds, ranging from 30 to 86400
  • 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)

Note: The “Content-Length: 0” header is mandatory.

Sample requests:

  • Raw request:
POST /record/mydomain.com/572/www/A/192.168.1.2/600 HTTP/1.0
Host: api.gslb.me
Accept: application/json
Content-Length: 0
Authorization: Basic dGVzdHVzZXJAZ3NsYi5tZTp0ZXN0cGFzc3dvcmQK
  • Using curl:
curl -u testuser@gslb.me:testpassword -X PUT -H "Accept: application/json" -H "Content-Length: 0" -k https://api.gslb.me/record/mydomain.com/572/www/A/192.168.1.2/600

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 invalid record ID:
HTTP/1.1 404 Not Found
Content-Type: application/json

{"message":"Record not found","returncode":"2"}
  • In case of inconsistent record type and value / if RFC1918 IPs are used:
{"message":"Inconsistent parameters, cannot create record","returncode":"3"}
  • In case of success:
HTTP/1.1 200 OK
Content-Type: application/json

{"message":"Done","returncode":"0"}
  • 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"}