728x90
기본적인 사용 방법은 아래에 나와있다.
https://developers.notion.com/reference/post-database-query
Query a database
Gets a list of Pages and/or Databases contained in the database, filtered and ordered according to the filter conditions and sort criteria provided in the request. The response may contain fewer than page_size of results. If the response includes a next_cu
developers.notion.com
다만 위의 방법만으로는 헷갈리는 사람들이 많을 것이다.
http://api/notion/query?database_id=사용할DB의ID
여기서 사용할 DB의 ID는 노션 DB의 점 세 개 아이콘을 누른 후, 보기 링크 복사를 누르면,
https://www.notion.so/DB의ID?v=뭔가다른거
위의 주소에서 DB의ID라 쓰여진 /부터 ?전까지의 자리에 위치한 것이 DB의 ID이다.
// const filterConditions = []
// // 프로젝트 필터
// if (params.프로젝트 !== null) {
// filterConditions.push({
// property: '프로젝트',
// relation: {
// contains: params.프로젝트,
// },
// })
// }
// // 담당자 필터
// if (params.담당자 !== null) {
// filterConditions.push({
// property: '담당자',
// people: {
// contains: params.담당자,
// },
// })
// }
// // 계획일자 필터
// if (params.계획일자 !== null) {
// filterConditions.push({
// property: '계획일자',
// date: {
// on_or_after: params.planStart,
// },
// })
// filterConditions.push({
// property: '계획일자',
// date: {
// on_or_before: params.planEnd,
// },
// })
// }
728x90
반응형
'개발 상식 & Tip!' 카테고리의 다른 글
기초 Linux 문법 (0) | 2023.08.15 |
---|---|
교육 사이트! (0) | 2023.08.11 |
프론트단(React)에서 .env 401에러 날 때 (0) | 2023.07.23 |
프리티어 적용 안될 때(하단 프리티어 더블체크) (0) | 2023.07.22 |
블로그에서 CodePen 사용방법! (0) | 2023.03.10 |
댓글