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. DomainFor namesgTLD maydomains, bea transferredtransfer is only ifpossible theyonce havethe domain has been registered withfor theat previous registrar forleast 60 days orand more.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 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,
theatdomain is more thanleast 60 daysold;have passed since the domain was registered; - for gTLD domains,
theatdomainleastwas60notdaystransferredhavebetweenpassedregistrars withinsince the last60transferdays;between registrars; - the domain is "Unlocked" for transfer.
You can disable the Transfer 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 registryregistry, or triggers the registry to send the code to athe domain owner (infor caseexample, offor .be and .eu, for instance.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/v1beta/domains/123456/authcode' \
-H 'Authorization: ,Bearer 2831a37fb8*******90b5aac822'<your_token>' \
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. inIn such a case, ityou may be necessary to reset. The procedure is barely any different from requesting an already existing one. If the situation requires youneed to reset anit. AuthIf code, you canso, use resetAuthCodeDomainRequestresetAuthCodeDomainRequest, which will generategenerates a new authorisationauthorization code ifwhere a certainthe 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). |
REQUEST EXAMPLE
curl -X POST \
'https://api.openprovider.eu/v1beta/domains/123456/authcode/reset' \
-H 'Authorization: ,Bearer 2831a37fb8*******90b5aac822'<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": [
""
],
"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.