=================== Register Domain =================== To register domain you must send ``POST`` Request to https://globalr.com/api/domain For domain registration you must send 3 type contacts, minimum 2 unique valid name server, domain name, and optional registration period in year (by default year is equiwalent to 1); Contact model -------------------------------------- .. code-block:: json { "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 model ----------------------- .. code-block:: json { "name": "string", "ip": "string (Optional)" } Domain registration request model -------------------------------------------------------------------- .. code-block:: json { "name": "string", "period": "int (optional)", "contacts": { "owner": { "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", }, "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", }, "billing": { "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", }"technical": { "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": [ { "ns1name": "string", "ns1ip": "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)" } Test request in php for domain create ---------------------------------------------------------- .. code-block:: php "Jhone", 'surname' => "Smith", 'email' => "smith@gmail.com", 'phone' => "+37455555555", 'country' => "US", 'city' => "New York", 'address' => "Example Street", 'zip' => "001110" ); $domainModel = [ 'name' => 'test-for-globalr.am', 'period' => 2, 'contacts' => [ 'owner' => $contact, 'admin' => $contact, 'billing' => $contact, 'technical' => $contact, ], 'ns' => [ ['name'=>'ns1.globalr.com'], ['name'=>'ns2.globalr.com'], ], "_am-private"=>1 ]; $resault = sendToGlobalR($domainModel, 'POST', '/domain', 'xXGsvO26ntTHTESTKEYSOICKu8nOvMzKKiwg'); $domain = json_decode($resault); Example response .. code-block:: json { "status": 201, "textStatus": "completed", "message": "Domain\/s registered Successfully", "errors": [ ] } Available status codes + Status: 200 - success + Status: 201 - completed + Status: 402 - Payment Required + Status: 422 - invalid data (in this case field will be provided in errors array) + Status: 500 - Internal Error Example error response .. code-block:: json { "status": 422, "textStatus": "invalid data", "errors": { "contacts": { "owner": { "country": "country in owner contact was incorrect", "address": "address in owner contact was incorrect", "zip": "zip in owner contact was incorrect", "name": "name in owner contact was incorrect", "surname": "surname in owner contact was incorrect" }, "admin": { "country": "country in admin contact was incorrect", "address": "address in admin contact was incorrect", "zip": "zip in admin contact was incorrect", "name": "name in admin contact was incorrect", "surname": "surname in admin contact was incorrect", "email": "email in admin contact was incorrect", "phone": "phone in admin contact was incorrect" }, "billing": { "country": "country in billing contact was incorrect", "address": "address in billing contact was incorrect", "zip": "zip in billing contact was incorrect", "name": "name in billing contact was incorrect", "surname": "surname in billing contact was incorrect", "email": "email in billing contact was incorrect", "phone": "phone in billing contact was incorrect" }, "technical": { "country": "country in technical contact was incorrect", "address": "address in technical contact was incorrect", "zip": "zip in technical contact was incorrect", "name": "name in technical contact was incorrect", "surname": "surname in technical contact was incorrect", "email": "email in technical contact was incorrect", "phone": "phone in technical contact was incorrect" } }, "names": { "massage": "Please provide domain names to register", "status": 422 }, "ns": "Please provide ns for domain\/s" } }