Modify Domain recordsΒΆ

If you want modify contacts or NS records you must send PUT request to https://globalr.com/api/domain.

There are four block of contact information - Owner, Administrative, Technical and Billing. Each block could be updated seperately. While update of any information in some block, whole information of the block must be sent.

Hint

For .AM domain in the block of owner you can’t change Name and Last Name or Company Name (in case of organization) information. This part requires printed documents.

Change domain contact information.

{
  "name": "string",
  "contacts": {
    "admin": {
      "name": "string",
      "surname": "string",
      "organisation": "string (Optional)",
      "email": "string",
      "phone": "string (/^\+?[^a-zA-Z]{5,}$/)",
      "mobile_phone": "string (/^\+?[^a-zA-Z]{5,}$/) (Optional)",
      "fax": "string  (Optional)",
      "country": "string (Country code or Name)",
      "city": "string",
      "state": "string",
      "address": "string",
      "address2": "string  (Optional)",
      "zip": "number",
    }
  }
   "_am-private":"boolean(optional, only for am)",
}

Lets implement this in PHP

<?php
    $contact = array(
        'name' => "Jhone",
        'surname' => "Smith",
        'email' => "new-email@gmail.com",
        'phone' => "+37455555555",
        'country' => "US",
         'city' => "New York",
        'address' => "Example Street",
        'zip' => "001110"
    );
    $domainModel = [
        'name' => 'test-for-globalr.am',
        'contacts' => [
            'admin' => $contact,
            'owner' => $contact,
            'technical' => $contact,
            'billing' => $contact,
        ],
        "_am-private"=>1
    ];
    $resault = sendToGlobalR($domainModel, 'PUT', '/domain', 'xXGsvO26ntTHTESTKEYSOICKu8nOvMzKKiwg');
    $domain = json_decode($resault);

Change nameservers. Send following model of request.

{
  "name": "string",
  "ns":
  [
    {
      "name": "string",
      "ip": "string (Optional)",

    },
    {
      "name": "string",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",
    }
  ],
}

Lets implement this in PHP

<?php
     $domainModel = [
        'name' => 'test-for-globalr.am',
        'ns' => [
            ['name'=>'ns3.globalr.com'],
            ['name'=>'ns4.globalr.com'],
        ]
    ];
    $resault = sendToGlobalR($domainModel, 'PUT', '/domain/nameservers/update', 'xXGsvO26ntTHTESTKEYSOICKu8nOvMzKKiwg');
    $domain = json_decode($resault);

Lets try to change admin email and nameservers. For that reason we must send following model of request.

{
  "name": "string",
  "contacts": {
    "admin": {
      "name": "string",
      "surname": "string",
      "organisation": "string (Optional)",
      "email": "string",
      "phone": "string (/^\+?[^a-zA-Z]{5,}$/)",
      "mobile_phone": "string (/^\+?[^a-zA-Z]{5,}$/) (Optional)",
      "fax": "string  (Optional)",
      "country": "string (Country code or Name)",
      "city": "string",
      "state": "string",
      "address": "string",
      "address2": "string  (Optional)",
      "zip": "number",
    }
  }"ns":
  [
    {
      "name": "string",
      "ip": "string (Optional)",

    },
    {
      "name": "string",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",
    }
  ],
  "_am-private":"boolean(optional, only for am)",
}

Lets implement this in PHP

<?php
    $contact = array(
        'name' => "Jhone",
        'surname' => "Smith",
        'email' => "new-email@gmail.com",
        'phone' => "+37455555555",
        'country' => "US",
         'city' => "New York",
        'address' => "Example Street",
        'zip' => "001110"
    );
    $domainModel = [
        'name' => 'test-for-globalr.am',
        'contacts' => [
            'admin' => $contact,
        ],
        'ns' => [
            ['name'=>'ns3.globalr.com'],
            ['name'=>'ns4.globalr.com'],
        ],
        "_am-private"=>1
    ];
    $resault = sendToGlobalR($domainModel, 'PUT', '/domain', 'xXGsvO26ntTHTESTKEYSOICKu8nOvMzKKiwg');
    $domain = json_decode($resault);

Response codes are the same which are in domain registration process.

NameServer bulk update

{
  "names":{
      "name": "string",
      "name": "string",
      "name": "string",
      "name": "string",
      "name": "string",
      },
   "ns":  [
    {
      "name": "string",
      "ip": "string (Optional)",

    },
    {
      "name": "string",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",
    }
  ],
}

Lets implement this in PHP

<?php
     $domainModel = [
        'names' => [
            'name'=>'test-for-globalr.am',
            'name'=>'test1-for-globalr.am',
            'name'=>'test2-for-globalr.am',
            'name'=>'test3-for-globalr.am',
        ],
        'ns' => [
            ['name'=>'ns3.globalr.com'],
            ['name'=>'ns4.globalr.com'],
        ]
    ];
    $resault = sendToGlobalR($domainModel, 'PUT', '/domain/nameservers/bulkupdate', 'xXGsvO26ntTHTESTKEYSOICKu8nOvMzKKiwg');
    $domain = json_decode($resault);