Skip to content

Commit

Permalink
Document Domain Restore with examples (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
OleMchls authored Feb 19, 2024
1 parent e3a8fc3 commit b2ac17a
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 0 deletions.
96 changes: 96 additions & 0 deletions content/v2/registrar.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,102 @@ Responds with HTTP 200 on success.

Responds with [HTTP 401](/v2#unauthorized) in case of authentication issues.

## Restore a domain {#restoreDomain}

POST /:account/registrar/domains/:domain/restores

Restore a eligable expired domain name where your registration with DNSimple lapsed.

Your account must be active for this command to complete successfully.
You will be automatically charged the restore fee upon successful restore, so please be careful with this command.

### Parameters

Name | Type | Description
-----|------|------------
`:account` | `integer` | The account id
`:domain` | `string` | The domain name

### Example

Restore the domain `example.com` in the account `1010`:

curl -H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST \
https://api.dnsimple.com/v2/1010/registrar/domains/example.com/restores

### Input

Name | Type | Description
-----|------|------------
`premium_price` | `string` | **Required** as confirmation of the price, only if the domain is premium.

##### Example with optional premium_price

~~~json
{
"premium_price": '109.00'
}
~~~

### Response

Responds with HTTP 201 when restore was processed and completed.

Responds with HTTP 202 when restore was processed but is pending completion.

~~~json
<%= pretty_print_fixture("/api/restoreDomain/success.http") %>
~~~

### Errors

Responds with [HTTP 400](/v2#bad-request) if the domain cannot be restored.

Responds with [HTTP 401](/v2#unauthorized) in case of authentication issues.

Responds with [HTTP 402](/v2#payment-required) if the account has outstanding payments.

## Retrieve a Domain Restore {#getDomainRestore}

Retrieves the details of an existing domain restore.

~~~
GET /:account/registrar/domains/:domain/restores/:domain_restore
~~~

### Parameters

Name | Type | Description
-----|------|------------
`:account` | `integer` | The account id
`:domain` | `string` | The domain name
`:domain_restore` | `integer` | The domain restore id

### Example

Get the domain restore with ID `1` in the account `1010` for the domain `example.com`:

~~~
curl -H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
https://api.dnsimple.com/v2/1010/registrar/domains/example.com/restores/1
~~~

### Response

Responds with HTTP 200 on success.

~~~json
<%= pretty_print_fixture("/api/getDomainRestore/success.http") %>
~~~

### Errors

Responds with [HTTP 401](/v2#unauthorized) in case of authentication issues.

## Authorize a domain transfer out {#authorizeDomainTransferOut}

POST /:account/registrar/domains/:domain/authorize_transfer_out
Expand Down
19 changes: 19 additions & 0 deletions fixtures/v2/api/getDomainRestore/success.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 18 Feb 2024 10:48:05 GMT
Content-Type: application/json
Content-Length: 120
Connection: keep-alive
X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs
Cache-Control: no-cache
X-Request-Id: 2a8d691f-f47e-4d41-9916-eba67e683914
X-Runtime: 0.004845
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Content-Security-Policy: frame-ancestors 'none'
Strict-Transport-Security: max-age=63072000

{"data":{"id":43,"domain_id":214,"state":"new","created_at":"2024-02-14T14:40:42Z","updated_at":"2024-02-14T14:40:42Z"}}
19 changes: 19 additions & 0 deletions fixtures/v2/api/restoreDomain/success.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
HTTP/1.1 201 Created
Server: nginx
Date: Sun, 18 Feb 2024 10:46:17 GMT
Content-Type: application/json
Content-Length: 120
Connection: keep-alive
X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs
Cache-Control: no-cache
X-Request-Id: 3bf33ae7-22f2-473c-8e39-8738d2bcce89
X-Runtime: 0.006332
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Content-Security-Policy: frame-ancestors 'none'
Strict-Transport-Security: max-age=63072000

{"data":{"id":43,"domain_id":214,"state":"new","created_at":"2024-02-14T14:40:42Z","updated_at":"2024-02-14T14:40:42Z"}}

0 comments on commit b2ac17a

Please sign in to comment.