API v2: Introducing New Endpoints for Transfer API
Over the last few weeks, the DNSimple team has been working on a new feature to improve our Transfer API.
Previously, the only operation in our API for domain transfer was Transfer Domain
. This prevented customers from fully integrating a complete domain transfer process in their applications using only the API.
We like to make things as streamlined as possible, so we added the ability to retrieve a domain transfer and cancel a domain transfer.
Why is this important?
With these two new endpoints, you'll have a complete flow for transferring a domain and monitoring it in your application.
Now you can:
- Use Transfer Domain to start the transfer process, get the ID from the response, and store it locally.
- Use Get Domain Transfer to check the details of the domain transfer with the
status
attribute to monitor if the transfer is completed (statustransferred
). If the transfer is cancelled (statuscancelled
), you will receive the reason in thestatus_description
attribute. - Use the new Cancel Domain Transfer to block an incoming transfer.
What is an API endpoint?
An API endpoint is a URL with a pattern that is used to execute actions in the API's resource. For example, these two new endpoints perform actions in the Domain Transfer
resource.
How to use the new endpoints
Starting today, there will be two new endpoints to our API v2:
getDomainTransfer
cancelDomainTransfer
The first one tells you the details of an existing domain transfer.
Here it is in action:
$ curl -H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
https://api.dnsimple.com/v2/1010/registrar/domains/example.com/transfers/358
It returns the following payload with the domain transfer information:
{
"data": {
"id": 358,
"domain_id": 180716,
"registrant_id": 2459,
"state": "cancelled",
"auto_renew": false,
"whois_privacy": false,
"status_description": "Canceled by customer",
"created_at": "2020-05-18T16:54:15Z",
"updated_at": "2020-05-18T17:00:02Z"
}
}
The second endpoint is used to start a domain transfer cancellation process:
$ curl -H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
-X DELETE \
https://api.dnsimple.com/v2/1010/registrar/domains/example.com/transfers/358
The output format is identical between the two endpoints.
For a detailed technical explanation, please read our documentation for Retrieving a Domain Transfer & Cancelling a DomainTransfer.
Final notes
This new feature is already available in our official API clients for Ruby, Go, Node.js, Elixir, Java, and .NET. Visit our libraries page to read how to use it.
DNSimple also maintains a Developer Sandbox, so you can test your API calls and simulate responses before you go live. Whether you have one domain or hundreds, our API is a powerful tool for automating your domain management. For more on what you can do with the DNSimple API, take a look at this post.
Have more questions? Get in touch. We're happy to help.
Want to experience best-in-class domain management? Give us a try free for 30 days.
Carlos Ribeiro
Brazilian Software Developer driven by caffeine ☕. Aspiring photographer
We think domain management should be easy.
That's why we continue building DNSimple.
4.3 out of 5 stars.
Based on Trustpilot.com and G2.com reviews.