Notion and iOS Shortcuts - Add Item To Database using the API
Summary
TLDRThis tutorial demonstrates how to use iOS Shortcuts to add items to a Notion database. It guides through creating an API user, obtaining a database ID, and crafting a JSON request to add tasks. The process includes setting up API access, sharing the database with the integration, and using headers for authorization. The video concludes with a practical example of adding a to-do item and suggests using user input for dynamic task addition, encouraging feedback for more content.
Takeaways
- π± The video demonstrates how to use iOS Shortcuts to add items to a Notion database.
- π It's necessary to create an API user or integration in Notion to get a secret key for authentication.
- π The database must be shared with the API user to make it accessible for API calls.
- π Retrieving the Database ID is crucial, which can be done from the address bar or by copying the page link.
- π The video explains how to make a POST request to the 'pages' endpoint in Notion's API to add a new item.
- π Three headers are required for the API call: Authorization, Notion Version, and Content-Type.
- π The Authorization header uses the 'Bearer' keyword followed by the secret key.
- π The content of the data being sent is formatted in JSON, specifying the properties of the new database item.
- π The video shows how to dynamically input the title for the new item using Shortcuts' input feature.
- π It also illustrates refreshing the Notion database to see the newly added items.
- π₯ The creator encourages feedback and subscriptions for more similar tutorial videos.
Q & A
What is the purpose of the iOS Shortcuts demonstration in the video?
-The purpose of the demonstration is to show how to use iOS Shortcuts to add items to a database in Notion.
What is the first step in adding items to a Notion database using iOS Shortcuts?
-The first step is to create an API user or API integration in Notion by visiting the 'Notion > My integrations' page and following the prompts.
What is the name given to the API integration in the video?
-The API integration is named 'fubar' in the video.
Why is a secret key important in this process?
-The secret key is important as it authenticates the API calls to the Notion database, ensuring secure access.
How do you make a Notion database accessible to API calls?
-You make a database accessible to API calls by sharing it with the integration user that you created earlier.
What is the method used to retrieve the database ID in the video?
-The database ID is retrieved by copying the relevant part of the URL from the address bar or by copying the page link and extracting the necessary part.
What does the video demonstrate about making an API call to the Notion database?
-The video demonstrates how to use the 'Get Content of URL' action in iOS Shortcuts to make a POST request to the 'pages' endpoint with the necessary headers and JSON payload.
What are the three headers required for the API call in the video?
-The three headers required are Authorization (with the Bearer token and secret key), Notion Version, and Content-Type (application/json).
What is JSON and why is it used in this context?
-JSON (JavaScript Object Notation) is a lightweight data-interchange format used here to structure the data payload for the API call to add a new page to the Notion database.
How does the video suggest personalizing the Shortcut to add different items to the Notion database?
-The video suggests using the 'Ask for Input' action in iOS Shortcuts to prompt the user to enter text for the to-do list, which then replaces the static text in the JSON payload.
What feedback does the video creator seek from viewers?
-The video creator seeks feedback on whether viewers are interested in more simple explanations like the one provided and may consider making more videos based on the response.
Outlines
π± Automating Notion Database Updates with iOS Shortcuts
The script demonstrates how to use iOS shortcuts to automate adding items to a Notion database. It begins by introducing a simple Notion database with a 'Name' and a 'Checkbox' for task completion. The tutorial assumes the viewer has a Notion account and proceeds to guide through creating an API user and integration for Notion, obtaining a secret key, and ensuring the database is API accessible. It then explains how to get the database ID from the URL and shows the process of making an API call to add a new page to the database using the 'Get Content of URL' action, setting headers with the authorization, Notion version, and content type. The JSON format for the data payload is also discussed.
π§ Customizing iOS Shortcuts for Dynamic Notion Database Entries
This paragraph continues the tutorial by showing how to add a new page to the Notion database with custom properties using the iOS Shortcuts app. It details the process of setting the 'text content' for a new entry and suggests ways to avoid adding duplicate items by asking for user input. The script includes steps to prompt the user to input text for the to-do list and replace a static entry with a dynamic variable from the user's input. The tutorial concludes by encouraging viewers to provide feedback and subscribe for more content, highlighting the author's openness to creating more educational videos based on viewer interest.
Mindmap
Keywords
π‘iOS Shortcuts
π‘Notion
π‘API User
π‘Secret Key
π‘Database ID
π‘API Calls
π‘Headers
π‘JSON
π‘Magic Variable
π‘Content-Type
π‘Automation
Highlights
Demonstration of using iOS Shortcuts to add items to a Notion database.
Introduction of a simple Notion database with a name and a checkbox for task completion.
Explanation of creating an API user or integration in Notion for database access.
Step-by-step guide to naming and setting permissions for the API integration.
Instruction to copy the secret key for use in the Shortcuts app.
Process of sharing the Notion database with the API integration for accessibility.
Method to obtain the database ID from the address bar or share link.
Description of making an API call to the Notion database using the 'get content of URL' action.
Details on setting up headers for the API call, including authorization with the secret key.
Requirement of specifying the Notion version and content type in the API call headers.
Formation of a JSON object to define the structure of the data being sent to the database.
Guidance on how to add a new page to the Notion database with specific properties.
Integration of user input to dynamically add tasks to the Notion database.
Demonstration of the iOS Shortcuts app prompting for input to add unique tasks.
Example of adding a task 'clean the dog' to the Notion database using the shortcut.
Invitation for feedback and suggestions for more tutorial videos.
Note on the lack of subscription and the creator's activity level on the platform.
Transcripts
the following is a really simple
demonstration
of how you can use ios shortcuts
to add stuff to your database in notion
what i have here let me just show you is
a really simple
database which just has a name and a
checkbox let's call it a checkbox just
for fun checkbox
that can toggle if a task is done or not
do the dishes or whatever
like this and what you i want to show is
how you can
add um items to this database
just straight from your ios shortcuts
app so
let's get to it i'm going to show it all
the way from
yeah i'm uh i'm not going to show you
how to make a notion
account i'm guessing you already have
that so what you need to do is
first you need to create create an ap
api user and
or api integration
you do that by going to this link here
notion my integration
and it's going to take you to this page
you just
click on your integration give it a name
let's do fubar
for instance
and give it access to everything here
submit and then we're going to get a key
secret key here
let's just copy that one and bring it
over into the
shortcuts i'm just going to temporarily
store it
api key temporarily just store it
here like that the second thing we need
to do
is get a database now let's share
the database firstly we need to make the
database as
accessible to api
calls so we do that by go and go into
the database
let's go here simple to do and then we
just
share it with we click here and
share it with the integration user that
we already just created in the foo bar
like that invites and don't
don't so now this database is callable
on callable
then the third thing we need to do is
get the
database id you can get it a couple of
ways the
simplest i think is to just go up here
to the address bar
and just grab this part it's the
thing going fro so slash all the way up
to the first
question mark and that's it basically
you can also get it by
clicking the share and share um
uh let's see copy the page link like
that and then you're gonna
have the link like so
and then you just grab this wow this
part here let's just remove all the
other stuff
database id like that
okay now we have what we need so
now we need to make a call
to the uh
to the database we do that by using the
get content of
earl action and then we we need to do
the
uh call to a specific role
and i got that one over here it's
called pages we post to the
this earl like so
and we we do this by we enter
this our pages are all so actually we're
adding a page
and not a database item even though
it is in a database we call
every item here a page so we are
sending a call to pages and we need to
add some information to identify
and ourself and so we need some headers
we need three headers we need first
authorization and then we use the
bearer oops
a bearer space and then the secret key
up here
like this with no extra spaces that's
important
and then we need uh notion version
like for identifying what
ap version we are using
just put it in like that and then we
need and it wants to know what kind of
content
we are sending so we're just going to
paste in
this like so okay
so the call is ready but we also need to
specify what kind of
data we are sending and the content of
the data
we do that by creating a json if you
don't know that json is you need to
look that up because i'm not going to
explain that here but oops
let's grab so this
is how you format the json so basically
we are tearing
the telling that the in the database
here and we point to our database id
here in this database we're going to add
a new page
with the properties name
which is uh the title uh
and the name has a bunch of stuff in it
but
we're going to set the text content to
this lauren ips
now we can also blah blah blah
whatever like this and then we're joined
going to jam this jason into the request
like so and we choose file choose magic
variable
get this text into it so now
if we just hit play on this
it should work allow it to access the
internet
like so and we should get a response
yeah
this means that it worked so
i'm just i can just bring up the
notion hairs
let's see simple
to do
[Music]
let's just refresh it because
blah blah blah come through and can run
it again to add another
like so blah blah blah and again
but it's not really helpful to add the
same item over over and over
so what we do to allow let's
get rid of we're just going to ask for
input
like so what do you
want to add to your to-do list
like so and then it's going to prompt
you from
just enter some text and then we just
replace this part here
with the magic variable
from the provided input like so so if we
run this again
clean that dog like so
clean the dog it's in there so that's
the simplest way to do it
there if you're interested in
me making more short simple explanations
like this
then feel free to comment and
subscribe and all of that good stuff
not bother with subscription and i'm not
that
active but give me a feedback if you
want more videos like this
so okay
Browse More Related Video
Generate C# Model from existing Microsoft SQL Server Database
Cara Membuat Database dan Tabel MySQL pada phpMyAdmin
Alice 101: Google Calendar scenario
[Eurostat 1/1] Get Europe's data in Power BI with Eurostat API - @EU_Eurostat
Dream Report: Acquiring Data from SQL Server
How to Start an AWS Step Function Workflow From Lambda | STEP BY STEP GUIDE
5.0 / 5 (0 votes)