Create Note
Create a note on a post. This operation is experimental.
Requires the notes:write scope.
See the Notes guide for the complete workflow and error handling.
mutation CreateNote {
createCollaborationNote(input: {
subject: { postId: "YOUR_POST_ID" }
text: "Please review the revised caption."
annotations: []
}) {
__typename
... on CreateCollaborationNoteSuccess {
edge { cursor node { id text allowedActions } }
}
... on MutationError { message }
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "mutation CreateNote {\n createCollaborationNote(input: {\n subject: { postId: \"YOUR_POST_ID\" }\n text: \"Please review the revised caption.\"\n annotations: []\n }) {\n __typename\n ... on CreateCollaborationNoteSuccess {\n edge { cursor node { id text allowedActions } }\n }\n ... on MutationError { message }\n }\n}"}'
async function createNote() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
mutation CreateNote {
createCollaborationNote(input: {
subject: { postId: "YOUR_POST_ID" }
text: "Please review the revised caption."
annotations: []
}) {
__typename
... on CreateCollaborationNoteSuccess {
edge { cursor node { id text allowedActions } }
}
... on MutationError { message }
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
createNote();
import requests
query = """
mutation CreateNote {
createCollaborationNote(input: {
subject: { postId: "YOUR_POST_ID" }
text: "Please review the revised caption."
annotations: []
}) {
__typename
... on CreateCollaborationNoteSuccess {
edge { cursor node { id text allowedActions } }
}
... on MutationError { message }
}
}
"""
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 = '
mutation CreateNote {
createCollaborationNote(input: {
subject: { postId: "YOUR_POST_ID" }
text: "Please review the revised caption."
annotations: []
}) {
__typename
... on CreateCollaborationNoteSuccess {
edge { cursor node { id text allowedActions } }
}
... on MutationError { message }
}
}
';
$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.