-
Notifications
You must be signed in to change notification settings - Fork 0
API v2 Get the Enabled Status for All Features Within a Group
GET /v2/groups/{group_name}/features
http://example.com/api/v2/groups/{group_name}/features
http://example.com/api/v2/groups/{group_name}/features?user_group={a_user_group}&user_id={user_id}
This endpoint returns the enabled/disabled status (based on the passed URL parameters) for all feature flags for a given group within Bandiera.
The following curl requests would show the enabled/disabled status for all the features in the group "pubserv" (with the second example passing through a user_group
value of 'admin', and a user_id
value of '12345' to be considered when setting the status of a feature flag):
curl 'http://example.com/api/v2/groups/pubserv/features'
curl 'http://example.com/api/v2/groups/pubserv/features?user_group=admin&user_id=12345'
{
"response": {
"show-article-metrics": true,
"show-new-search": false
}
}
If you request information for a group that does not exist, Bandiera will return a default response (in this case an empty hash), along with a warning.
{
"response": { },
"warning": "This group does not exist in the Bandiera database."
}
If any of the flags within your requested group are configured to use User Groups or Percentage options, and you have not passed the required user_group
or user_id
params, these flags will most likely return false
(unless you provided one of the options, then this will be considered for the enabled
state), but it will also return a detailed warning.
{
"response": {
"show-article-metrics": false,
"show-new-search": false,
"show-subject-pages": false
},
"warning": "The following warnings were raised on this request:\n * these features have user groups configured and require a `user_group` param:\n - pubserv: show-new-search\n\n * these features have user percentages configured and require a `user_id` param:\n - pubserv: show-article-metrics\n\n"
}
- Home
- How Feature Flags Work
- Dos and Donts of Feature Flagging
- Client Libraries
- Developing Bandiera
- API Documentation
- API v2
- API v1 (deprecated)