Notion Database → Github Repo

  1. Notion API 키 발급 https://www.notion.so/profile/integrations

  2. Notion Database에서 1번 api 연결

    image.png

  3. Notion Database의 id 얻기

    image.png

  4. id 추출

    1. https://www.notion.so/kbae/{{id}}?v=1629c51*****d000c7d0109bc&pvs=4
  5. api 호출

    1. API 호출 메소드는 POST여야 합니다.

    2. 호출할 API의 url은 다음과 같습니다. https://api.notion.com/v1/databases/{{데이터베이스 아이디}}/query

    3. header는 다음과 같이 3개를 입력해야 합니다.

      Authorization Bearer {{api 시크릿 키}}
      Notion-Version 노션 api 버전입니다. 최신버전으로 하시면 됩니다.
      버전은 아래 링크에서 확인할 수 있습니다.
      https://developers.notion.com/reference/changes-by-version
      Content-Type application/json
  6. api 확인

    1. insomnia로 확인

    image.png

  7. page에서 가져오면 따로 필요한 것 같은데…. 일단 표 안에서 text 받아서 가져오는 걸로 변경

  8. 예시 코드


github repo status → notion Database

  1. git repo를 연결해서 pr 또는 issue를 notion table에 동기화 시킬 수도 있다.

    image.png