Skip to Content
notion-to-utilsgetFileUrl()

getFileUrl()

Notion 페이지의 파일 속성에서 URL을 추출합니다.

시그니처

client.getFileUrl( pageId: string, propertyKey: string ): Promise<string | undefined>

파라미터

파라미터타입설명
pageIdstringNotion 페이지 ID
propertyKeystring파일이 포함된 속성 이름

반환값

파일 URL을 string으로 반환하거나, 파일이 없거나 파일 타입이 아닌 경우 undefined를 반환합니다.

예제

const fileUrl = await client.getFileUrl('page-id', 'Attachment'); // 'https://prod-files-secure.s3.us-west-2.amazonaws.com/...'

[!NOTE] 여러 파일이 있는 경우 첫 번째 파일만 반환합니다. 파일 타입이 아닌 속성에는 undefined를 반환합니다.

Last updated on