11/8/2023 0 Comments Notion sdk![]() ![]() I’m telling it that I want it to look at the Issue field, and filter it to only return rows where Issue is equal to the log number. I then used the library to build a filter, the query params, and use them to then request the data from Notion.įor building the filter, what I’m doing is creating a filter that compares numbers. By default, the cursor is null so the Notion API will start from the beginning. This method takes two parameters, the first is the log or issue number, the second is the cursor as defined above in the GetReadingLogArticles() method. It takes the log number or issue number as its parameter and spits out a list of articles. Now that that is out of the way, the primary function I mentioned above is called GetReadingLogArticles. If there are more records we have to query, we’ll use this to tell Notion where to start returning results from. NextCursor: string? - this is a nullable string.If this returns true, we’ll need to query the API again. HasMore: bool - this indicates whether there are any more results in the query.Results: List - this is a list of the pages that match our query.This is going to feel like I’m jumping ahead a little bit, because I am, but API calls to notion will return three properties we’ll need to use. For my reading log, that’s not normally going to be an issue, but I still want to handle it. Now the one limitation to Notion’s API is that it only returns 50 records at a time. Notice that I build the client passing in the AuthToken from my NotionConfiguration object. ![]() I create the class and then create the client the primary function will use to query Notion’s API. NET Console Application would do the job nicely. I decided that I’d try my hand at building the markdown using the API as well. But then I thought of how I’d been pulling the data on other pages in my site, like my Bookshelf, Games & Movies pages. After the double week issue where I had 40+ links, it was starting to get tedious. Originally I was just going through the list, copying and pasting the links and info manually into the markdown file that becomes the post on my site. NET.įor the last several issues, I’ve been populating a Notion database with the different links I want to share on the next reading log. I figured I’d share my insights in hopes to help anyone else that wants to work with Notion’s API in. To help smooth the process of converting that Notion database to a markdown file to use on my site, I built a little C# console app to pull the data and build the page. The way I’ve started to manage them is through a Notion database. This is my list of articles and various things on the Internet I’ve read that I found particularly interesting or helpful. Over the last year, I’ve been posting my weekly reading log.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |