I'm attempting to use the Notion API and authorizing with their OAuth flow: https://developers.notion.com/docs/authorization
It's a standard OAuth flow. Nothing out of the ordinary.
I'm able to generate the code
but I always get a invalid_client
error when trying to retrieve the access_token
using the following:
POST https://api.notion.com/v1/oauth/token
Content-type: application/x-www-form-urlencoded
client_id=MY_CLIENT_ID&client_secret=MY_CLIENT_SECRET&redirect_uri=MY_REDIRECT_URL&grant_type=authorization_code&code=THE_PROVIDED_CODE
I've made sure the client id and secret are correct. I've generated new client's to test just in case something is wrong there. I have my redirect url properly registered and it's accessible.
The weird thing is, you can use the built in OAuth authorization flow in Postman or Paw and the flow works fine. I can't figure out what's different with my code vs. what they're doing.
Any ideas?