Tasker: Unexpected 401 when making a https request to the Notion API

18 Views Asked by At

I'm using this task in Tasker, the android application. Api key and database_id are intentionally obfuscated here, but are correct (identical to working request on desktop) in Tasker.

A1: Input Dialog [
    Titel: Add ...
    Default Input:  
    Close After (Seconds): 30 ]

A2: HTTP Request [
    Method: POST
    URL: https://api.notion.com/v1/pages
    Headers: Authorization: Bearer 'secret_BLABLABLA',
    Content-Type: application/json,
    Notion-Version: 2022-06-28
    Body: {
                "parent": { "database_id": "dbfc5aBLABLABLA"},
                "properties": {
                    "Title": {
                        "title": [
                            {
                                "text": {
                                    "content": "%input"
                                }
                            }
                        ]
                    },
                }
            },
    Timeout (Sekunden): 30
    Structure Output (JSON, etc): An ]

After running the task, entering a text and submitting in the dialogue, I'm expecting it to return status code 200. Instead it returns 401. A request with the same details works on my desktop.

0

There are 0 best solutions below