API Documents
Cancel
Contents
Add a Monitor
1. API Description
This API (Monitor.Create) is used to add a monitor.
Domain name for API request:https://api.dnspod.com/Monitor.Create
HTTP request method: POST
2. Request Parameters
The table below lists only the API request parameters. Common request parameters are required when the API is called. For more information, please see Common Request Parameters.
Parameter | Required | Description |
---|---|---|
domain_id | yes | The domain id. Mandatory parameter. |
record_id | yes | The record id. Mandatory parameter. |
port | yes | The port number to monitor like 80. Mandatory parameter. |
monitor_interval | yes | Monitoring spacing.Ranged {60 |
host | yes | The host from the http header like “www.dnspod.com”. Mandatory parameter. |
monitor_type {http | https} | yes |
points | yes | The points to use.Split by ”,”.You can choose it from the list of your own grade. Mandatory parameter. |
bak_ip | yes | Backup IP address. |
keep_ttl | yes | “me” for the owner,and “share” for the shared users.Split by ”,” if there are more than one like “me,share”. Mandatory parameter. |
email_notice | yes | Same as the sms_notice. |
less_notice {yes | no} | yes |
callback_url | yes | The callback URL.All the data will be sent to this URL when the IP is down.For more details,please see the directions.Optional parameter. |
callback_key | yes | TThe callback key.If “callback_url” is set up,you should set this up too for security. |
bak_ip Backup IP address.Choose one kind from the list blow:
pass Just monitoring,no switching.
pause The old type of pause.
pause2 The intelligent pause who pause the record immediately when the IP is down.
auto Switch intelligent.
IP addresses split by ”,”.
3. Response Codes
Only the response codes related to this API are listed below. For other response codes, please see Common Return Codes.
Response Code | Description |
---|---|
6 | Invalid domain id. |
7 | Invalid record id. |
8 | Invalid host. |
9 | Invalid monitor port number that range from 1 to 65535. |
10 | Invalid monitor type. |
11 | Invalid monitor path. |
12 | Invalid monitor interval. |
13 | Invalid monitor points. |
14 | Too many points. |
15 | Invalid backup IP. |
16 | Invalid backup url. |
17 | Invalid backup IP. |
18 | Invalid sms notice. |
19 | Invalid email notice. |
20 | There is already been one monitor on this record. |
21 | The number of you monitors is up to limit. |
22 | Invalid callback URL. |
4. Sample
curl -X POST https://api.dnspod.com/Monitor.Create -d 'user_token=730060,e1a8a$f14dc5dcbafd83680b3d2a553c4d553d&format=json&domain_id=2317346&record_id=16909160&port=80&monitor_type=http&monitor_path=/&monitor_interval=360&points=ctc,cuc,cmc&bak_ip=pass&host=testapi.com'
The following is a sample response:
- JSON:
{
"status": {
"code": "1",
"message": "Action completed successful",
"created_at": "2012-11-24 21:25:30"
},
"monitor": {
"monitor_id": "6aac176e-363a-11e2-bab7-0819a6248970",
"record_id": 16909160
}
}
Last updated on 2020-12-23 09:04
Is the above content helpful to you?
Helpful
Unhelpful
Select an issue type
- Can't find what I need
- Update is not timely
- Difficult to understand
- Typo/invalid link
- Steps are incomplete
- Missing images/sample codes
View on Mobile Phone
Click to copy the link