Get Filtered Channels
Fetch all channels for the provided Organization ID.
query GetChannels {
channels(input: {
organizationId: "some_organization_id",
filter:{
isLocked: false
}
}) {
id
name
displayName
service
avatar
isQueuePaused
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query GetChannels {\n channels(input: {\n organizationId: \"some_organization_id\",\n filter:{\n isLocked: false\n }\n }) {\n id\n name\n displayName\n service\n avatar\n isQueuePaused\n }\n}"}'
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 GetChannels {
channels(input: {
organizationId: "some_organization_id",
filter:{
isLocked: false
}
}) {
id
name
displayName
service
avatar
isQueuePaused
}
}
`,
}),
});
const data = await response.json();
console.log(data);
<?php
$query = '
query GetChannels {
channels(input: {
organizationId: "some_organization_id",
filter:{
isLocked: false
}
}) {
id
name
displayName
service
avatar
isQueuePaused
}
}
';
$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);