-
Notifications
You must be signed in to change notification settings - Fork 18
Admin API Reference
In this section we will talk about APIs required for managing Feature Flags
The AAD Object ID (app context) or User UPN (user context) must be added as Administrator for the tenant in App Configuration.
Creates a feature toggle/flag
POST api/v1/featureflags
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
Flag resource
{
"name": "Name of the feature flag",
"description": "Some description about the feature flag",
"enabled": true | false,
"environment": "Environment Name",
"incrementalRingsEnabled": true | false (To keep all rings 1-n enabled when ring-n is enabled),
"conditions": {
"client_filters": [
{
"name": "Name of the filter",
"parameters": {
"operator": "Operator to be used for evaluating the flight context value and the configured value",
"value": "Configured Value against which evaluation will be done",
"isActive": "true | false",
"stageId": "ID of the stage/ring",
"stageName": "Name of the stage/ring",
"flightContextKey": "Key to be used from the flighting context object for matching against the configured value"
}
}
]
}
}
201 Status Code
Header | Value |
---|---|
201 | Success |
400 | Error in user input. Verify all the required headers |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
POST api/v1/featureflags
Headers:
- x-application: Demo_Tenant
- x-environment: Dev
Body
{
"name": "Demo-PB-Test-004-Refactored-Code",
"description": "FunctionalTestingflagDescription",
"enabled": true,
"environment": "dev",
"conditions": {
"client_filters": [
{
"name": "Country",
"parameters": {
"operator": "In",
"value": "India,UK,USA",
"isActive": "true",
"stageId": "0",
"stageName": "stg1",
"flightContextKey": "Country"
}
}
]
}
}
201
Updates an existing feature flag/toggle
PUT api/v1/featureflags
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
Updated flag resource
{
"name": "Name of the feature flag",
"description": "Some description about the feature flag",
"enabled": true | false,
"environment": "Environment Name",
"incrementalRingsEnabled": true | false (To keep all rings 1-n enabled when ring-n is enabled),
"conditions": {
"client_filters": [
{
"name": "Name of the filter",
"parameters": {
"operator": "Operator to be used for evaluating the flight context value and the configured value",
"value": "Configured Value against which evaluation will be done",
"isActive": "true | false",
"stageId": "ID of the stage/ring",
"stageName": "Name of the stage/ring",
"flightContextKey": "Key to be used from the flighting context object for matching against the configured value"
}
}
]
}
}
200 Status Code
Header | Value |
---|---|
200 | Success |
400 | Error in user input. Verify all the required headers and body |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
PUT api/v1/featureflags
Headers:
- x-application: Demo_Tenant
- x-environment: Dev
Body
{
"name": "Demo-PB-Test-004-Refactored-Code",
"description": "FunctionalTestingflagDescription",
"enabled": true,
"environment": "dev",
"conditions": {
"client_filters": [
{
"name": "Country",
"parameters": {
"operator": "In",
"value": "India,UK,USA",
"isActive": "true",
"stageId": "0",
"stageName": "stg1",
"flightContextKey": "Country"
}
}
]
}
}
200
Enables a disabled feature flag/toggle
PATCH api/v1/featureflags/{feature-flag-name}/enable
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
204 Status Code
Header | Value |
---|---|
204 | Success |
400 | Error in user input. Verify all the required headers and body |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
PATCH api/v1/featureflags/demo-feature-toggle/enable
Headers:
- x-application: Demo_Tenant
- x-environment: Dev
204
Disabled an enabled feature flag/toggle
PATCH api/v1/featureflags/{feature-flag-name}/disable
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
204 Status Code
Header | Value |
---|---|
204 | Success |
400 | Error in user input. Verify all the required headers and body |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
PATCH api/v1/featureflags/demo-feature-toggle/disable
Headers:
- x-application: Demo_Tenant
- x-environment: Dev
204
Activates the stage of a flag. All stages in the feature flag will be de-activated except the stage name passed in the route parameter. This API is used for promoting and rolling back rings.
PATCH api/v1/featureflags/{feature-flag-name}/activatestage/{stage-name}
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
204 Status Code
Header | Value |
---|---|
204 | Success |
400 | Error in user input. Verify all the required headers and body |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
PATCH api/v1/featureflags/demo-feature-toggle/activatestage/ring-2
Headers:
- x-application: Demo_Tenant
- x-environment: Dev
204
Deletes an existing feature flag/toggle
DELETE api/v1/featureflags/{feature-flag-name}
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
204 Status Code
Header | Value |
---|---|
204 | Success |
400 | Error in user input. Verify all the required headers and body |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
DELETE api/v1/featureflags/demo-feature-toggle
Headers:
- x-application: Demo_Tenant
- x-environment: Dev
204
Gets a feature flag by name
GET api/v1/featureflags/{feature-name}
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
Flag resource
{
"name": "Name of the feature flag",
"description": "Some description about the feature flag",
"enabled": true | false,
"environment": "Environment Name",
"conditions": {
"client_filters": [
{
"name": "Name of the filter",
"parameters": {
"operator": "Operator to be used for evaluating the flight context value and the configured value",
"value": "Configured Value against which evaluation will be done",
"isActive": "true | false",
"stageId": "ID of the stage/ring",
"stageName": "Name of the stage/ring",
"flightContextKey": "Key to be used from the flighting context object for matching against the configured value"
}
}
]
}
}
Header | Value |
---|---|
200 | Success |
400 | Error in user input. Verify all the required headers and body |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
api/v1/featureflags/Demo-1
Headers:
- x-application: Demo_Tenant
- x-environment: Dev
{
"name": "Demo-PB-Test-004-Refactored-Code",
"description": "FunctionalTestingflagDescription",
"enabled": true,
"environment": "dev",
"conditions": {
"client_filters": [
{
"name": "Country",
"parameters": {
"operator": "In",
"value": "India,UK,USA",
"isActive": "true",
"stageId": "0",
"stageName": "stg1",
"flightContextKey": "Country"
}
}
]
}
}
Gets all the feature flags/toggles for the given tenant
GET api/v1/featureflags
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
X-Environment | Name of the environment. Required | Read more |
Flag collection
Header | Value |
---|---|
200 | Success |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
Gets all the filters configured for a tenant
GET api/v1/configuration/filters
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
List of filter names
Header | Value |
---|---|
200 | Success |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
GET api/v1/configuration/filters
Headers:
- x-application: Demo_Tenant
[
"Alias",
"RoleGroup",
"Date",
"Country",
"Region",
"Role",
"UserUpn",
"Generic",
"RulesEngine"
]
Gets the list of filters and operators allowed to operate on them
GET api/v1/configuration/filters/operators/map
Header | Value | More Details |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {token}. Required | AAD bearer token for the configured Resource ID in your tenant |
X-Application | Name of the tenant. Required | Read more |
Filters and the list of operators for each filter
Header | Value |
---|---|
200 | Success |
401 | Unauthorized (Issue with the bearer token) |
500 | Unhandled failure |
GET api/v1/configuration/filters/operators/map
Headers:
- x-application: Demo_Tenant
{
"Alias": [
"Equals",
"NotEquals",
"In",
"NotIn",
"LessThan",
"GreaterThan",
"MemberOfSecurityGroup",
"NotMemberOfSecurityGroup"
],
"RoleGroup": [
"Equals",
"NotEquals",
"In",
"NotIn",
"LessThan",
"GreaterThan"
],
"Date": [
"LessThan",
"GreaterThan"
],
"Country": [
"Equals",
"NotEquals",
"In",
"NotIn",
"LessThan",
"GreaterThan"
],
"Region": [
"Equals",
"NotEquals",
"In",
"NotIn",
"LessThan",
"GreaterThan"
],
"Role": [
"Equals",
"NotEquals",
"In",
"NotIn",
"LessThan",
"GreaterThan"
],
"UserUpn": [
"Equals",
"NotEquals",
"In",
"NotIn",
"LessThan",
"GreaterThan",
"MemberOfSecurityGroup",
"NotMemberOfSecurityGroup"
],
"Generic": [
"Equals",
"NotEquals",
"In",
"NotIn",
"LessThan",
"GreaterThan"
],
"RulesEngine": [
"Evaluates",
"NotEvaluates"
]
}