Restful no connection

Windows 10 / Virtualbox

In configuration.yaml I put :
api:

I tried to connect with this code, I can connect to https://XXconnect.nl:9000 so there is no firewall problem.

The error is: curl: (7) Failed to connect to XXconnect.in port 9000: Bad access

I tried different 10 years Tokens

Do I need to install something else ?

curl -g -X GET -H “Authorization: Bearer eRyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI1NWIxYzRhNDY3OTA0NmM3ODU2ZmJhYjNmMDA5NTlhMyIsImlhdCI6MTY0NDc3MTM2MywiZXhwIjoxOTYwMTMxMzYzfQ.PBziNcqd9xD0QTSC6Ok-kaEtNvxx4fsf2honW8CbWWE” https://XXconnect.nl:9000/api/states

So xxconnect.nl issues 10 year tokens?

Sorry, English is not my first language,
I mean I tried to use different Tokens, created in HA.
Thanks for your answere.

HA tokens are not for accessing other sites/apis on the internet.

That’s clear…
Can you please tell me what I need to do ?
I want a switch that sends data (on/off) to my Arduino.
Something like a switch that’s connected to a “Home Assistant websocket”.
I don’t want to use ESPHome…
Thank you.

How does the arduino receive data? Does it have a rest api?

Great tip, I tried https://github.com/marcoschwartz/aREST on my ESP8266 and it’s working.
Thank you…

shell_command:
  switch_1_on: curl -X GET "http://192.168.2.90/digital/5/1"
  switch_1_off: curl -X GET "http://192.168.2.90/digital/5/0"

switch 5:
  - platform: template
    switches:
      garagedeur_switch:
        friendly_name: ESP8266 Open
        value_template: ""
        turn_on:
          service: shell_command.switch_1_on
        turn_off:
          service: shell_command.switch_1_off