CINXE.COM
API V2 Documentation
<!DOCTYPE html> <html class="no-js" lang="en"> <head> <meta charset="utf-8"> <title>API V2 Documentation</title> <meta name="description" content=""> <meta name="author" content="ticlekiwi"> <meta http-equiv="cleartype" content="on"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/hightlightjs-dark.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/highlight.min.js"></script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;1,300&family=Source+Code+Pro:wght@300&display=swap" rel="stylesheet"> <link rel="stylesheet" href="css/style.css" media="all"> <script>hljs.initHighlightingOnLoad();</script> </head> <body> <div class="left-menu"> <div class="content-logo"> <div class="logo"> <img alt="platform by Emily van den Heever from the Noun Project" title="platform by Emily van den Heever from the Noun Project" src="images/logo.png" height="32" /> <span>API V2 Documentation</span> </div> <button class="burger-menu-icon" id="button-menu-mobile"> <svg width="34" height="34" viewBox="0 0 100 100"> <path class="line line1" d="M 20,29.000046 H 80.000231 C 80.000231,29.000046 94.498839,28.817352 94.532987,66.711331 94.543142,77.980673 90.966081,81.670246 85.259173,81.668997 79.552261,81.667751 75.000211,74.999942 75.000211,74.999942 L 25.000021,25.000058"> </path> <path class="line line2" d="M 20,50 H 80"></path> <path class="line line3" d="M 20,70.999954 H 80.000231 C 80.000231,70.999954 94.498839,71.182648 94.532987,33.288669 94.543142,22.019327 90.966081,18.329754 85.259173,18.331003 79.552261,18.332249 75.000211,25.000058 75.000211,25.000058 L 25.000021,74.999942"> </path> </svg> </button> </div> <div class="mobile-menu-closer"></div> <div class="content-menu"> <div class="content-infos"> <div class="info"><b>Version:</b> 2.0.0</div> <div class="info"><b>Last Updated:</b> 11th DEC, 2021</div> </div> <ul> <li class="scroll-to-link active" data-target="content-get-started"> <a>GET STARTED</a> </li> <li class="scroll-to-link" data-target="content-get-characters"> <a>Response Formatting</a> </li> <li class="scroll-to-link" data-target="content-errors"> <a>Error Handling</a> </li> <li class="scroll-to-link active" data-target="content-auth"> <a>Authentication</a> </li> <li class="scroll-to-link" data-target="content-get-checkdomain"> <a>Check Domain Availability</a> </li> <li class="scroll-to-link" data-target="content-whois"> <a>Domain Whois Lookup</a> </li> <li class="scroll-to-link" data-target="content-reg-domain"> <a>Register Domain </a> </li> <li class="scroll-to-link" data-target="content-modify-domain"> <a>Modify Domain </a> </li> <li class="scroll-to-link" data-target="content-renew"> <a>Renew Domain </a> </li> <li class="scroll-to-link" data-target="content-domain-transfer"> <a>Request Domain Transfer </a> </li> <li class="scroll-to-link" data-target="content-domain-transfer-confirm"> <a>Confirm Domain Transfer </a> </li> <li class="scroll-to-link" data-target="content-domain-lock"> <a>Domain Lock </a> </li> <li class="scroll-to-link" data-target="content-domain-unlock"> <a>Domain Unlock </a> </li> <li class="scroll-to-link" data-target="content-domain-block"> <a>Register Domain Block </a> </li> <li class="scroll-to-link" data-target="content-list-domain-block"> <a>List Domain Blocks </a> </li> <li class="scroll-to-link" data-target="content-remove-domain-block"> <a>Remove Domain Block </a> </li> </ul> </div> </div> <div class="content-page"> <div class="content-code"></div> <div class="content"> <div class="overflow-hidden content-section" id="content-get-started"> <h1>Get started</h1> <pre> API Endpoint Endpoint: https://new.registry.co.ug/api/v2 </pre> <p> This is an application that enable registrars who are accredited with UG cc-TLD registrars manage .ug domain names. Designed by Infinity Computers and Communications Company(http://www.i3c.co.ug/) on behalf of Uganda Online. </p> <p> To use this API, you need an <strong>API key</strong>. Please login in into your registry account <a href="https://new.registry.co.ug/auth/sign_in">and navigate to API Keys</a> to generate your own API key. </p> </div> <div class="overflow-hidden content-section" id="content-get-characters"> <h2>Response Formatting</h2> <pre><code class="bash"> </code></pre> <p> The Client API is designed as an HTTP-REST interface. Responses follow the JSend style. <code class="higlighted break-word">(https://github.com/omniti-labs/jsend)</code> </p> <br> <pre><code class="json"> Result example : { query:{ offset: 0, limit: 50, house: [ "Stark", "Bolton" ], } result: [ { id: 1, first_name: "Jon", last_name: "Snow", alive: true, house: "Stark", gender: "m", age: 14, location: "Winterfell" }, { id: 2, first_name: "Eddard", last_name: "Stark", alive: false, house: "Stark", gender: "m", age: 35, location: 'Winterfell' }, { id: 3, first_name: "Catelyn", last_name: "Stark", alive: false, house: "Stark", gender: "f", age: 33, location: "Winterfell" }, { id: 4, first_name: "Roose", last_name: "Bolton", alive: false, house: "Bolton", gender: "m", age: 40, location: "Dreadfort" }, { id: 5, first_name: "Ramsay", last_name: "Snow", alive: false, house: "Bolton", gender: "m", age: 15, location: "Dreadfort" }, ] } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>secret_key</td> <td>String</td> <td>Your API key.</td> </tr> <tr> <td>search</td> <td>String</td> <td>(optional) A search word to find character by name.</td> </tr> <tr> <td>house</td> <td>String</td> <td> (optional) a string array of houses: </td> </tr> <tr> <td>alive</td> <td>Boolean</td> <td> (optional) a boolean to filter alived characters </td> </tr> <tr> <td>gender</td> <td>String</td> <td> (optional) a string to filter character by gender:<br> m: male<br> f: female </td> </tr> <tr> <td>offset</td> <td>Integer</td> <td>(optional - default: 0) A cursor for use in pagination. Pagination starts offset the specified offset.</td> </tr> <tr> <td>limit</td> <td>Integer</td> <td>(optional - default: 10) A limit on the number of objects to be returned, between 1 and 100.</td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-errors"> <h2>Error Handling</h2> <p> Registry API uses HTTP status codes to indicate success or failure of a request. Below is a summary of the HTTP status codes you should expect to handle. </p> <table> <thead> <tr> <th>Error Code</th> <th>Meaning</th> </tr> </thead> <tbody> <tr> <td>2XXX</td> <td> Codes in the 2XX range mean that the request was processed successfully. </td> </tr> <tr> <td>4XX</td> <td> Codes in the 4XX range mean that something was wrong with the data that you sent. For example, you might have missed some required parameters, or you might be using an expired token for authentication. <!-- Unknown or unvalid <code class="higlighted">secret_key</code>. This error appears if you use an unknow API key or if your API key expired.----> </td> </tr> <tr> <td>5XX</td> <td> Codes in the 5XX range mean that there is a glitch in our servers. </td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-auth"> <h2>Authentication</h2> <p> API authenticates clients with a HTTP Bearer token-based authentication scheme. The bearer token is passed in the Authorization header of the API request. To create your API key, simply login to your registry account and navigate to the API keys (V2) section. For security reasons, your API key bearer token will only be displayed once after creation and cannot be recovered in-case its lost. <br><br> Simply delete a lost or compromised API key and create a new one. It's good security practice to periodically change your API keys. A 401 (Unauthorized) HTTP response is returned when an API client request fails to authenticate. </p> <pre><code class="json"> Curl example : curl "http://../api/v2/path-to-resource" \ -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 5c8e4327fd8b2bf3118f82b13890d89d" \ </code></pre> <p>Replace "5c8e4327fd8b2bf3118f82b13890d89d" with your actual token</p> </div> <div class="overflow-hidden content-section" id="content-get-checkdomain"> <h2>Check Domain Availability</h2> <pre><code class="bash"> </code></pre> <p> Http Method: <br> Path: /domains/check-availability <br> GET <br> Authentication Required: No </p> <br> <pre><code class="json"> REQUEST { "domains": [ {"name": "mtn.co.ug"}, {"name": "registry.co.ug"} ] } <strong>RESPONSE</strong> <br> { "status": "success", "data": [ { "domain": "mtn.co.ug", "available": 0 }, { "domain": "registry.co.ug", "available": 0 } ] } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Domains</td> <td>Array</td> <td>List of domains to check for availability.</td> <td>Yes</td> </tr> </tbody> </table> <p>Response <br> <strong>Parameter</strong> <br> Description <br> <strong> <b>Domain </b></strong> <br> Name of domain <br> <strong> <b>Availability</strong> </b> <br> Availability status. 1 indicates domain is available. 0 Indicates domain is not available. </p> </div> <div class="overflow-hidden content-section" id="content-whois"> <h2> Domain Whois Lookup </h2> <pre><code class="bash"> REQUEST { "domain_name": "registry.co.ug" } </code></pre> <p> Http Method: <br> Path: /domains/whois <br> GET <br> Authentication Required: No </p> <br> <pre><code class="json"> <strong>RESPONSE ON SUCCESS </strong> <br> { "status": "success", "data": { "domain": { "name": "registry.co.ug", "status": "ACTIVE", "registration_date": "2000-12-01", "expiry_date": "2100-02-22", "contacts": { "registrant": { "firstname": "UNKNOWN", "email": "registrar@i3c.co.ug", "organization": "Infinity Computers and Communications Company LTD", "country": "Uganda", "city": "Kampala", "street_address": "Plot 6B Windsor Loop", "phone": "UNKNOWN", "postal_code": "P.O. Box 12510", "fax": "" }, "admin": { "firstname": "Charles", "lastname": "Musisi", "email": "cmusisi@cfi.co.ug", "organization": "UNKNOWN", "country": "Uganda", "city": "Kampala", "street_address": "Computer Frontiers InternationalPlot 6B Windsor LoopP.O. Box 12510 - Kampala", "phone": "+256 31 230 1800", "postal_code": "UNKNOWN", "fax": "" }, "billing": { "firstname": "Charles", "lastname": "Musisi", "email": "cmusisi@cfi.co.ug", "organization": "UNKNOWN", "country": "Uganda", "city": "Kampala", "street_address": "Computer Frontiers InternationalPlot 6B Windsor LoopP.O. Box 12510 - Kampala", "phone": "+256 31 230 1800", "postal_code": "UNKNOWN", "fax": "+256 41 434 0456" }, "tech": { "firstname": "Charles", "lastname": "Musisi", "email": "cmusisi@cfi.co.ug", "organization": "UNKNOWN", "country": "Uganda", "city": "Kampala", "street_address": "Computer Frontiers InternationalPlot 6B Windsor LoopP.O. Box 12510 - Kampala", "phone": "+256 31 230 1800", "postal_code": "UNKNOWN", "fax": "+256 41 434 0456" }, "nameservers": { "ns1": "ns1.cfi.co.ug", "ns2": "ns2.cfi.co.ug", "ns3": "ns3.cfi.co.ug", "ns4": "ns4.cfi.co.ug" } } } } } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Domains</td> <td>String</td> <td>Domain name.</td> <td>Yes</td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-reg-domain"> <h2> Domain Register </h2> <pre><code class="bash"> REQUEST <BR> { "domain_name": "testdomain.co.ug", "period": 1 } </code></pre> <p> Http Method:POST <br> Path:/domains/register <br> <br> Authentication Required: Yes </p> <br> <pre><code class="json"> <strong>RESPONSE ON SUCCESS </strong> <br> { "status": "success", "data": { "domain": { "name": "testdomain.co.ug", "status": "ACTIVE", "expiry_date": "2022-08-31" } } } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Domain_name</td> <td>String</td> <td>Domain name to register.</td> <td>Yes</td> </tr> <tr> <td>Period</td> <td>String</td> <td>Domain registration period.</td> <td>Yes</td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-modify-domain"> <h2> Modify Domain </h2> <pre><code class="bash"> REQUEST <BR> { "domain_name": "testemail.co.ug", "contacts": { "registrant": { "firstname": "John Doe", "email": "test@vitalhash.com", "organization": "Test", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" }, "admin": { "firstname": "Derrick", "lastname": "Mugerwa", "email": "richard@vitalhash.com", "organization": "Vitalhash LTD", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" }, "billing": { "firstname": "Derrick", "lastname": "Mugerwa", "email": "richard@vitalhash.com", "organization": "Vitalhash LTD", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" }, "tech": { "firstname": "Derrick", "lastname": "Mugerwa", "email": "richard@vitalhash.com", "organization": "Vitalhash LTD", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" } }, "nameservers": { "ns1": { "name": "ns1.i3c.co.ug", "ip": "50.22.208.130" }, "ns2": { "name": "ns2.i3c.co.ug", "ip": "174.36.245.66" }, "ns3": { "name": "ns3.i3c.co.ug", "ip": "174.36.245.67" }, "ns4": { "name": "ns4.i3c.co.ug", "ip": "212.88.97.141" } } } </code></pre> <p> Http Method:POST <br> Path:/domains/modify <br> <br> Authentication Required: Yes </p> <br> <pre><code class="json"> <strong>RESPONSE ON SUCCESS </strong> <br> { "status": "success", "data": { "domain": { "name": "vitalhash.co.ug", "status": "ACTIVE", "registration_date": "2021-08-31", "expiry_date": "2022-08-31", "contacts": { "registrant": { "firstname": "Mark P", "email": "richard@vitalhash.com", "organization": "Vitalhash LTD", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" }, "admin": { "firstname": "Derrick", "lastname": "Mugerwa", "email": "richard@vitalhash.com", "organization": "Vitalhash LTD", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" }, "billing": { "firstname": "Derrick", "lastname": "Mugerwa", "email": "richard@vitalhash.com", "organization": "Vitalhash LTD", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" }, "tech": { "firstname": "Derrick", "lastname": "Mugerwa", "email": "richard@vitalhash.com", "organization": "Vitalhash LTD", "country": "UG", "city": "Kampala", "street_address": "Buziga", "phone": "0773454899", "postal_code": "256", "fax": "" }, "nameservers": { "ns1": "ns1.i3c.co.ug", "ns2": "ns2.i3c.co.ug", "ns3": "ns3.i3c.co.ug", "ns4": "ns4.i3c.co.ug" } } } } } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Domain_name</td> <td> String</td> <td>Domain name to modify.</td> <td>Yes</td> </tr> <tr> <td>Contacts</td> <td>JSON Object</td> <td>Contact Info</td> <td>Yes</td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-renew"> <h2> Renew Domain </h2> <pre><code class="bash"> REQUEST <BR> { "domain_name": "testdomain.ug", "period": 1 } </code></pre> <p> Http Method:POST <br> Path:/domains/renew <br> <br> Authentication Required: Yes </p> <br> <pre><code class="json"> <strong>RESPONSE ON SUCCESS </strong> <br> { "status": "success", "message": "Domain successfully renewed.", "data": { "domain": { "name": "testdomain.ug", "status": "ACTIVE", "expiry_date": "2023-03-05" } } } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Domain_name</td> <td> String</td> <td>Domain name to renew.</td> <td>Yes</td> </tr> <tr> <td>Period</td> <td>JSON Object</td> <td>Domain renew period</td> <td>Yes</td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-domain-transfer"> <h2> Request Domain Transfer </h2> <pre><code class="bash"> REQUEST <BR> { "domain_name": "testdomain.ug" } </code></pre> <p> Http Method:POST <br> Path:/domains/request-transfer <br> <br> Authentication Required: Yes </p> <br> <pre><code class="json"> <strong> RESPONSE ON SUCCESS </strong> <br> { "status": "success", "message": "Request domain transfer successfully initiated." } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Domain_name</td> <td> String</td> <td>Domain name to transfer</td> <td>Yes</td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-domain-transfer-confirm"> <h2> Confirm Domain Transfer </h2> <pre><code class="bash"> REQUEST <BR> { "domain_name": "testdomain.ug", "transfer_id": 234 } </code></pre> <p> Http Method:POST <br> Path:/domains/confirm-transfer <br> <br> Authentication Required: Yes </p> <br> <pre><code class="json"> <strong> RESPONSE ON SUCCESS </strong> <br> { "status": "success", "message": "Successfully transfered domain testdomain.ug" } </code></pre> <h4>QUERY PARAMETERS</h4> <table class="central-overflow-x"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Domain_name</td> <td> String</td> <td>Domain name to confirm domain transfer.</td> <td>Yes</td> </tr> <tr> <td>Transfer_id </td> <td>Integer</td> <td>Transfer request ID.</td> <td>Yes</td> </tr> </tbody> </table> </div> <div class="overflow-hidden content-section" id="content-domain-lock"> <h2> Lock Domain </h2> <pre><code class="bash"> REQUEST <BR> { "domain_name": "testdomain.ug" } </code></pre> <p> Path:/domains/lock <br> <br> </p> <br> <pre><code class="json"> </code></pre> </div> <div class="overflow-hidden content-section" id="content-domain-unlock"> <h2> UnLock Domain </h2> <pre><code class="bash"> REQUEST <BR> { "domain_name": "testdomain.ug" } </code></pre> <p> Path: /domains/unlock <br> <br> </p> <br> <pre><code class="json"> </code></pre> </div> </div> <div class="content-code"></div> </div> <a href="https://new.registry.co.ug/" class="github-corner" aria-label="View source on Github" title="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="z-index:99999; fill:#70B7FD; color:#fff; position: fixed; top: 0; border: 0; right: 0;" aria-hidden="true"> <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path> <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path> <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path> </svg></a> <style> .github-corner:hover .octo-arm { animation: octocat-wave 560ms ease-in-out } @keyframes octocat-wave { 0%, 100% { transform: rotate(0) } 20%, 60% { transform: rotate(-25deg) } 40%, 80% { transform: rotate(10deg) } } @media (max-width:500px) { .github-corner:hover .octo-arm { animation: none } .github-corner .octo-arm { animation: octocat-wave 560ms ease-in-out } } @media only screen and (max-width:680px) { .github-corner>svg { right: auto !important; left: 0 !important; transform: rotate(270deg) !important; } } </style> <script src="js/script.js"></script> </body> </html>