15 Domains API: How to request or reset an authcode

This is a series of articles dedicated to demonstrating how to get acquainted with Openprovider Domains API methods.

This is a second article in a series in which we are going to cover outgoing domain transfer. To get more information about our API in general, please use our documentation portal as your reference.

Domain transfer is a procedure of changing the current registrar of a domain name. Domain names may be transferred only if they have been registered with the previous registrar for 60 days or more.

To transfer a domain out of Openprovider one should submit a transfer request with a new registrar. You should follow their instructions on the specifics of the process.

The following requirements should be met before initiating the transfer:

  • for gTLD domains, the domain is more than 30 days old;
  • for gTLD domains, the domain was not transferred between registrars within the last 60 days;
  • the domain is "Unlocked" for transfer.

You can disable Registrar Lock by utilizing modifyDomainRequest method. Yet in this article, we are going to focus on how to request or reset an Auth code for a domain.

In order to request an Auth code of a domain one should utilize the requestAuthCodeDomainRequest method. It reads the transfer authorization code (or EPP code) from the registry or triggers the registry to send the code to a domain owner (in case of .be and .eu, for instance.

Entering Geo Fence iconUse the endpoint path below. Base URL is determined by both the target environment and the API version.
GET {base_url}/domains/{id}/authcode

REQUEST VALUES

Name Type Description
id string Required.
auth_code_type string Optional. Type of transfer authorization code. Values: external (default) or internal (for internal transfers between reseller accounts in Openprovider only).

REQUEST EXAMPLE

curl -X GET \
'https://api.openprovider.eu/v1beta/domains/123456/authcode' \
-H 'Authorization: ,Bearer 2831a37fb8*******90b5aac822' \

RESPONSE EXAMPLE

{
"code": 0,
"desc": "",
"data": {
"auth_code": "12345678",
"success": true,
"type": "external"
}
}

Sometimes a domain might not have an Auth code assigned to it. in such a case, it may be necessary to reset. The procedure is barely any different from requesting an already existing one. If the situation requires you to reset an Auth code, you can use resetAuthCodeDomainRequest which will generate a new authorisation code if a certain registry allows it.

Entering Geo Fence iconUse the endpoint path below. Base URL is determined by both the target environment and the API version.
POST {base_url}/domains/{id}/authcode/reset

The method has almost identical input parameters as the previous one:

REQUEST VALUES

Name Type Description
id string Required.
auth_code_type string Optional.Type of transfer authorization code. Values: "external" (default) or "internal" (for internal transfers between reseller accounts in Openprovider only).

REQUEST EXAMPLE

curl -X POST \
'https://api.openprovider.eu/v1beta/domains/123456/authcode/reset' \
-H 'Authorization: ,Bearer 2831a37fb8*******90b5aac822' \
-H 'Content-Type: application/json' \
-d '{
{
"auth_code_type": "internal"
}

RESPONSE EXAMPLE

{
"code": 0,
"data": {
"auth_code": "12345678",
"domain_roid": "",
"epp_statuses": [
""
],
"success": true,
"type": "internal"
},
"desc": ""
}

Domain transfers can take up to five days to complete, but once the transfer is pending, you can expedite the process by approving it manually.

Was this article helpful?
Additional questions? Submit a request