Why does the rest switch config do absolulty nothing

switch:
  - name: fanswitch2
    platform: rest
    resource: https://xxx.xxx.net/api/xxx/SetFanState2
    body_on: '{"active": true}'
    body_off: '{"active": false}'
    is_on_template: "{{ value_json.active }}"
    headers:
      Content-Type: application/json
      Authorization: Bearer xxx

this config produces no errors, but also no entities in the HA interface.
it also does not call the API at all.

so what’s going on here???

The xxx you have after api in the URL is typically a token and a token is linked to a specific device, so you can not just copy it from another device.

can if it’s my own API

just to be clear xxx is something I have taken out to post here,
these are filled in on my yaml file

Ok, then test the URL in a browser to see if it shows correctly

all the endpoints I want to use work fine in postman. all valid returns and such.

the main issue is the API is not getting called from HA full stop

image

when I try with postman I can see the API getting hit
I don’t understand with HA won’t even hit it

It looks like you have just copied the example from the documentation without adjusting the payloads or templates to match your resource.

i built a resource to match it in C#,
I made my own API for it to use

it just won’t call them at all

I know nothing about C but I see nothing there that sends the json payload {"active": true}

so you’re looking at an endpoint, you are right in that it returns nothing,
the problem is that I’m not even getting that far to needing a return.

the API endpoint is not getting called at all from HA.
which is my main problem