400 error invalid request url but I have the correct url?

227 Views Asked by At

I am trying to use Make.com to make an API call to Notion to query a database (with a filter).

Here is the database ID: 3ac68604c4ca4375bc971fb1145d06a4

What I've done so far:

  • There is an internal integration in Notion with all permissions granted
  • Within the Notion database I am trying to query, the connection to the internal integration has been made and given all permissions
  • The secret key from this internal integration was used on Make.com to create a connection there

In the 'Make an API call to Notion' module, this is he endpoint URL I am using: https://api.notion.com/v1/databases/3ac68604c4ca4375bc971fb1145d06a4/query

I got this URL endpoint from https://developers.notion.com/reference/post-database-query

The Make.com module also says 'You don't have to add authorization headers; we already did that for you' so I did not add an authorization header with the secret key. However, I did already try adding this to fix the issue, and it didn't work. There is already a Content-Type header and Notion-Version header.

Attached here is a screenshot of the module

So, with all of this said, everything seems like it should work fine.

However, whenever I try to run it, I get a 400 error, and Make.com says 'Invalid request URL'.

Pasted below is the input bundle from the Make.com module:

{
        "url": "https://api.notion.com/v1/databases/3ac68604c4ca4375bc971fb1145d06a4/query",
        "body": "{\n  \"filter\": {\n    \"and\": [\n      {\n        \"property\": \"Due\",\n        \"date\": {\n          \"before\": \"2023-12-20\"\n        }\n      },\n      {\n        \"or\": [\n          {\n            \"property\": \"Status 2\",\n            \"select\": {\n              \"does_not_equal\": \"Done\"\n            }\n          },\n          {\n            \"property\": \"Status 2\",\n            \"select\": {\n              \"does_not_equal\": \"Archived\"\n            }\n          }\n        ]\n      }\n    ]\n  }\n}",
        "method": "POST",
        "headers": [
            {
                "key": "Content-Type",
                "value": "application/json"
            }
        ],
        "version": "2022-06-28"
    }

I've tried everything I can think of to fix this, unsuccessfully. Any help would be greatly appreciated.

I have tried:

  • double checking I have the correct database ID

I do have it correct. The 32-character string before the '?v=' in a database url.

  • deleting the integration from my Notion workspace and re-adding it

I expected this to work after, but it did not.

  • querying a different database in my Notion workspace

It did not work for this database either. This tells me that I must be missing something obvious, but I don't know what.

  • creating new connections in Make.com

I expected it to maybe be Make.com's fault, but I don't think it was

  • reading forums and articles for solutions

Everyone was able to resolve their issues because they misspelled "databases" in the endpoint URL or they forgot to put 'query' at the end of the URL. So this was not helpful either

0

There are 0 best solutions below