From 50bd654f4b9f90a95ad74b55384b718a767f9504 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 29 Dec 2022 14:49:01 -0500 Subject: [PATCH] Fix Todoist REST entities, close #65 --- configuration.yaml | 4 +++- sensors/tasks.yaml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configuration.yaml b/configuration.yaml index c996005..1d3ca95 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -55,7 +55,9 @@ rest_command: todoist: method: post url: 'https://api.todoist.com/sync/v9/{{ url }}' - payload: !secret todoist_api_payload + payload: '{{ payload }}' + headers: + Authorization: !secret todoist_api_token content_type: 'application/x-www-form-urlencoded' downloader: diff --git a/sensors/tasks.yaml b/sensors/tasks.yaml index a5a48a0..ce23385 100644 --- a/sensors/tasks.yaml +++ b/sensors/tasks.yaml @@ -3,8 +3,9 @@ method: GET resource: 'https://api.todoist.com/sync/v9/projects/get_data' params: - token: !secret todoist_api_token project_id: 2285969005 + headers: + Authorization: !secret todoist_api_token value_template: '{{value_json[''project''][''id'']}}' json_attributes: - project @@ -15,8 +16,9 @@ method: GET resource: 'https://api.todoist.com/sync/v9/projects/get_data' params: - token: !secret todoist_api_token project_id: 2285967948 + headers: + Authorization: !secret todoist_api_token value_template: '{{value_json[''project''][''id'']}}' json_attributes: - project