Share to specific Notion page without Notion opening

I used @joshua_hare’s “Copy to Notion” action but I want the draft’s content to be pasted to a specific Notion page and without the Notion app opening. In other words, I want to “send it and forget it”.

I know Notion doesn’t have an API yet but can this be done? If not, is there some hacky scriptable way to do it? As some daisy-chain IFTTT-style solution?

1 Like

I don’t think this is possible. Notion needs a minimum of x-callback-url support, deep scripting support, or an API to do this. Until they finally sort out their API, I think you’re our of luck.

Of course, if you do want to hack it together on the Mac, you could look at tools like Keyboard Maestro, Fake Browser and Selenium to do the navigation and key presses for you.

1 Like

I’ve set up a basic action using the newly released Notion API to add text to a page or create a new page: Add To Notion | Drafts Directory (getdrafts.com)

1 Like

@moggy1972 Thanks for this! Looking forward to using notion with Drafts in a variety of ways.

On my wishlist is to have an action that lets me add a page to a database and fill in properties right from drafts.

1 Like

That can definitely be done. What would you want to do? Populate a form from Drafts?

1 Like

also thanks @moggy1972 been waiting for this a long time!

But I´m having some trouble, I put in the wrong info in the input fields and now I´m trying to correct it but every time I run the action I get this now (see image)

I have tried delet-ing the action and installing it back, but I get the same thing.
Screenshot 2021-05-21 at 22.59.03

Can you give me any tips?

Hey @moggy1972 thanks so much for this. Having a similar problem here.
If I want to change the token key, and inbox location, where do we change in the script? Mine was running but not populating any notion page that I could find.

Thanks!

@Ben_Walker , @kriisig - the simplest thing would just be to put the variables you need in the script. I did it this way so I could share the script without sharing personal details. So “var secret =“ etc.

If you do want to keep using the Credentials, I think you just need to delete the current settings from the settings menu and then you’ll get the chance to re-enter them. It’s just the page ID you need, with or without the dashes.

Hi @moggy1972 , Is it possible to add a new row in a table ? Thanks.

Yes - it’s very much the same thing. In Notion’s API a page is basically the same as a row in a database, you would just include any properties that you want to fill in as well. The API reference gives a bit more detail, you’d just have to get the JSON properly formatted, which I’ve found a little bit tricky (because of my lack of skills rather than the API).
Create a page (notion.com)

I could see how you could use this to create something like a habit tracker which you could update without ever leaving Drafts.

thanks @moggy1972 , I am trying to build a wishlist table in Notion database.

1 Like

Has anyone got this to work? I get the same error as above when I enter multiple lines of text. Else, it says success but I don’t see anything on Notion.

I put the page id and the api secret key. I also shared the inbox page with the api integration.

Thanks for the help!

The action provided by @moggy1972 was not working because:

  1. Notion API requires to add notion version to request header now, not sure when they started doing that;
  2. The author left test code in the script, which overwrites the page index proveded by the user.

Thanks Vincey - I’ll sort that out. I think the notion version thing has been a requirement for new integrations from the start of June, and will be required for all integrations from 1 July.

Thanks for doing this. I’ve installed it, filled in the Secret Key from Notion and the page that I want drafts sent to. When I choose an item, it goes through the motions of sending to Notion (pardon the rhyme) but I do not see the content in Notion. Is there a specific meaning of the word ‘Inbox’ when you mention that in Notion…or can I just tell it what page I want the Drafts content sent to?

It should just be the page id of the page you want to send it to. If it’s easier I could just rewrite it to make it obvious where you need to hard code the page.

Thanks…when you say ‘page id’ is that a specific identifier for the page, the page name (in my case ‘Drafts App’ or the URL for the page. The other point of confusion is whether the ‘version number’ for Notion is the date of the version (which it appears to be) or the version number and whether this has to be changed each time that Notion updates the version.

I really appreciate your hard work and responsiveness,

Jack

That’s important to support stable usage on trot the service . If anything new comes up, they can still serve old requests cause they see the version of the API is provided. I guess they did not put it in first because it was a n early adopter/beta testing.

The page id is the ID of the page. If you get the ID through the API - e.g from a database query - then it will look like this: “2e01e904-febd-43a0-ad02-8eedb903a82c”. In the URL, the ID is the 32 characters at the end of the URL, but here it doesn’t have the dashes. E.g.
https://www.notion.so/Inbox2e01e904febd43a0ad028eedb903a82c

You can use either ID format in the API.

Yes, the version is the date of the most recent main version (currently “2021-05-13”). As Andreas says, you won’t have to change it each time they update Notion - the idea is that older versions should still work as long as you identify them. That said, there have been some changes to the version published on 13 May but these haven’t resulted in a new version date. Changelog

Thanks for all the work on this. I was so happy to see it! Unfortunately, it is not working for me.

It took a couple of shots, but I’m fairly sure I have the right information entered. First I deleted the test script step that was in the action. Then, I went to my Notion account, created an internal integration, and used the internal integration token for the secret, and I am using the 32-character page id for the ID (no dashes.) When I run the action, I get a green success message. Yay! However, it just never shows up on the Notion page.

Any ideas?