<div dir="ltr">Dear Otto.<br><br>Thankyou for your help.<br>I really appreciate it.<br><br>It works.<br>But I have problem with some TXT records.<br>I do all this stuf with python. <br>There is a record that python dictionary format like this :<br><br>```<div>{'content': '"v=DKIM1; k=rsa; p=MIIBIjANBgDqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu4rkPBK0diLB2v0PKvxS5BcIk2eo6MX2V0stJBqxJPq3wvKzQA0SHxeH0CQpDcrA9GoRDWQhv/dAKhnAFZ6ZAtEEYmQLGokyr3bHVw2QIByyRCgyhbO9OdeVvuAgoA+gyVrdZv76iK8P/JVjtBTcqhpkI/MPnXSmVSy+IOhxatFt/Dk/JLx2hdC73BoRCAnqJ" "WiDZrgMLWE1LQi16TrOQYSWSkzbAMQW3ftnZPkLXcYIdT0haE5woU25r5D4tLLinJxe9ErZWDbOX1dzdNv+TK0HsNCO0ZT6mNa86yx/GLVmDq1V2b1azsDcQqpgCjUmrZ0fc2KiMbOEM8J5YqKVswIDAQAB;"', 'disabled': False}<br>```<br>when I test with python json.dumps, the result is:</div><div><br></div><div>```</div><div>{"content": "\\"v=DKIM1; k=rsa; p=MIIBIjANBgDqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu4rkPBK0diLB2v0PKvxS5BcIk2eo6MX2V0stJBqxJPq3wvKzQA0SHxeH0CQpDcrA9GoRDWQhv/dAKhnAFZ6ZAtEEYmQLGokyr3bHVw2QIByyRCgyhbO9OdeVvuAgoA+gyVrdZv76iK8P/JVjtBTcqhpkI/MPnXSmVSy+IOhxatFt/Dk/JLx2hdC73BoRCAnqJ\\" \\"WiDZrgMLWE1LQi16TrOQYSWSkzbAMQW3ftnZPkLXcYIdT0haE5woU25r5D4tLLinJxe9ErZWDbOX1dzdNv+TK0HsNCO0ZT6mNa86yx/GLVmDq1V2b1azsDcQqpgCjUmrZ0fc2KiMbOEM8J5YqKVswIDAQAB;\\"", "disabled": false}<br></div><div>```<br>It made the POST query fail. and also it failed when I test that json at <a href="https://jsonlint.com/">https://jsonlint.com/</a>.<br><br>Currently, my work arround is just ignore all TXT records, and inject it later using dnspython.<br><br>Sincerely<br>-bino-<br><br>when I do json.dumps and test resulted json in </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 2, 2024 at 1:01 AM Otto Moerbeek <<a href="mailto:otto@drijf.net">otto@drijf.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Apr 01, 2024 at 04:57:08PM +0700, Bino Oetomo via Pdns-users wrote:<br>
<br>
> Dear All.<br>
> <br>
> I'm trying to playing with PDNS API.<br>
> <br>
> I try to create new zone.<br>
> <br>
> The json payload is :<br>
> ```<br>
> {<br>
>     "name": "domain07.bino.",<br>
>     "kind": "Native",<br>
>     "records": [<br>
>         {<br>
>             "content": "ns1.cpaneldev.bino. emailserver.bino. 2024040101<br>
> 3600 1800 1209600 86400",<br>
>             "ttl": 86400,<br>
>             "name": "domain07.bino",<br>
>             "type": "SOA"<br>
>         }<br>
>     ],<br>
> }<br>
> ```<br>
<br>
A Zone object has no `records` member. It does have an `rrset` member,<br>
which is an array of rssets. See<br>
<a href="https://docs.powerdns.com/authoritative/http-api/zone.html#zone" rel="noreferrer" target="_blank">https://docs.powerdns.com/authoritative/http-api/zone.html#zone</a> and<br>
<a href="https://docs.powerdns.com/authoritative/http-api/zone.html#rrset" rel="noreferrer" target="_blank">https://docs.powerdns.com/authoritative/http-api/zone.html#rrset</a><br>
<br>
        -Otto<br>
<br>
> <br>
> I post it to '<a href="http://127.0.0.1:9530/api/v1/servers/localhost/zones" rel="noreferrer" target="_blank">http://127.0.0.1:9530/api/v1/servers/localhost/zones</a>'<br>
> Got http status of 201.<br>
> <br>
> But when I check directly to mysql backend, I got :<br>
> ```<br>
> mysql> select * from records where domain_id = 41244;<br>
> +---------+-----------+---------------+------+-----------------------------------------------------------------------------------------------+------+------+----------+-----------+------+<br>
> | id      | domain_id | name          | type | content<br>
>                                                                   | ttl  |<br>
> prio | disabled | ordername | auth |<br>
> +---------+-----------+---------------+------+-----------------------------------------------------------------------------------------------+------+------+----------+-----------+------+<br>
> | 1065344 |     41244 | domain07.bino | SOA  |<br>
> a.misconfigured.dns.server.invalid hostmaster.domain07.bino 2024040101<br>
> 10800 3600 604800 3600 | 3600 |    0 |        0 | NULL      |    1 |<br>
> +---------+-----------+---------------+------+-----------------------------------------------------------------------------------------------+------+------+----------+-----------+------+<br>
> 1 row in set (0,00 sec)<br>
> <br>
> ```<br>
> <br>
> Kindly please tell me how to prepare proper json payload to create zone via<br>
> pdns API<br>
> <br>
> regards<br>
> -bino-<br>
<br>
> _______________________________________________<br>
> Pdns-users mailing list<br>
> <a href="mailto:Pdns-users@mailman.powerdns.com" target="_blank">Pdns-users@mailman.powerdns.com</a><br>
> <a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users" rel="noreferrer" target="_blank">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
<br>
</blockquote></div>