Introduction

IBM Cloud App Configuration is a centralized feature management and configuration service for use with web and mobile applications, microservices, and distributed environments.

Instrument your applications with App Configuration SDKs, and use the App Configuration dashboard or App Configuration administrator API to define features flags, which are organized into collections and targeted to segments. Change feature flag states in the cloud to activate or deactivate features in your application or environment, often without restarting.

  • App Owners - Roll out features by segment and independent from code deployments.
  • Developers - Reduce source code branch complexity and troublesome merges by including untested or unfinished features behind a feature flag in your master branch.
  • Testers - Increase confidence that new features will smoothly transition to production by testing there. Use flags to activate untested features only for testers and QA personnel until it's time to release.

Before you begin

SDKs

For more information about installation and technical concepts, see the 'README' document in the SDK.

Table 1. List of App Configuration server, client, and admin SDKs
Server SDKs Client SDKs Admin SDKs
Node SDK
Documentation
Android SDK
Documentation
Go Admin SDK
Python SDK
Documentation
     
Go SDK
Documentation
     
Java SDK
Documentation
     

The code examples on this tab use the IBM Cloud App Configuration admin SDK for Go.

Installation

 go get -u github.com/IBM/appconfiguration-go-admin-sdk

For more installation options, view this project in GitHub.

Endpoints URLs

App Configuration provides different APIs that you can use to create and work with your Node.js microservice apps. The API endpoint determines where your App Configuration actions run and where your app data is stored. By default, all information that is stored in App Configuration is encrypted in transit and at rest. To ensure disaster recovery, your data is replicated to another location within the same geography. Make sure that your data can be stored in these regions before you start to App Configuration.

Endpoints by region

The following table contains the base URLs for the App Configuration API endpoints. When you call the API, use the URL that corresponds to the region where your service instance is deployed. Add the path for each method to form the complete API endpoint for your requests.

Location API endpoint Location where App Configuration actions run Data is stored in Data is replicated to
Dallas Public: https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid} All App Configuration actions run in the Dallas (us-south) location. All metadata for the app's features are stored in the Dallas (us-south) location. Data is replicated between three zones within us-south for high-availability.
London Public: https://eu-gb.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid} All App Configuration actions run in the London (eu-gb) location. All metadata for the app's features are stored in the London (eu-gb) location. Data is replicated between three zones within eu-gb for high-availability.
Sydney Public: https://au-syd.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid} All App Configuration actions run in the Sydney (au-syd) location. All metadata for the app's features are stored in the Sydney (au-syd) location. Data is replicated between three zones within au-syd for high-availability.

Example request to a Dallas endpoint:

curl -H "Authorization:Bearer {token}" -X  "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}"

Replace {token} in this example with the values for your particular API call.

Endpoint URL

https://{region}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}

Authentication

The App Configuration API uses IBM Cloud Identity and Access Management (IAM) to authenticate requests.

To work with the API, authenticate your application or service by including your IBM Cloud IAM access token in API requests.

To call each method, you need to be assigned a role that includes the required IAM actions. Each method lists the associated action. For more information about IAM actions and how they map to roles, see Managing access for App Configuration.

IAM authentication. Replace {token} and {url}/{method} with your service credentials.

curl -H "Authorization:Bearer {token}" -X "{url}/{method}"

Authorization: Bearer {token}

For example, if the token is tzLbqWhyALQawBg5TjRIf5sAznhrKQyvBFFaZbtF60m5 in the service credentials, include the credentials in your call like this:

curl -H "Authorization:Bearer {tzLbqWhyALQawBg5TjRIf5sAznhrKQyvBFFaZbtF60m5}" -X "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}"

Example that initializes the SDK programmatically.

import (
    "encoding/json"
    "fmt"
    "github.com/IBM/go-sdk-core/v5/core"
    ac "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
)

func main() {

    appconfigurationApi, err := ac.NewAppConfigurationV1(&ac.AppConfigurationV1Options {
        URL: "{url}",
        Authenticator: &core.IamAuthenticator {
            ApiKey: "{apikey}",
        },
    })

    if err != nil {
        panic(err)
    }
}

Replace {apikey} with your IBM Cloud API key. Replace {url} with the endpoint URL for your instance.

Authorization

App Configuration uses service access roles in Identity and Access Management (IAM) to determine the permissions that you have in App Configuration. For more information about required permissions, see Managing user access.

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 2xx response always indicates success. A 4xx type response is some sort of failure, and a 5xx type response usually indicates an internal system error.

HTTP status code Description Recovery
200 Success The request was successful.
201 Success The resource was successfully created and added to your IBM Cloud account.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to access the apps. Check that you have the correct access credentials and permissions.
404 Not Found The requested resource could not be found.
408 Request timeout The connection to the server timed out. Wait a few minutes, then try again.
409 Conflict The entity is already in the requested state.
429 Too Many Requests Too many requests have been made within a time window. Wait before calling the API again.
500 Internal Server Error IBM Cloud App Configuration is not available. Your request could not be processed. Wait a few minutes and try again. If you still encounter this problem, note the incident ID and contact IBM Cloud support.
503 Service Temporarily Unavailable IBM Cloud App Configuration could not process the request, due to a temporary overloading or maintenance. Try to reduce your request rate, or retry after a few minutes. If the error persists, contact IBM Cloud support.

Example error handling

import "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"

// Instantiate a service
appconfigurationApi, err := appconfigurationv1.NewAppConfigurationV1(options)

// Check for errors
if err != nil {
  panic(err)
}

// Call a method
result, response, err := appconfigurationApi.MethodName(&methodOptions)

// Check for errors
if err != nil {
  panic(err)
}

Versioning

API requests require a major version in the path (/v1/). {: curl}

Methods

Get list of Environments

List all the environments in the App Configuration service instance.

List all the environments in the App Configuration service instance.

