We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bbd479b + 25c0063 commit 87ee46aCopy full SHA for 87ee46a
notion/block.py
@@ -542,6 +542,17 @@ class PageBlock(BasicBlock):
542
543
locked = field_map("format.block_locked")
544
545
+ def get_backlinks(self):
546
+ """
547
+ Returns a list of blocks that referencing the current PageBlock. Note that only PageBlocks support backlinks.
548
549
+ data = self._client.post(
550
+ "getBacklinksForBlock",
551
+ {"blockId": self.id},
552
+ ).json()
553
+ if "backlinks" not in data:
554
+ return None
555
+ return [self._client.get_block(block.get("mentioned_from").get("block_id")) for block in data.get("backlinks")]
556
557
class BulletedListBlock(BasicBlock):
558
0 commit comments