HTTP POST card with authentication and lot's of confusion

(assuming you mean \)

Those are escape characters because the entire string is already surrounded by double quotes.

FWIW, in your initial post it looks like you might have changed the name of the device to iphonevnMartjin

Wow, sharp! ji instead of ij…

Razer sharp! nice catch. unfortunately this was merely a typo in the first post. I’m done with this. Don’t think it can be done. Don’t understand why YARC does work and CURL / Homey doesn’t

Even doing it plain text i’m still getting ‘forbidden’…

Going with normal browser to http://192.168.20.69/control/clients/delete i’m getting a forbidden too.

That is expected, it needs to be a POST request.

Was afraid of that… tnx for you help non the less!

I can’t seem to let it go. Apparently CURL is now a default package on Windows 10 and 11 too. Didn’t know that.

When I send the command:

curl --verbose --http1.1 -H “Content-Type:application/json” -d @json-add.txt https://user:pass@adguard.hoogenbosch.cloud/control/clients/add

with

  {
  	"name": "iphonevnMartijn",
  	"ids": ["192.168.20.125"],
  	"tags": ["user_child"],
  	"upstreams": [],
  	"filtering_enabled": true,
  	"parental_enabled": false,
  	"safebrowsing_enabled": false,
  	"safesearch_enabled": false,
  	"use_global_blocked_services": false,
  	"use_global_settings": false,
  	"blocked_services": ["tiktok", "amazon", "dailymotion", "discord", "disneyplus", "ebay"]
  }

in the .txt file, it works from my laptop device.

From Homey it says, unexpected end of JSON file

EHHHHHH … even though it presents this error… it does the job… it deletes and adds…

1 Like

Mooi dat het werkt, Martijn!

even een lekkere flauwe grap toe:

...
  	"use_global_settings": false,
  	"blocked_services": ["tiktok", "amazon", "dailymotion", "discord", "disneyplus", "ebay"],
    "here_it_ends_JSON!!": true
  }
1 Like

oh well… … that makes it expected, right? :rofl: :face_with_raised_eyebrow:

Yea!! Keep it simple hehe

1 Like