GET /environments
(appConfiguration *AppConfigurationV1) ListEnvironments(listEnvironmentsOptions *ListEnvironmentsOptions) (result *EnvironmentList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListEnvironmentsWithContext(ctx context.Context, listEnvironmentsOptions *ListEnvironmentsOptions) (result *EnvironmentList, response *core.DetailedResponse, err error)

Request

Instantiate the ListEnvironmentsOptions struct and set the fields to provide parameter values for the ListEnvironments method.

Query Parameters

  • If set to true, returns expanded view of the resource details.

  • Sort the environment details based on the specified attribute.

    Allowable values: [created_time,updated_time,environment_id]

  • Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.

    Example: version 1.1, pre-release

  • Include feature and property details in the response.

    Allowable values: [features,properties]

  • The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use limit with offset to page through the available records.

    Constraints: 1 ≤ value ≤ 100

    Default: 10

  • The number of records to skip. By specifying offset, you retrieve a subset of items that starts with the offset value. Use offset with limit to page through the available records.

    Constraints: value ≥ 0

    Default: 0

WithContext method only

The ListEnvironments options.

  • curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments?expand=true' --header 'Authorization: Bearer {TOKEN}' 
    
  • listEnvironmentsOptionsModel := appConfigurationServiceInstance.NewListEnvironmentsOptions() 
     result, response, err := appConfigurationServiceInstance.ListEnvironments(listEnvironmentsOptionsModel)

Response

List of all environments.

List of all environments.

Examples:
View

Status Code

  • Successfully listed the environments.

  • Bad request. Verify that the information in the request body is complete and correct.

Example responses
  • {
      "environments": [
        {
          "name": "Dev environment",
          "environment_id": "dev-environment",
          "description": "Dev environment description",
          "tags": "development",
          "color_code": "#FDD13A",
          "created_time": "2021-05-12T23:20:50.52Z",
          "updated_time": "2021-05-12T23:20:50.52Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0"
      }
    }
  • {
      "environments": [
        {
          "name": "Dev environment",
          "environment_id": "dev-environment",
          "description": "Dev environment description",
          "tags": "development",
          "color_code": "#FDD13A",
          "created_time": "2021-05-12T23:20:50.52Z",
          "updated_time": "2021-05-12T23:20:50.52Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0"
      }
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the environments."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the environments."
    }

Create Environment

Create an environment.

Create an environment.

POST /environments
(appConfiguration *AppConfigurationV1) CreateEnvironment(createEnvironmentOptions *CreateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateEnvironmentWithContext(ctx context.Context, createEnvironmentOptions *CreateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)

Request

Instantiate the CreateEnvironmentOptions struct and set the fields to provide parameter values for the CreateEnvironment method.

Request to create Environment

Examples:
View

WithContext method only

The CreateEnvironment options.

  • curl --request POST --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{ "name": <ENVIRONMENT_NAME>, "environment_id": <ENVIRONMENT_ID>, "description": "test", "tags" : "test" }'
  • createEnvironmentOptionsModel := appConfigurationServiceInstance.NewCreateEnvironmentOptions(name, environmentId) 
     createEnvironmentOptionsModel.SetDescription(description) 
     createEnvironmentOptionsModel.SetTags(tags) 
     createEnvironmentOptionsModel.SetColorCode(colorCode) 
     result, response, err := appConfigurationServiceInstance.CreateEnvironment(createEnvironmentOptionsModel)

Response

Details of the environment.

Details of the environment.

Examples:
View

Status Code

  • Successfully created the environment.

  • Bad request. Verify that the information in the request body is complete and correct.

Example responses
  • {
      "name": "Dev environment",
      "environment_id": "dev-environment",
      "description": "Dev environment description",
      "tags": "development",
      "color_code": "#FDD13A",
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
    }
  • {
      "name": "Dev environment",
      "environment_id": "dev-environment",
      "description": "Dev environment description",
      "tags": "development",
      "color_code": "#FDD13A",
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while creating the environment."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while creating the environment."
    }

Update Environment

Update an environment.

Update an environment.

PUT /environments/{environment_id}
(appConfiguration *AppConfigurationV1) UpdateEnvironment(updateEnvironmentOptions *UpdateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateEnvironmentWithContext(ctx context.Context, updateEnvironmentOptions *UpdateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)

Request

Instantiate the UpdateEnvironmentOptions struct and set the fields to provide parameter values for the UpdateEnvironment method.

Path Parameters

  • Environment Id

Request body to update environment

Examples:
View

WithContext method only

The UpdateEnvironment options.

  • curl --request PUT --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{ "name": <ENVIRONMENT_NAME>, "description": "test", "tags" : "test" }'
  • updateEnvironmentOptionsModel := appConfigurationServiceInstance.NewUpdateEnvironmentOptions(environmentId) 
     updateEnvironmentOptionsModel.SetName(name) 
     updateEnvironmentOptionsModel.SetDescription(description) 
     updateEnvironmentOptionsModel.SetTags(tags) 
     updateEnvironmentOptionsModel.SetColorCode(colorCode) 
     result, response, err := appConfigurationServiceInstance.UpdateEnvironment(updateEnvironmentOptionsModel)

Response

Details of the environment.

Details of the environment.

Examples:
View

Status Code

  • Successfully updated the environment details.

  • Bad request. Verify that the information in the request body is complete and correct.

  • Not Found. Verify that the environment id is correct.

Example responses
  • {
      "name": "Dev environment",
      "environment_id": "dev-environment",
      "description": "Dev environment description",
      "tags": "development",
      "color_code": "#FDD13A",
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
    }
  • {
      "name": "Dev environment",
      "environment_id": "dev-environment",
      "description": "Dev environment description",
      "tags": "development",
      "color_code": "#FDD13A",
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the environment."
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the environment."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the environment. The queried resource 'Environment' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the environment. The queried resource 'Environment' is not available on the server."
    }

Get Environment

Retrieve the details of the environment.

Retrieve the details of the environment.

GET /environments/{environment_id}
(appConfiguration *AppConfigurationV1) GetEnvironment(getEnvironmentOptions *GetEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetEnvironmentWithContext(ctx context.Context, getEnvironmentOptions *GetEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)

Request

Instantiate the GetEnvironmentOptions struct and set the fields to provide parameter values for the GetEnvironment method.

Path Parameters

  • Environment Id

Query Parameters

  • If set to true, returns expanded view of the resource details.

  • Include feature and property details in the response.

    Allowable values: [features,properties]

WithContext method only

The GetEnvironment options.

  • curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}?expand=true' --header 'Authorization: Bearer {TOKEN}' 
    
  • getEnvironmentOptionsModel := appConfigurationServiceInstance.NewGetEnvironmentOptions(environmentId) 
     result, response, err := appConfigurationServiceInstance.GetEnvironment(getEnvironmentOptionsModel)

Response

Details of the environment.

Details of the environment.

Examples:
View

Status Code

  • Successfully retrieved the environment details.

  • Not Found. Verify that the environment id is correct.

Example responses
  • {
      "name": "Dev environment",
      "environment_id": "dev-environment",
      "description": "Dev environment description",
      "tags": "development",
      "color_code": "#FDD13A",
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
    }
  • {
      "name": "Dev environment",
      "environment_id": "dev-environment",
      "description": "Dev environment description",
      "tags": "development",
      "color_code": "#FDD13A",
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment"
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while retrieving the environment. The queried resource 'Environment' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while retrieving the environment. The queried resource 'Environment' is not available on the server."
    }

Delete Environment

Delete an Environment.

Delete an Environment.

DELETE /environments/{environment_id}
(appConfiguration *AppConfigurationV1) DeleteEnvironment(deleteEnvironmentOptions *DeleteEnvironmentOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteEnvironmentWithContext(ctx context.Context, deleteEnvironmentOptions *DeleteEnvironmentOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteEnvironmentOptions struct and set the fields to provide parameter values for the DeleteEnvironment method.

Path Parameters

  • Environment Id

WithContext method only

The DeleteEnvironment options.

  • curl --request DELETE --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}' --header 'Authorization: Bearer {TOKEN}' 
    
  • deleteEnvironmentOptionsModel := appConfigurationServiceInstance.NewDeleteEnvironmentOptions(environmentId) 
     response, err := appConfigurationServiceInstance.DeleteEnvironment(deleteEnvironmentOptionsModel)

Response

Status Code

  • Successfully deleted the specified environment.

  • Bad request. Ensure that at least one environment should exist in the instance.

  • Not Found. Verify that the environment id is correct.

Example responses
  • {
      "code": "FTEC1008E",
      "message": "Error while deleting the environment."
    }
  • {
      "code": "FTEC1008E",
      "message": "Error while deleting the environment."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while deleting the environment. The queried resource 'Environment' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while deleting the environment. The queried resource 'Environment' is not available on the server."
    }

Get list of Collections

List of all the collections in the App Configuration service instance.

List of all the collections in the App Configuration service instance.

GET /collections
(appConfiguration *AppConfigurationV1) ListCollections(listCollectionsOptions *ListCollectionsOptions) (result *CollectionList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListCollectionsWithContext(ctx context.Context, listCollectionsOptions *ListCollectionsOptions) (result *CollectionList, response *core.DetailedResponse, err error)

Request

Instantiate the ListCollectionsOptions struct and set the fields to provide parameter values for the ListCollections method.

Query Parameters

  • If set to true, returns expanded view of the resource details.

  • Sort the collection details based on the specified attribute.

    Allowable values: [created_time,updated_time,collection_id]

  • Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.

    Example: version 1.1, pre-release

  • Filter collections by a list of comma separated features.

  • Filter collections by a list of comma separated properties.

  • Include feature and property details in the response.

    Allowable values: [features,properties]

  • The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use limit with offset to page through the available records.

    Constraints: 1 ≤ value ≤ 100

    Default: 10

  • The number of records to skip. By specifying offset, you retrieve a subset of items that starts with the offset value. Use offset with limit to page through the available records.

    Constraints: value ≥ 0

    Default: 0

WithContext method only

The ListCollections options.

  • curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections?expand=true&include=features,properties' --header 'Authorization: Bearer {TOKEN}' 
    
  • listCollectionsOptionsModel := appConfigurationServiceInstance.NewListCollectionsOptions() 
     listCollectionsOptionsModel.SetExpand(true) 
     result, response, err := appConfigurationServiceInstance.ListCollections(listCollectionsOptionsModel)

Response

List of all Collections

List of all Collections.

Examples:
View

Status Code

  • Successfully listed the collections.

  • Bad request. Verify that the information in the request body is complete and correct.

Example responses
  • {
      "collections": [
        {
          "name": "GHz India Pvt Ltd",
          "collection_id": "ghzindiapvtltd",
          "description": "Collection for GHz Inc",
          "tags": "version: 1.1, pre-release",
          "created_time": "2020-01-09T00:16:07Z",
          "updated_time": "2020-03-09T12:16:07Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd",
          "features": [
            {
              "feature_id": "cycle-rentals",
              "name": "Cycle Rentals"
            },
            {
              "feature_id": "discountRate",
              "name": "Discount Rate"
            },
            {
              "feature_id": "longDistanceLimit",
              "name": "Long Distance Limit"
            }
          ],
          "properties": [
            {
              "property_id": "bigbillionday",
              "name": "BigBillionDay"
            },
            {
              "property_id": "newyear",
              "name": "NewYear"
            }
          ],
          "features_count": 3,
          "properties_count": 2
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0"
      }
    }
  • {
      "collections": [
        {
          "name": "GHz India Pvt Ltd",
          "collection_id": "ghzindiapvtltd",
          "description": "Collection for GHz Inc",
          "tags": "version: 1.1, pre-release",
          "created_time": "2020-01-09T00:16:07Z",
          "updated_time": "2020-03-09T12:16:07Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd",
          "features": [
            {
              "feature_id": "cycle-rentals",
              "name": "Cycle Rentals"
            },
            {
              "feature_id": "discountRate",
              "name": "Discount Rate"
            },
            {
              "feature_id": "longDistanceLimit",
              "name": "Long Distance Limit"
            }
          ],
          "properties": [
            {
              "property_id": "bigbillionday",
              "name": "BigBillionDay"
            },
            {
              "property_id": "newyear",
              "name": "NewYear"
            }
          ],
          "features_count": 3,
          "properties_count": 2
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0"
      }
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the collections."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the collections."
    }

Create Collection

Create a collection.

Create a collection.

POST /collections
(appConfiguration *AppConfigurationV1) CreateCollection(createCollectionOptions *CreateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateCollectionWithContext(ctx context.Context, createCollectionOptions *CreateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)

Request

Instantiate the CreateCollectionOptions struct and set the fields to provide parameter values for the CreateCollection method.

Request to create Collection

Examples:
View

WithContext method only

The CreateCollection options.

  • curl --request POST --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name": <COLLECTION-NAME>,"collection_id": <COLLECTION-ID>,"description": <COLLECTION-DESCRIPTION>,"tags": <COLLECTION-TAGS>}'
  • createCollectionOptionsModel := appConfigurationServiceInstance.NewCreateCollectionOptions(name, collectionId) 
     createCollectionOptionsModel.SetDescription(description) 
     createCollectionOptionsModel.SetTags(tags) 
     result, response, err := appConfigurationServiceInstance.CreateCollection(createCollectionOptionsModel)

Response

Details of the collection.

Details of the collection.

Examples:
View

Status Code

  • Successfully created the collection.

  • Bad request. Verify that the information in the request body is complete and correct.

Example responses
  • {
      "name": "GHz India Pvt Ltd",
      "collection_id": "ghzindiapvtltd",
      "description": "Collection for GHz Inc",
      "tags": "version: 1.1, pre-release",
      "created_time": "2020-01-09T00:16:07Z",
      "updated_time": "2020-03-09T12:16:07Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd"
    }
  • {
      "name": "GHz India Pvt Ltd",
      "collection_id": "ghzindiapvtltd",
      "description": "Collection for GHz Inc",
      "tags": "version: 1.1, pre-release",
      "created_time": "2020-01-09T00:16:07Z",
      "updated_time": "2020-03-09T12:16:07Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd"
    }
  • {
      "code": "FTEC1003E",
      "message": "Error while creating the collection."
    }
  • {
      "code": "FTEC1003E",
      "message": "Error while creating the collection."
    }

Update Collection

Update the collection name, tags and description. Collection Id cannot be updated.

Update the collection name, tags and description. Collection Id cannot be updated.

PUT /collections/{collection_id}
(appConfiguration *AppConfigurationV1) UpdateCollection(updateCollectionOptions *UpdateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateCollectionWithContext(ctx context.Context, updateCollectionOptions *UpdateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)

Request

Instantiate the UpdateCollectionOptions struct and set the fields to provide parameter values for the UpdateCollection method.

Path Parameters

  • Collection Id of the collection

Request body of the update collection request

Examples:
View

WithContext method only

The UpdateCollection options.

  • curl --request PUT --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections/{COLLECTION_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name": <COLLECTION-NAME>,"description": <COLLECTION-DESCRIPTION>,"tags": <COLLECTION-TAGS>}'
  • updateCollectionOptionsModel := appConfigurationServiceInstance.NewUpdateCollectionOptions(collectionId) 
     updateCollectionOptionsModel.SetName(name) 
     updateCollectionOptionsModel.SetTags(tags) 
     updateCollectionOptionsModel.SetDescription(description) 
     result, response, err := appConfigurationServiceInstance.UpdateCollection(updateCollectionOptionsModel)

Response

Details of the collection.

Details of the collection.

Examples:
View

Status Code

  • Successfully updated the collection details.

  • Bad request. Verify that the information in the request body is complete and correct.

  • Not Found. Verify that the collection id is correct.

Example responses
  • {
      "name": "GHz India Pvt Ltd",
      "collection_id": "ghzindiapvtltd",
      "description": "Collection for GHz Inc",
      "tags": "version: 1.1, pre-release",
      "created_time": "2020-01-09T00:16:07Z",
      "updated_time": "2020-03-09T12:16:07Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd"
    }
  • {
      "name": "GHz India Pvt Ltd",
      "collection_id": "ghzindiapvtltd",
      "description": "Collection for GHz Inc",
      "tags": "version: 1.1, pre-release",
      "created_time": "2020-01-09T00:16:07Z",
      "updated_time": "2020-03-09T12:16:07Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd"
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the collection."
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the collection."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the collection. The queried resource 'Collection' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the collection. The queried resource 'Collection' is not available on the server."
    }

Get Collection

Retrieve the details of the collection.

Retrieve the details of the collection.

GET /collections/{collection_id}
(appConfiguration *AppConfigurationV1) GetCollection(getCollectionOptions *GetCollectionOptions) (result *Collection, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetCollectionWithContext(ctx context.Context, getCollectionOptions *GetCollectionOptions) (result *Collection, response *core.DetailedResponse, err error)

Request

Instantiate the GetCollectionOptions struct and set the fields to provide parameter values for the GetCollection method.

Path Parameters

  • Collection Id of the collection

Query Parameters

  • If set to true, returns expanded view of the resource details.

  • Include feature and property details in the response.

    Allowable values: [features,properties]

WithContext method only

The GetCollection options.

  • curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections/{COLLECTION_ID}?expand=true&include=features,properties' --header 'Authorization: Bearer {TOKEN}' 
    
  • getCollectionOptionsModel := appConfigurationServiceInstance.NewGetCollectionOptions(collectionId) 
     result, response, err := appConfigurationServiceInstance.GetCollection(getCollectionOptionsModel)

Response

Details of the collection.

Details of the collection.

Examples:
View

Status Code

  • Successfully retrieved the collection details.

  • Not Found. Verify that the collection id is correct.

Example responses
  • {
      "name": "GHz India Pvt Ltd",
      "collection_id": "ghzindiapvtltd",
      "description": "Collection for GHz Inc",
      "tags": "version: 1.1, pre-release",
      "created_time": "2020-01-09T00:16:07Z",
      "updated_time": "2020-03-09T12:16:07Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd",
      "features": [
        {
          "feature_id": "cycle-rentals",
          "name": "Cycle Rentals"
        },
        {
          "feature_id": "discountRate",
          "name": "Discount Rate"
        },
        {
          "feature_id": "longDistanceLimit",
          "name": "Long Distance Limit"
        }
      ],
      "properties": [
        {
          "property_id": "bigbillionday",
          "name": "BigBillionDay"
        },
        {
          "property_id": "newyearday",
          "name": "NewYearDay"
        }
      ],
      "features_count": 3,
      "properties_count": 2
    }
  • {
      "name": "GHz India Pvt Ltd",
      "collection_id": "ghzindiapvtltd",
      "description": "Collection for GHz Inc",
      "tags": "version: 1.1, pre-release",
      "created_time": "2020-01-09T00:16:07Z",
      "updated_time": "2020-03-09T12:16:07Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd",
      "features": [
        {
          "feature_id": "cycle-rentals",
          "name": "Cycle Rentals"
        },
        {
          "feature_id": "discountRate",
          "name": "Discount Rate"
        },
        {
          "feature_id": "longDistanceLimit",
          "name": "Long Distance Limit"
        }
      ],
      "properties": [
        {
          "property_id": "bigbillionday",
          "name": "BigBillionDay"
        },
        {
          "property_id": "newyearday",
          "name": "NewYearDay"
        }
      ],
      "features_count": 3,
      "properties_count": 2
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while retrieving the collection. The queried resource 'Collection' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while retrieving the collection. The queried resource 'Collection' is not available on the server."
    }

Delete Collection

Delete the collection.

Delete the collection.

DELETE /collections/{collection_id}
(appConfiguration *AppConfigurationV1) DeleteCollection(deleteCollectionOptions *DeleteCollectionOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteCollectionWithContext(ctx context.Context, deleteCollectionOptions *DeleteCollectionOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteCollectionOptions struct and set the fields to provide parameter values for the DeleteCollection method.

Path Parameters

  • Collection Id of the collection

WithContext method only

The DeleteCollection options.

  • curl --request DELETE --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections/{COLLECTION_ID}' --header 'Authorization: Bearer {TOKEN}' 
    
  • deleteCollectionOptionsModel := appConfigurationServiceInstance.NewDeleteCollectionOptions(collectionId) 
     response, err := appConfigurationServiceInstance.DeleteCollection(deleteCollectionOptionsModel)

Response

Status Code

  • Successfully deleted the specified collection.

  • Not Found. Verify that the collection id is correct.

Example responses
  • {
      "code": "FTEC1000E",
      "message": "Error while deleting the collection. The queried resource 'Collection' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while deleting the collection. The queried resource 'Collection' is not available on the server."
    }

Get list of Features

List all the feature flags in the specified environment.

List all the feature flags in the specified environment.

GET /environments/{environment_id}/features
(appConfiguration *AppConfigurationV1) ListFeatures(listFeaturesOptions *ListFeaturesOptions) (result *FeaturesList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListFeaturesWithContext(ctx context.Context, listFeaturesOptions *ListFeaturesOptions) (result *FeaturesList, response *core.DetailedResponse, err error)

Request

Instantiate the ListFeaturesOptions struct and set the fields to provide parameter values for the ListFeatures method.

Path Parameters

  • Environment Id

Query Parameters

  • If set to true, returns expanded view of the resource details.

  • Sort the feature details based on the specified attribute.

    Allowable values: [created_time,updated_time,feature_id]

  • Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.

    Example: version 1.1, pre-release

  • Filter features by a list of comma separated collections.

  • Filter features by a list of comma separated segments.

  • Include the associated collections or targeting rules details in the response.

    Allowable values: [collections, rules]

  • The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use limit with offset to page through the available records.

    Constraints: 1 ≤ value ≤ 100

    Default: 10

  • The number of records to skip. By specifying offset, you retrieve a subset of items that starts with the offset value. Use offset with limit to page through the available records.

    Constraints: value ≥ 0

    Default: 0

WithContext method only

The ListFeatures options.

  • curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features' --header 'Authorization: Bearer {TOKEN}' 
    
  • listFeaturesOptionsModel := appConfigurationServiceInstance.NewListFeaturesOptions(environmentId) 
     result, response, err := appConfigurationServiceInstance.ListFeatures(listFeaturesOptionsModel)

Response

List of all features

List of all features.

Examples:
View

Status Code

  • Successfully listed all the features.

  • Bad request. Verify that the information in the request body is complete and correct.

Example responses
  • {
      "features": [
        {
          "name": "Cycle Rentals",
          "feature_id": "cycle-rentals",
          "description": "Feature flags to enable Cycle Rentals",
          "type": "BOOLEAN",
          "enabled_value": true,
          "disabled_value": false,
          "tags": "version: 1.1, pre-release",
          "segment_rules": [
            {
              "rules": [
                {
                  "segments": [
                    "betausers"
                  ]
                }
              ],
              "value": 25,
              "order": 1
            }
          ],
          "segment_exists": true,
          "collections": [
            {
              "collection_id": "web-app-collection"
            },
            {
              "collection_id": "mobile-app-collection"
            }
          ],
          "created_time": "2020-06-09T00:16:07Z",
          "updated_time": "2020-06-09T12:16:07Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0"
      }
    }
  • {
      "features": [
        {
          "name": "Cycle Rentals",
          "feature_id": "cycle-rentals",
          "description": "Feature flags to enable Cycle Rentals",
          "type": "BOOLEAN",
          "enabled_value": true,
          "disabled_value": false,
          "tags": "version: 1.1, pre-release",
          "segment_rules": [
            {
              "rules": [
                {
                  "segments": [
                    "betausers"
                  ]
                }
              ],
              "value": 25,
              "order": 1
            }
          ],
          "segment_exists": true,
          "collections": [
            {
              "collection_id": "web-app-collection"
            },
            {
              "collection_id": "mobile-app-collection"
            }
          ],
          "created_time": "2020-06-09T00:16:07Z",
          "updated_time": "2020-06-09T12:16:07Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0"
      }
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the features."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the features."
    }

Create Feature

Create a feature flag

Create a feature flag.

POST /environments/{environment_id}/features
(appConfiguration *AppConfigurationV1) CreateFeature(createFeatureOptions *CreateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateFeatureWithContext(ctx context.Context, createFeatureOptions *CreateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)

Request

Instantiate the CreateFeatureOptions struct and set the fields to provide parameter values for the CreateFeature method.

Path Parameters

  • Environment Id

Request to create feature flag

Examples:
View

WithContext method only

The CreateFeature options.

  • curl --request POST --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name":<FEATURE_NAME>,"feature_id":<FEATURE_ID>,"description":<FEATURE_DESCRIPTION>,"type":"BOOLEAN","enabled_value":true,"disabled_value":false,"tags":"version: 1.1, pre-release","segment_rules":[{"rules":[{"segments":["betausers","premiumusers"]}],"value":true,"order":1},{"rules":[{"segments":["freeusers"]}],"value":false,"order":2}],"collections":[{"collection_id":"ghzinc"},{"collection_id":"phzsystems"},{"collection_id":"ghzglobal"}],"enabled":true}'
  • ruleArray, _ := appConfigurationServiceInstance.NewTargetSegments(segments) 
     segmentRuleArray, _ := appConfigurationServiceInstance.NewSegmentRule([]appconfigurationv1.TargetSegments{*ruleArray}, value, order) 
     collectionArray, _ := appConfigurationServiceInstance.NewCollectionRef(collectionId) 
     createFeatureOptionsModel := appConfigurationServiceInstance.NewCreateFeatureOptions(environmentId, name, id, typeOfFeature, enabledValue, disabledValue) 
     createFeatureOptionsModel.SetTags(tags) 
     createFeatureOptionsModel.SetDescription(description) 
     createFeatureOptionsModel.SetSegmentRules([]appconfigurationv1.SegmentRule{*segmentRuleArray}) 
     createFeatureOptionsModel.SetCollections([]appconfigurationv1.CollectionRef{*collectionArray}) 
     result, response, err := appConfigurationServiceInstance.CreateFeature(createFeatureOptionsModel)

Response

Details of the feature.

Details of the feature.

Examples:
View

Status Code

  • Successfully created the feature flag.

  • Bad request. . Verify that the information in the request body is complete and correct.

Example responses
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "code": "FTEC1003E",
      "message": "Error while creating the feature."
    }
  • {
      "code": "FTEC1003E",
      "message": "Error while creating the feature."
    }

Update Feature

Update a feature flag details

Update a feature flag details.

PUT /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) UpdateFeature(updateFeatureOptions *UpdateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateFeatureWithContext(ctx context.Context, updateFeatureOptions *UpdateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)

Request

Instantiate the UpdateFeatureOptions struct and set the fields to provide parameter values for the UpdateFeature method.

Path Parameters

  • Environment Id

  • Feature Id

Request body to the update feature

Examples:
View

WithContext method only

The UpdateFeature options.

  • curl --request PUT --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name":<FEATURE_NAME>,"description":<FEATURE_DESCRIPTION>,"type":"BOOLEAN","enabled_value":true,"disabled_value":false,"tags":"version: 1.1, pre-release","segment_rules":[{"rules":[{"segments":["betausers","premiumusers"]}],"value":true,"order":1},{"rules":[{"segments":["freeusers"]}],"value":false,"order":2}],"collections":[{"collection_id":"ghzinc"},{"collection_id":"phzsystems"},{"collection_id":"ghzglobal"}],"enabled":true}'
  • ruleArray, _ := appConfigurationServiceInstance.NewTargetSegments(segments) 
     segmentRuleArray, _ := appConfigurationServiceInstance.NewSegmentRule([]appconfigurationv1.TargetSegments{*ruleArray}, value, order) 
     collectionArray, _ := appConfigurationServiceInstance.NewCollectionRef(collectionId) 
     updateFeatureOptionsModel := appConfigurationServiceInstance.NewUpdateFeatureOptions(environmentId, id) 
     updateFeatureOptionsModel.SetName(name) 
     updateFeatureOptionsModel.SetDescription(description) 
     updateFeatureOptionsModel.SetTags(tags) 
     updateFeatureOptionsModel.SetDisabledValue(disabledValue) 
     updateFeatureOptionsModel.SetEnabledValue(enabledValue) 
     updateFeatureOptionsModel.SetSegmentRules([]appconfigurationv1.SegmentRule{*segmentRuleArray}) 
     updateFeatureOptionsModel.SetCollections([]appconfigurationv1.CollectionRef{*collectionArray}) 
     result, response, err := appConfigurationServiceInstance.UpdateFeature(updateFeatureOptionsModel)

Response

Details of the feature.

Details of the feature.

Examples:
View

Status Code

  • Successfully updated the feature flag details

  • Bad request. Verify that the information in the request body is complete and correct.

  • Not Found. Verify that the feature id is correct.

Example responses
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the feature."
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the feature."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server."
    }

Update Feature Values

Update the feature values. This method can be executed only by the writer role. This method allows the update of feature name, feature enabled_value, feature disabled_value, tags, description and feature segment rules, however this method does not allow toggling the feature flag and assigning feature to a collection.

Update the feature values. This method can be executed only by the writer role. This method allows the update of feature name, feature enabled_value, feature disabled_value, tags, description and feature segment rules, however this method does not allow toggling the feature flag and assigning feature to a collection.

PATCH /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) UpdateFeatureValues(updateFeatureValuesOptions *UpdateFeatureValuesOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateFeatureValuesWithContext(ctx context.Context, updateFeatureValuesOptions *UpdateFeatureValuesOptions) (result *Feature, response *core.DetailedResponse, err error)

Request

Instantiate the UpdateFeatureValuesOptions struct and set the fields to provide parameter values for the UpdateFeatureValues method.

Path Parameters

  • Environment Id

  • Feature Id

Request body to update feature values

Examples:
View

WithContext method only

The UpdateFeatureValues options.

  • curl --request PATCH --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name":<FEATURE_NAME>,"enabled_value":true,"disabled_value":false,"segment_rules":[{"rules":[{"segments":["betausers","premiumusers"]}],"value":true,"order":1},{"rules":[{"segments":["freeusers"]}],"value":false,"order":2}]}'
  • ruleArray, _ := appConfigurationServiceInstance.NewTargetSegments(segments) 
     segmentRuleArray, _ := appConfigurationServiceInstance.NewSegmentRule([]appconfigurationv1.TargetSegments{*ruleArray}, value, order) 
     patchFeatureOptionsModel := appConfigurationServiceInstance.NewUpdateFeatureValuesOptions(environmentId, id) 
     patchFeatureOptionsModel.SetName(name) 
     patchFeatureOptionsModel.SetDescription(description) 
     patchFeatureOptionsModel.SetTags(tags) 
     patchFeatureOptionsModel.SetDisabledValue(disabledValue) 
     patchFeatureOptionsModel.SetEnabledValue(enabledValue) 
     patchFeatureOptionsModel.SetSegmentRules([]appconfigurationv1.SegmentRule{*segmentRuleArray}) 
     result, response, err := appConfigurationServiceInstance.UpdateFeatureValues(patchFeatureOptionsModel)

Response

Details of the feature.

Details of the feature.

Examples:
View

Status Code

  • Successfully updated the feature values.

  • Bad request. Verify that the information in the request body is complete and correct.

  • Not Found. Verify that the feature id is correct.

Example responses
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the feature values."
    }
  • {
      "code": "FTEC1007E",
      "message": "Error while updating the feature values."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server."
    }

Get Feature

Retrieve details of a feature.

Retrieve details of a feature.

GET /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) GetFeature(getFeatureOptions *GetFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetFeatureWithContext(ctx context.Context, getFeatureOptions *GetFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)

Request

Instantiate the GetFeatureOptions struct and set the fields to provide parameter values for the GetFeature method.

Path Parameters

  • Environment Id

  • Feature Id

Query Parameters

  • Include the associated collections in the response.

    Allowable values: [collections]

WithContext method only

The GetFeature options.

  • curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}' --header 'Authorization: Bearer {TOKEN}' 
    
  • getFeatureOptionsModel := appConfigurationServiceInstance.NewGetFeatureOptions(environmentId, featureId) 
     result, response, err := appConfigurationServiceInstance.GetFeature(getFeatureOptionsModel)

Response

Details of the feature.

Details of the feature.

Examples:
View

Status Code

  • Successfully retrieved the feature details.

  • Not Found. Verify that the feature id is correct.

Example responses
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while retreiving the feature. The queried resource 'Feature' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while retreiving the feature. The queried resource 'Feature' is not available on the server."
    }

Delete Feature

Delete a feature flag

Delete a feature flag.

DELETE /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) DeleteFeature(deleteFeatureOptions *DeleteFeatureOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteFeatureWithContext(ctx context.Context, deleteFeatureOptions *DeleteFeatureOptions) (response *core.DetailedResponse, err error)

Request

Instantiate the DeleteFeatureOptions struct and set the fields to provide parameter values for the DeleteFeature method.

Path Parameters

  • Environment Id

  • Feature Id

WithContext method only

The DeleteFeature options.

  • curl --request DELETE --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}' --header 'Authorization: Bearer {TOKEN}' 
    
  • deleteFeatureOptionsModel := appConfigurationServiceInstance.NewDeleteFeatureOptions(environmentId, featureId) 
     response, err := appConfigurationServiceInstance.DeleteFeature(deleteFeatureOptionsModel)

Response

Status Code

  • Successfully deleted the specified feature.

  • Not Found. Verify that the feature id is correct.

Example responses
  • {
      "code": "FTEC1000E",
      "message": "Error while deleting the feature. The queried resource 'Feature' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while deleting the feature. The queried resource 'Feature' is not available on the server."
    }

Toggle Feature

Toggle a feature.

Toggle a feature.

PUT /environments/{environment_id}/features/{feature_id}/toggle
(appConfiguration *AppConfigurationV1) ToggleFeature(toggleFeatureOptions *ToggleFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ToggleFeatureWithContext(ctx context.Context, toggleFeatureOptions *ToggleFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)

Request

Instantiate the ToggleFeatureOptions struct and set the fields to provide parameter values for the ToggleFeature method.

Path Parameters

  • Environment Id

  • Feature Id

Request body to toggle a feature

Examples:
View

WithContext method only

The ToggleFeature options.

  • curl --request PUT --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}/toggle' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"enabled":true}'
  • toggleFeatureOptionsModel := appConfigurationServiceInstance.NewToggleFeatureOptions(environmentId, featureId) 
     toggleFeatureOptionsModel.SetEnabled(enableFlag) 
     result, response, err := appConfigurationServiceInstance.ToggleFeature(toggleFeatureOptionsModel)

Response

Details of the feature.

Details of the feature.

Examples:
View

Status Code

  • Successfully toggled the specified feature.

  • Bad request.

  • Not Found. Verify that the feature id is correct.

Example responses
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "name": "Cycle Rentals",
      "feature_id": "cycle-rentals",
      "description": "Feature flag to enable Cycle Rentals",
      "type": "BOOLEAN",
      "enabled_value": true,
      "disabled_value": false,
      "enabled": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals"
    }
  • {
      "code": "FTEC1000E",
      "message": "Error in toggle feature request."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error in toggle feature request."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while toggling the feature. The queried resource 'Feature' is not available on the server."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while toggling the feature. The queried resource 'Feature' is not available on the server."
    }

Get list of Properties

List all the properties in the specified environment.

List all the properties in the specified environment.

GET /environments/{environment_id}/properties
(appConfiguration *AppConfigurationV1) ListProperties(listPropertiesOptions *ListPropertiesOptions) (result *PropertiesList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListPropertiesWithContext(ctx context.Context, listPropertiesOptions *ListPropertiesOptions) (result *PropertiesList, response *core.DetailedResponse, err error)

Request

Instantiate the ListPropertiesOptions struct and set the fields to provide parameter values for the ListProperties method.

Path Parameters

  • Environment Id

Query Parameters

  • If set to true, returns expanded view of the resource details.

  • Sort the property details based on the specified attribute.

    Allowable values: [created_time,updated_time,property_id]

  • Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.

    Example: version 1.1, pre-release

  • Filter properties by a list of comma separated collections.

  • Filter properties by a list of comma separated segments.

  • Include the associated collections or targeting rules details in the response.

    Allowable values: [collections, rules]

  • The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use limit with offset to page through the available records.

    Constraints: 1 ≤ value ≤ 100

    Default: 10

  • The number of records to skip. By specifying offset, you retrieve a subset of items that starts with the offset value. Use offset with limit to page through the available records.

    Constraints: value ≥ 0

    Default: 0

WithContext method only

The ListProperties options.

  • curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/properties?expand=true&include=collections,rules' --header 'Authorization: Bearer {TOKEN}' 
    
  • listPropertiesOptionsModel := appConfigurationServiceInstance.NewListPropertiesOptions(environmentId) 
     result, response, err := appConfigurationServiceInstance.ListProperties(listPropertiesOptionsModel)

Response

List of all properties.

List of all properties.

Examples:
View

Status Code

  • Successfully listed all the properties.

  • Bad request. Verify that the information in the request body is complete and correct.

Example responses
  • {
      "properties": [
        {
          "name": "Email property",
          "property_id": "email-property",
          "description": "Property for email",
          "type": "BOOLEAN",
          "value": true,
          "tags": "version: 1.1, pre-release",
          "segment_rules": [
            {
              "rules": [
                {
                  "segments": [
                    "betausers",
                    "premiumusers"
                  ]
                }
              ],
              "value": true,
              "order": 1
            },
            {
              "rules": [
                {
                  "segments": [
                    "freeusers"
                  ]
                }
              ],
              "value": false,
              "order": 2
            }
          ],
          "segments_exists": true,
          "collections": [
            {
              "collection_id": "ghzinc"
            },
            {
              "collection_id": "phzsystems"
            },
            {
              "collection_id": "ghzglobal"
            }
          ],
          "created_time": "2021-05-12T23:20:50.52Z",
          "updated_time": "2021-05-12T23:20:50.52Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties/email-property"
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties?limit=10&offset=0"
      }
    }
  • {
      "properties": [
        {
          "name": "Email property",
          "property_id": "email-property",
          "description": "Property for email",
          "type": "BOOLEAN",
          "value": true,
          "tags": "version: 1.1, pre-release",
          "segment_rules": [
            {
              "rules": [
                {
                  "segments": [
                    "betausers",
                    "premiumusers"
                  ]
                }
              ],
              "value": true,
              "order": 1
            },
            {
              "rules": [
                {
                  "segments": [
                    "freeusers"
                  ]
                }
              ],
              "value": false,
              "order": 2
            }
          ],
          "segments_exists": true,
          "collections": [
            {
              "collection_id": "ghzinc"
            },
            {
              "collection_id": "phzsystems"
            },
            {
              "collection_id": "ghzglobal"
            }
          ],
          "created_time": "2021-05-12T23:20:50.52Z",
          "updated_time": "2021-05-12T23:20:50.52Z",
          "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties/email-property"
        }
      ],
      "limit": 10,
      "offset": 0,
      "total_count": 1,
      "first": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties?limit=10&offset=0"
      },
      "last": {
        "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties?limit=10&offset=0"
      }
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the properties."
    }
  • {
      "code": "FTEC1000E",
      "message": "Error while fetching the properties."
    }

Create Property

Create a Property

Create a Property.

POST /environments/{environment_id}/properties
(appConfiguration *AppConfigurationV1) CreateProperty(createPropertyOptions *CreatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreatePropertyWithContext(ctx context.Context, createPropertyOptions *CreatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)

Request

Instantiate the CreatePropertyOptions struct and set the fields to provide parameter values for the CreateProperty method.

Path Parameters

  • Environment Id

Request to create Property

Examples:
View

WithContext method only

The CreateProperty options.

  • curl --request POST --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/properties' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{ "name": <PROPERTY_NAME>, "property_id": <PROPERTY_ID>, "description": "testing prop", "value": true, "type": "BOOLEAN", "tags": "test", "segment_rules": [{ "rules": [ { "segments": [ "300" ] } ], "value": "$default", "order": "1" }], "collections":[{ "collection_id" : 100 }] }'
  • ruleArray, _ := appConfigurationServiceInstance.NewTargetSegments(segments) 
     segmentRuleArray, _ := appConfigurationServiceInstance.NewSegmentRule([]appconfigurationv1.TargetSegments{*ruleArray}, value, order) 
     collectionArray, _ := appConfigurationServiceInstance.NewCollectionRef(collectionId) 
     createPropertyOptionsModel := appConfigurationServiceInstance.NewCreatePropertyOptions(environmentId, name, propertyId, typeOfProperty, valueOfProperty) 
     createPropertyOptionsModel.SetTags(tags) 
     createPropertyOptionsModel.SetDescription(description) 
     createPropertyOptionsModel.SetSegmentRules([]appconfigurationv1.SegmentRule{*segmentRuleArray}) 
     createPropertyOptionsModel.SetCollections([]appconfigurationv1.CollectionRef{*collectionArray}) 
     result, response, err := appConfigurationServiceInstance.CreateProperty(createPropertyOptionsModel)

Response

Details of the property.

Details of the property.

Examples:
View

Status Code

  • Successfully created the property.

  • Bad request. Verify that the information in the request body is complete and correct.

Example responses
  • {
      "name": "Email property",
      "property_id": "email-property",
      "description": "Property for email",
      "type": "BOOLEAN",
      "value": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties/email-property"
    }
  • {
      "name": "Email property",
      "property_id": "email-property",
      "description": "Property for email",
      "type": "BOOLEAN",
      "value": true,
      "tags": "version: 1.1, pre-release",
      "segment_rules": [
        {
          "rules": [
            {
              "segments": [
                "betausers",
                "premiumusers"
              ]
            }
          ],
          "value": true,
          "order": 1
        },
        {
          "rules": [
            {
              "segments": [
                "freeusers"
              ]
            }
          ],
          "value": false,
          "order": 2
        }
      ],
      "segment_exists": true,
      "collections": [
        {
          "collection_id": "ghzinc",
          "name": "GHz Inc"
        },
        {
          "collection_id": "phzsystems",
          "name": "PHz Systems"
        },
        {
          "collection_id": "ghzglobal",
          "name": "GHz Global"
        }
      ],
      "created_time": "2021-05-12T23:20:50.52Z",
      "updated_time": "2021-05-12T23:20:50.52Z",
      "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties/email-property"
    }
  • {
      "code": "FTEC1003E",
      "message": "Error while creating the property."
    }
  • {
      "code": "FTEC1003E",
      "message": "Error while creating the property."
    }

Update Property

Update a Property.

Update a Property.

PUT /environments/{environment_id}/properties/{property_id}
(appConfiguration *AppConfigurationV1) UpdateProperty(updatePropertyOptions *UpdatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdatePropertyWithContext(ctx context.Context, updatePropertyOptions *UpdatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)

Request

Instantiate the UpdatePropertyOptions struct and set the fields to provide parameter values for the UpdateProperty method.

Path Parameters