List Notes
List notes on a post, newest first. This operation is experimental.
Requires the notes:read scope.
See the Notes guide for the complete workflow and error handling.
query ListNotes {
collaborationNotes(input: { subject: { postId: "YOUR_POST_ID" } }, first: 10, after: null) {
edges {
cursor
node {
id
text
annotations { type text content indices url displayValue serviceEntityId }
authorId
author { id name }
allowedActions
createdAt
updatedAt
}
}
pageInfo { hasNextPage endCursor }
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query ListNotes {\n collaborationNotes(input: { subject: { postId: \"YOUR_POST_ID\" } }, first: 10, after: null) {\n edges {\n cursor\n node {\n id\n text\n annotations { type text content indices url displayValue serviceEntityId }\n authorId\n author { id name }\n allowedActions\n createdAt\n updatedAt\n }\n }\n pageInfo { hasNextPage endCursor }\n }\n}"}'
async function listNotes() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query ListNotes {
collaborationNotes(input: { subject: { postId: "YOUR_POST_ID" } }, first: 10, after: null) {
edges {
cursor
node {
id
text
annotations { type text content indices url displayValue serviceEntityId }
authorId
author { id name }
allowedActions
createdAt
updatedAt
}
}
pageInfo { hasNextPage endCursor }
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
listNotes();
import requests
query = """
query ListNotes {
collaborationNotes(input: { subject: { postId: "YOUR_POST_ID" } }, first: 10, after: null) {
edges {
cursor
node {
id
text
annotations { type text content indices url displayValue serviceEntityId }
authorId
author { id name }
allowedActions
createdAt
updatedAt
}
}
pageInfo { hasNextPage endCursor }
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query ListNotes {
collaborationNotes(input: { subject: { postId: "YOUR_POST_ID" } }, first: 10, after: null) {
edges {
cursor
node {
id
text
annotations { type text content indices url displayValue serviceEntityId }
authorId
author { id name }
allowedActions
createdAt
updatedAt
}
}
pageInfo { hasNextPage endCursor }
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
For a channel-less draft, replace the subject with { contentItemId: "YOUR_CONTENT_ITEM_ID" }. Use a ContentItem ID, not an Idea-board ID.