Closed depombo closed 3 years ago
Nvm it turns out the DNS record already existed, but the error message misled me to think that I was providing the wrong data. More descriptive error messages would be nice.
I'm glad you got it working!
More descriptive error messages would be nice.
😞 Indeed. We'll try to get this improved.
This bit me as well today. The error code should have been 1046
according to the docs here. Instead my request was returned as
{
"host": "api.cloudflare.com",
"hostname": "api.cloudflare.com",
"message": "Response code 400 (Bad Request)",
"method": "POST",
"path": "/client/v4/zones/<omitted>/dns_records",
"statusCode": 400,
"statusMessage": "Bad Request"
},
I ran the same request with curl and got the output
{"result":null,"success":false,"errors":[{"code":81057,"message":"Record already exists."}],"messages":[]}
Node v10.21.0 node-cloudfare v2.7.0
I can browse zones and dns records just fine, but the moment I try to add a dns record I get an unhelpful error message:
This is my code, what is supposed to be the schema for the object in this method?