-
Notifications
You must be signed in to change notification settings - Fork 0
API v2 Get the Enabled Status for a Feature
GET /v2/groups/{group_name}/features/{feature_name}
http://example.com/api/v2/groups/{group_name}/features/{feature_name}
http://example.com/api/v2/groups/{group_name}/features/{feature_name}?user_group={a_user_group}&user_id={a_user_id}
This endpoint returns the enabled/disabled status (based on the passed URL parameters) for a given feature.
The following curl requests would show the enabled/disabled status for the feature "show-article-metrics", 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 the feature flag):
curl 'http://example.com/api/v2/groups/pubserv/features/show-article-metrics'
curl 'http://example.com/api/v2/groups/pubserv/features/show-article-metrics?user_group=admin&user_id=12345'
{
"response": true
}
If you request information for a group or feature that does not exist, Bandiera will return a default response (in this case a false
value), along with a warning. For example:
When a group doesn't exist:
{
"response": false,
"warning": "This group does not exist in the Bandiera database."
}
When a feature doesn't exist:
{
"response": false,
"warning": "This feature does not exist in the Bandiera database."
}
If you request a user group based feature flag without providing a user_group
, Bandiera will return a default response (a false
value) along with a warning:
{
"response": false,
"warning": "This feature is configured for user groups - you must pass a user_group"
}
If you request a percentage based feature flag without providing a user_id
, Bandiera will return a default response (a false
value), along with a warning:
{
"response": false,
"warning": "This feature is configured for a % of users - you must pass a user_id"
}
- Home
- How Feature Flags Work
- Dos and Donts of Feature Flagging
- Client Libraries
- Developing Bandiera
- API Documentation
- API v2
- API v1 (deprecated)