Contents
List Departments - Plugixa Team
GET /plugixateam/v1/members/departments
List every department name used by at least one member, for a filter or a picker.
Needs a signed-in WordPress user with the plugixa_team_edit capability, which administrators and editors get when the plugin is activated, or manage_options.
Request
GET https://your-site.example/wp-json/plugixateam/v1/members/departments
This endpoint takes no parameters and is not paged.
Responses
200 OK. data is the list of department names.
Sorted alphabetically. Drafts and hidden members count too.
{
"success": true,
"message": "",
"data": [
"Design",
"Engineering",
"Sales"
]
}
| Field | Type | Meaning |
|---|---|---|
data[] |
string |
A department name, exactly as typed on the members. Use it with filter[department] in List Members |
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixateam/v1/members/departments" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixateam/v1/members/departments');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixateam/v1/members/departments', {
headers: {
'Authorization': `Basic ${auth}`,
},
});
const { data } = await response.json();
Quick Links
Share