Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/7c/dynadot
Dynadot javascript api wrapper
https://github.com/7c/dynadot
api-client domain dynadot registrar
Last synced: about 1 month ago
JSON representation
Dynadot javascript api wrapper
- Host: GitHub
- URL: https://github.com/7c/dynadot
- Owner: 7c
- Created: 2019-12-15T18:14:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-14T13:02:21.000Z (4 months ago)
- Last Synced: 2024-10-31T17:15:12.012Z (about 2 months ago)
- Topics: api-client, domain, dynadot, registrar
- Language: JavaScript
- Size: 44.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dynadot API
api version 3 wrapper which converts their XML response to JSON. Docs at https://www.dynadot.com/domain/api-commands# Install
```
npm install --save https://github.com/7c/dynadot
```# Embed
```
const Dynadot = require('dynadot')
const dynadot = new Dynadot('')
```# Methods
## listDomains()
retrieves all domains from Dynadot and returns them (if success) as an object with domain as key, this way you can lookup very fast. Dynadot returns all the information for all domains, all you need to do is to find the domain by its index as domainname.
```
var allDomains = await dynadot.listDomains()
```## setNameserver(domain,['ns1','ns2'...])
```
await dynadot.setNameserver('temp.com',['ns1.com','ns2.com'])
```## registerDomain(domainName,durationYears, currency='USD',allowPremium=false, coupon=false)
```
await dynadot.registerDomain('yourdomain.com',1)
// success
{"RegisterHeader":{"SuccessCode":"0","Status":"success"},"RegisterContent":{"Expiration":"1738627199000"}}
// errors
{"RegisterHeader":{"SuccessCode":"1","Status":"not_available"}}
{"RegisterHeader":{"SuccessCode":"-1","Status":"error","Error":"this domain is a premium domain, please use premium option"}}
{"RegisterHeader":{"SuccessCode":"5","Status":"system_busy"}}
```## tldPrices(currency='USD')
```
await dynadot.tldPrices()
```## deleteDomain(domainName)
important: only grace-period domains can be deleted at dynadot. other domains or transfered domains cannot be deleted with this method.(check dynadot statement)
```
await dynadot.deleteDomain('yourdomain.com')// success
{ DeleteHeader: { SuccessCode: '0', Status: 'success' } }
{"DeleteHeader":{"SuccessCode":"1","Status":"grace_expired"}}// errors
{"DeleteHeader":{"SuccessCode":"-1","Status":"error","Error":"could not find domain in your account"}}
{"DeleteHeader":{"SuccessCode":"-1","Status":"error","Error":"Please unlock your domain firstly."}}
{"DeleteHeader":{"SuccessCode":"-1","Status":"error","Error":"problem with connection to main server"}}
{"DeleteHeader":{"SuccessCode":"-1","Status":"error","Error":"connection to main server is busy"}}
{"DeleteHeader":{"SuccessCode":"-1","Status":"error","Error":"connection to main server is offline"}}```
## getTransferAuthCode(domainName,new_code=false,unlock_domain_for_transfer=true)
```
await dynadot.getTransferAuthCode('yourdomain.com')
// success
{"GetTransferAuthCodeResponse":{"GetTransferAuthCodeHeader":{"SuccessCode":"0","Status":"success","AuthCode":"e478582Zu663762"}}}
//errors
{"GetTransferAuthCodeResponse":{"GetTransferAuthCodeHeader":{"SuccessCode":"-1","Status":"error","Error":"need api skip lock agreement for using unlock_domain_for_transfer tag."}}}
```