Update DNS record via API...
Update DNS record via API
- 主页
- 后台控制中心
- Community Forum
- General Discussion
- Developer Discussion
- Update DNS record via API
- Community Forum
- Update DNS record via API
Topic: Update DNS record via API
Hi all,
I have a question about the use of the webservice...
I'm using the API documentation in order to generate the cURL command : https://www.dynu.com/Support/API#/
I try to get information and it works perfectly :
curl -X GET https://api.dynu.com/v2/dns/[DOMID]/record/[RECORD_ID] -H "accept: application/json" -H "API-Key: [API_KEY]"
{
"ipv4Address" : "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"content" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"statusCode" : 200,
"nodeName" : "xxxxxxxxxxxxxxxxxxxxxxx",
"state" : true,
"id" : [RECORD_ID],
"updatedOn" : "2019-07-22T09:25:12",
"hostname" : "xxxxxxxxxxxxxxxxxxxxxxxxx",
"location" : "xxxxxxxxxxxxxxxxxxxxxx",
"recordType" : "A",
"ttl" : 120,
"domainName" : "xxxxxxxxxxxxxxxx",
"domainId" : [DOMID]
}
But when I want to update a value, for example location, it fails :
curl -X POST https://api.dynu.com/v2/dns/[DOMID]/record/[RECORD_ID] -H "accept: application/json" -H "API-Key: [API_KEY]" -H "Content-Type: application/json" -d "{\"location\":\"NEW VAL\"}"
The error status which is not in the documentation is :
{
"message" : "Invalid.",
"statusCode" : 505,
"type" : "Validation Exception"
}
Regards
I have a question about the use of the webservice...
I'm using the API documentation in order to generate the cURL command : https://www.dynu.com/Support/API#/
I try to get information and it works perfectly :
curl -X GET https://api.dynu.com/v2/dns/[DOMID]/record/[RECORD_ID] -H "accept: application/json" -H "API-Key: [API_KEY]"
{
"ipv4Address" : "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"content" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"statusCode" : 200,
"nodeName" : "xxxxxxxxxxxxxxxxxxxxxxx",
"state" : true,
"id" : [RECORD_ID],
"updatedOn" : "2019-07-22T09:25:12",
"hostname" : "xxxxxxxxxxxxxxxxxxxxxxxxx",
"location" : "xxxxxxxxxxxxxxxxxxxxxx",
"recordType" : "A",
"ttl" : 120,
"domainName" : "xxxxxxxxxxxxxxxx",
"domainId" : [DOMID]
}
But when I want to update a value, for example location, it fails :
curl -X POST https://api.dynu.com/v2/dns/[DOMID]/record/[RECORD_ID] -H "accept: application/json" -H "API-Key: [API_KEY]" -H "Content-Type: application/json" -d "{\"location\":\"NEW VAL\"}"
The error status which is not in the documentation is :
{
"message" : "Invalid.",
"statusCode" : 505,
"type" : "Validation Exception"
}
Regards
Reply with quote |Report
I found the problem...
When you want to POST new values, you have to send the JSON of all the data !!
When you want to POST new values, you have to send the JSON of all the data !!
Reply with quote |Report
alienkidmj12 wrote:can someone post an example of command using curl to update domain ip ?
Reply with quote |Report
| Author | Topic: Update DNS record via API |
|---|---|
|
infotp Joined: 2019/7/5 |
2019年7月23日星期二 上午2:26
Hi all,
I have a question about the use of the webservice... I'm using the API documentation in order to generate the cURL command : https://www.dynu.com/Support/API#/ I try to get information and it works perfectly : curl -X GET https://api.dynu.com/v2/dns/[DOMID]/record/[RECORD_ID] -H "accept: application/json" -H "API-Key: [API_KEY]" { "ipv4Address" : "xxxxxxxxxxxxxxxxxxxxxxxxxxx", "content" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "statusCode" : 200, "nodeName" : "xxxxxxxxxxxxxxxxxxxxxxx", "state" : true, "id" : [RECORD_ID], "updatedOn" : "2019-07-22T09:25:12", "hostname" : "xxxxxxxxxxxxxxxxxxxxxxxxx", "location" : "xxxxxxxxxxxxxxxxxxxxxx", "recordType" : "A", "ttl" : 120, "domainName" : "xxxxxxxxxxxxxxxx", "domainId" : [DOMID] } But when I want to update a value, for example location, it fails : curl -X POST https://api.dynu.com/v2/dns/[DOMID]/record/[RECORD_ID] -H "accept: application/json" -H "API-Key: [API_KEY]" -H "Content-Type: application/json" -d "{\"location\":\"NEW VAL\"}" The error status which is not in the documentation is : { "message" : "Invalid.", "statusCode" : 505, "type" : "Validation Exception" } Regards |
|
infotp Joined: 2019/7/5 |
2019年7月23日星期二 上午5:27
I found the problem...
When you want to POST new values, you have to send the JSON of all the data !! |
|
mitechy Joined: 2020/10/22 |
2021年8月5日星期四 上午9:38
Really helpfull, thanks!!
|
|
alienkidmj12 Joined: 2017/4/19 |
2023年5月13日星期六 上午4:09
can someone post an example of command using curl to update domain ip ?
|
|
xiaoye Joined: 2015/3/27 |
2023年5月17日星期三 上午10:05
|
2026年6月13日星期六 上午4:54
