Skip to content

johnpierson/OkayNotionClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relay

Okay Notion Client aims to provide easy and okay access to the Notion.so API for .NET users..
Notion logo credit: Notion Media Kit


Relay

Before use, read up on Notion's API at Notion Developer Portal

Actions Supported

Authentication

  • Provides basic authentication with RestSharp and your notion access token.

Read

  • List Databases for given access token
  • List pages for selected database
  • Read database properties

Write

  • NOT SUPPORTED (YET)

Usage

The library can be used as follows:

using System;
using System.Linq;
using OkayNotionClient;

namespace NotionSample
{
    class Program
    {
        static void Main(string[] args)
        {
            NotionClient client = new NotionClient(yourAccessTokenHere);

            var firstDatabase = client.ListDatabases().First();
            
            Console.WriteLine($"fetching pages for {firstDatabase.Title.First().PlainText}");

            var pages = client.ListPagesForDatabase(firstDatabase);

            foreach (var page in pages)
            {
                Console.WriteLine($"page id: {page.Id} was last edited at {page.LastEditedTime}");
            }
            Console.ReadLine();
        }
    }
}

resulting in:

OkayNotionUsage

Built With

The OkayNotionClient project relies on a few community-published NuGet packages as listed below :

  • Newtonsoft - handles serializing and deserializing to JSON
  • RestSharp - enables easier interaction with REST API endpoints

Special Thanks

Special thanks to Radu for sharing DynaWeb. This package really helped me understand REST calls.

About

This is an okay notion client for C# use.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages