API Explanation

1. DNSPod Users’ API,aim to help the users to manage their domains conveniently,are limited to personal users to use. 3. No third-party applications or users are allowed to use this API. If you have needs,please let us know: https://www.dnspod.com/About/Aboutus .

API Development Norm

  1. Misuse:
    This will be looked as API misuse. Including but not limit to:
    • Do a lot of inserts,deletes,updates or refreshes within a short time.
    • Request a lot without changing anything. What are you thinking!
    • Too many useless or repeated requests caused by wrong logic or endless loops.
    • Other requests that may give us a lot of pressure.

    In order to ensure you and other developers’ benefits,please use our APIs legitimately. DNSPod will punish the behaviors like API misuse by prohibit the accounts and reserve all the rights to arbitrate.`

  2. Login Disable:

    If there are more than 30 login failures within 5 minutes,the account will be disabled to login again for an hour. Please check the login status when you develop your own applications,and stop trying if fails.

  3. Prohibition:

    Even got prohibited,you can still use it on the official website. The prohibition will be relieved an hour later.Please be careful and never use it for large tests.

  4. Requests:
    • The request url starts with “https://dnsapi.cn/”,which based on SSL. You must use “https” instead of “http”.
    • POST method accepted only.
    • Please use UTF-8 encoding for data transfer. The responses are also UTF-8 encoded.
  5. UserAgent:
    • The UserAgent must be set. Prohibition may caused by wrong UserAgent or none.
    • UserAgent Format:Application Name/Version(email). For example:”MJJ DDNS Client/1.0.0 (shallwedance@dnspod.com)”.
  6. Security:

    Almost every step needs the email address and the password. So if you have to storage the user’s informations,please encrypt the password first. Never storage the password directly.

  7. Support:

Global Parameters

All the APIs need this parameters.
  • login_token API Token used for authentication
  • format {json,xml} The format of response.Default “xml”. “json” is highly recommended.Optional parameter.
  • error_on_empty {yes,no} Whether to response an error when there’s no results.
  • user_token (deprecated) The user token obtained with the Auth command.
Explanation:
  • For details on how to generate login_token, please refer to: https://support.dnspod.cn/Kb/showarticle/tsid/227/. The complete API Token is a combination of ID and Token, separated by English commas.
  • To ensure security, the old authentication method of "username + password" is no longer supported. Developers please use login_token to complete authentication
  • There can be only one user_token or login_token, and it is no longer supported to obtain any new user_token

Common Response Codes

Those responses codes could be in any API because they are the common responses.
  • -1 Login fails.
  • -2 API used too frequently.
  • -3 Invalid agent.(only works for agent users)
  • -4 Not in this agent.(only works for agent users)
  • -7 No permission to use this API.
  • -8 Account got prohibited.
  • 85 Account logged-on in another place and your request got rejected.
  • -99 This API is not ready to be used.No rush.
  • 1 Action completed successfully.
  • 2 POST method only.
  • 3 Unknown errors.
  • 6 Invalid user_id.(only works for agent users)
  • 7 User is not under this agent.(only works for agent users)

Get the Version of API

URL:
HTTP Request Type:
  • POST
Request Parameters:
  • Global Parameters
Response Code:
  • Common Response Codes

Example:

curl -X POST https://api.dnspod.com/Info.Version -d 'user_token=730060,e1a8a$f14dc5dcbafd83680b3d2a553c4d553d&format=json'

Response Example:

  • JSON:

    {
        "status": {
            "code": "1",
            "message": "4.6",
            "created_at": "2014-06-04 20:40:37"
        }
    }
    

Table Of Contents

Previous topic

DNSPod User API Document

Next topic

Accounts

This Page