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
-
The service you are patching is probably not added to this profile, hence the 404.
Content aside
- 2 yrs agoLast active
- 2Replies
- 53Views
-
2
Following