Skip to content

Commit

Permalink
Change the REST documentation
Browse files Browse the repository at this point in the history
This accounts for changes in the todoist api, as they do not accept the token as a parameter anymore
  • Loading branch information
bernikr authored and grinstantin committed Dec 24, 2022
1 parent bd1a228 commit b5e0e85
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ This card can be configured using Lovelace UI editor.
method: GET
resource: 'https://api.todoist.com/sync/v9/projects/get_data'
params:
token: !secret todoist_api_token
project_id: TODOIST_PROJECT_ID
headers:
Authorization: !secret todoist_api_token
value_template: '{{ value_json[''project''][''id''] }}'
json_attributes:
- project
Expand All @@ -54,13 +55,14 @@ This card can be configured using Lovelace UI editor.
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'
```
2. ... and to `secrets.yaml`:
```yaml
todoist_api_token: TODOIST_API_TOKEN
todoist_api_payload: token=TODOIST_API_TOKEN&{{ payload }}
todoist_api_token: 'Bearer TODOIST_API_TOKEN'
```
3. Replace `TODOIST_API_TOKEN` with your [token](https://todoist.com/prefs/integrations) and `TODOIST_PROJECT_ID` with ID of your selected Todoist project.
> You can get `TODOIST_PROJECT_ID` from project URL, which usually looks like this:
Expand Down

2 comments on commit b5e0e85

@jabronimus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the code in 65 supposed to have apostrophes around it in my yaml file or not?

My Todoist cards show up and do show all my items. However, they won't add or delete any tasks.

@jabronimus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it with both apostrophes and not ... no luck either way. Not sure what's going on.

Please sign in to comment.