-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APIResponseError: API token is invalid. #68
Comments
Hi @danielleeleblanc, thanks for reaching out! I think I've seen this error message when I've copied the token incorrectly. If it was a valid token but the integration wasn't properly shared with your database, then I think you'd see an error message along the lines of "database not found." So, my best guess is that there might have been a slight typo when the token was copied from the Notion integrations page into Zotero. Perhaps a space snuck in at the beginning or end of the token? |
Maybe related maybe not. I got APIResponseError: API token is invalid too. I made a mistake and copied too much off the database link. I correctly started after https://www.notion.so/ but I didn't stop before the ? mark. Hope this helps anyone else. Once I removed the extra digits, all seems to work as intended. |
Thanks for getting back to me on this @dvanoni and @gregdyche ! I tried re-copying and pasting both the Database ID and the Integration Token ID (re: your suggestions) into Notero Preferences. However, now I'm getting a new error message (see below). |
@danielleeleblanc this is progress! This error means your API token is working correctly, but there's still something missing that's preventing access to the database you want to use. Have you gone through the steps in the "Could not find database" FAQ in the README? |
@dvanoni good to hear! I have followed the steps from the FAQ you shared but am still getting the same warning for some reason? |
@danielleeleblanc would you mind sharing a couple things with me so I can see if something is off?
Thanks! |
@dvanoni sure thing, please see below! Database: https://www.notion.so/0802b28636b64a97a9296f78f13e0af5?v=9726e4251e564b5d9bafd7bf3bcd1214 |
@danielleeleblanc darn, I'm really stumped on this one! Everything looks good to me. The only other thing I can think to ask at this point is: do you happen to have multiple integrations set up with Notion? I'm just wondering if there's any chance a different integration token was copied into Zotero. |
@dvanoni No, just the one integration. Although I'm wondering if I'm copying the database ID correctly. I should be just copying between the 'https://www.notion.so/' and the ?, right? |
@danielleeleblanc yeah, it looks like you've copied the database ID correctly. One other thing I just thought to check. When you view your integration at https://www.notion.so/my-integrations, are these boxes all checked? |
@dvanoni yes, all checked! |
@danielleeleblanc I'm quite baffled! I think all I have left at this point is the "turn it off and back on again" approach... Would you mind trying the following to see if it helps at all?
I apologize for the hassle. I really haven't seen something like this before! 😕 |
Hi, I've got the same problem. I tried approach above but failed. |
@hutianzhen just to clarify, are you seeing the I'm struggling to figure out how to debug this. To try ruling out something specific with Notero, would you be able to run a network request directly from you terminal? For example, using cURL:
You'd need to replace |
I solve this by unlocking the advanced template. When I duplicate the advanced example to my own notion account, a locked button(prevent accidental editing) appears next to the title, click the button. |
@hutianzhen that's an interesting discovery! To be honest, I'm not entirely sure why having the database locked would cause these API errors. I thought locking only impacted the ability to modify properties of the database rather than adding pages to the database. But I'm glad you were able to get things working! @danielleeleblanc is it possible that you're running into the same issue? |
@hutianzhen could you elaborate on where you're seeing a locked button? I'm not sure I see this on my page. |
@danielleeleblanc Please see below |
@hutianzhen hm, just tried this, and i'm still getting this message. |
got the same errors as @danielleeleblanc had. did all the measure mentioned above still getting the same API Response Error. My guess is the database ID format or atleast the shared link has changed compared to what is found on @dvanoni 's docs. |
@mpmangubat would you mind sharing the link to your Notion database and also the value that you've entered for the Database ID in the Notero Preferences window? I'm curious if something has indeed changed as you mentioned. Thanks! |
Here is possible answer: https://stackoverflow.com/a/74413640 |
you should just bind you dataBase with your integration by going to your dataBase and click on tree point up in right choose add connection then you can connect it with you integration. |
I may have found the problem. In my case I copied the Notion page ID instead of the database ID. It appears that when you first create an empty page and then add a database to it, the IDs will be different. I got the database ID by copying a link to a specific view and then extracting the ID from the link. Now it works :) |
Hello, |
Hi @cbeaumard, the I just performed some tests to see what scenarios would trigger the "API token is invalid" error, and it only occurred when I modified the integration token (rather than the database ID). I generated a few different tokens on https://www.notion.so/my-integrations, and it looks like they're all 50 characters long. Here's a screenshot of what the values look like for me. Do yours look similar? |
Hello @dvanoni. Thanks to your message, I understood my Integration Token was wrong (I thought it was the name and not the secret key). Now it's syncing ! |
@dvanoni Thanks for the help |
I'm glad you solved it, @vlwbirds! I'm hoping to making this process much less error prone by changing Notero to be an integration that can connect directly to your Notion account so that you don't have to copy and paste the token or database ID. |
Hi! Thank you so much for this helpful tool.
I'm in the process of trying to link Notion and Zotero but keep getting the following message when "Saving items to Notion..." -- "APIResponseError: API token is invalid". Is this something you've come across before? I've already checked to make sure I'm sharing my database with the integration and that the integration token and database ID are the same as what is provided by Notion. Any idea where I might be going wrong?
D
The text was updated successfully, but these errors were encountered: