Giter Site home page Giter Site logo

dynadot's Introduction

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('<APIKEY>')

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."}}}

dynadot's People

Contributors

7c avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.