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 the 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. For gTLD domains, a transfer is only possible once the domain has been registered for at least 60 days and has not been transferred between registrars in the last 60 days. ccTLDs follow their own registry rules, which may differ.
To transfer a domain out of Openprovider, submit a transfer request with the 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, at least 60 days have passed since the domain was registered;
- for gTLD domains, at least 60 days have passed since the last transfer between registrars;
- the domain is "Unlocked" for transfer.
You can disable the Transfer Lock by utilizing modifyDomainRequest method. In this article, however, we focus on how to request or reset an Auth code for a domain.
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 the domain owner (for example, for .be and .eu).
GET{base_url}/domains/{id}/authcode
REQUEST VALUES
| Name | Type | Description |
| id | string | Required. Openprovider domain ID. |
| 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/v1/domains/123456/authcode' \
-H 'Authorization: Bearer <your_token>'
RESPONSE EXAMPLE
{
"code": 0,
"desc": "",
"data": {
"auth_code": "12345678",
"type": "external"
}
}
Sometimes a domain might not have an Auth code assigned to it. In such a case, you may need to reset it. If so, use resetAuthCodeDomainRequest, which generates a new authorization code where the registry allows it.
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. Openprovider domain ID. |
| auth_code_type | string | Optional. Type of transfer authorization code. Values: external (default) or internal (for internal transfers between reseller accounts in Openprovider only). |
This example requests an internal code for a transfer between Openprovider reseller accounts.
REQUEST EXAMPLE
curl -X POST \
'https://api.openprovider.eu/v1/domains/123456/authcode/reset' \
-H 'Authorization: Bearer <your_token>' \
-H 'Content-Type: application/json' \
-d '{"auth_code_type": "internal"}'
RESPONSE EXAMPLE
{
"code": 0,
"desc": "",
"data": {
"auth_code": "12345678",
"domain_roid": "",
"epp_statuses": [""],
"type": "internal"
}
}
For gTLD domains, a transfer can take up to five days, but once it is pending, you can speed it up by approving it manually.