0

Patching ParentalControls requires hex code

Based on the comments from your support staff  in patching-arrays, the api supports patching via name rather then hex

 

curl -X PATCH -H "Content-Type: application/json" -H "X-Api-Key: xxx" --data '{"active": false}' "https://api.nextdns.io/profiles/abc123/parentalControl/services/youtube"

but when I try I get the following

> curl --data '{"active": false}' -X PATCH -H "Content-Type: application/json" -H "X-Api-Key: xxxxx" "https://api.nextdns.io/profiles/bxxxx/parentalControl/services/youtube"
{"errors":[{"code":"notFound"}]}%

> curl --data '{"active": true}' -X PATCH -H "Content-Type: application/json" -H "X-Api-Key: xxxxx" "https://api.nextdns.io/profiles/bxxxx/parentalControl/services/youtube"
{"errors":[{"code":"notFound"}]}%

 

However If I goto the UI and look in developer tools when enabling a service I see its using a hex code for "youtube" and if I use that it works

curl -X PATCH -H "Content-Type: application/json" -H "X-Api-Key: xxxx" --data '{"active": true }' "https://api.nextdns.io/profiles/xxxx/parentalControl/services/hex:74696b746f6b"

 

If hex codes are required, which I hope they are not, is there an api to enumerate them ?

2 replies

null
    • NextDNs
    • 1 yr ago
    • Reported - view

    The service you are patching is probably not added to this profile, hence the 404.

      • John_Dyer
      • 1 yr ago
      • Reported - view

      John Dyer NextDNS That seems to have fixed it , thank you for that.. But given that there are only 37 "Apps" listed in Parental Controls, with seemingly no ability to add more, why not add it when activating it ?  Having three states seem odd; IMHO having missing and false seems redundant

Content aside

  • 1 yr agoLast active
  • 2Replies
  • 51Views
  • 2 Following