Hello everyone
I have been trying to call an API using a GET request for one of my sensors, without success. Everything works with curl or using requests in python, but I can’t seem to do it in the HA environment. The sensor in my dashboard shows the following:
{'code': 5, 'message': 'Not Found', 'details': []}
Here is my configuration.yaml file:
sensor:
- platform: rest
resource: !secret awair-resource
headers:
x-api-key: !secret awair-api-key
name: Awair_raw
value_template: "{{ value_json }}"
and here is how I wrote my secret.yaml file:
awair-api-key: "a1a1a1a1a1a1a1a"
awair-resource: https://developer-apis.awair.is/v1/orgs/[a random id]/devices/awair-omni/[a random id]/air-data/latest"
When I do the following command w/ cURL, it returns my .json file of interest:
curl --location 'https://developer-apis.awair.is/v1/orgs/[a random id]/devices/awair-omni/[a random id]/air-data/latest' \
--header 'x-api-key: a1a1a1a1a1a1a1a'
Thanks a bunch for your help!