Flagent API

Constraint

createConstraint

Create constraint

Create a constraint for the segment. Constraints define conditions that must be met for a segment to match.


/flags/{flagId}/segments/{segmentId}/constraints

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}/constraints"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ConstraintApi;

import java.io.File;
import java.util.*;

public class ConstraintApiExample {

    public static void main(String[] args) {
        
        ConstraintApi apiInstance = new ConstraintApi();
        CreateConstraintRequest body = {
  "property" : "region",
  "operator" : "EQ",
  "value" : "US"
}; // CreateConstraintRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            Constraint result = apiInstance.createConstraint(body, flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#createConstraint");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ConstraintApi;

public class ConstraintApiExample {

    public static void main(String[] args) {
        ConstraintApi apiInstance = new ConstraintApi();
        CreateConstraintRequest body = {
  "property" : "region",
  "operator" : "EQ",
  "value" : "US"
}; // CreateConstraintRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            Constraint result = apiInstance.createConstraint(body, flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#createConstraint");
            e.printStackTrace();
        }
    }
}
CreateConstraintRequest *body = {
  "property" : "region",
  "operator" : "EQ",
  "value" : "US"
}; // 
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment

ConstraintApi *apiInstance = [[ConstraintApi alloc] init];

// Create constraint
[apiInstance createConstraintWith:body
    flagId:flagId
    segmentId:segmentId
              completionHandler: ^(Constraint output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.ConstraintApi()
var body = {
  "property" : "region",
  "operator" : "EQ",
  "value" : "US"
}; // {{CreateConstraintRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createConstraint(bodyflagIdsegmentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createConstraintExample
    {
        public void main()
        {

            var apiInstance = new ConstraintApi();
            var body = new CreateConstraintRequest(); // CreateConstraintRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment

            try
            {
                // Create constraint
                Constraint result = apiInstance.createConstraint(body, flagId, segmentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ConstraintApi.createConstraint: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiConstraintApi();
$body = {
  "property" : "region",
  "operator" : "EQ",
  "value" : "US"
}; // CreateConstraintRequest | 
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment

try {
    $result = $api_instance->createConstraint($body, $flagId, $segmentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConstraintApi->createConstraint: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ConstraintApi;

my $api_instance = WWW::SwaggerClient::ConstraintApi->new();
my $body = WWW::SwaggerClient::Object::CreateConstraintRequest->new(); # CreateConstraintRequest | 
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment

eval { 
    my $result = $api_instance->createConstraint(body => $body, flagId => $flagId, segmentId => $segmentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConstraintApi->createConstraint: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ConstraintApi()
body = {
  "property" : "region",
  "operator" : "EQ",
  "value" : "US"
} # CreateConstraintRequest | 
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment

try: 
    # Create constraint
    api_response = api_instance.create_constraint(body, flagId, segmentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConstraintApi->createConstraint: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Created constraint

Status: 400 - Bad request - invalid input data

Status: 404 - Flag or segment not found

Status: 500 - Internal server error


deleteConstraint

Delete constraint

Delete a constraint from the segment.


/flags/{flagId}/segments/{segmentId}/constraints/{constraintId}

Usage and SDK Samples

curl -X DELETE\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}/constraints/{constraintId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ConstraintApi;

import java.io.File;
import java.util.*;

public class ConstraintApiExample {

    public static void main(String[] args) {
        
        ConstraintApi apiInstance = new ConstraintApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        Long constraintId = 789; // Long | Numeric ID of the constraint
        try {
            apiInstance.deleteConstraint(flagId, segmentId, constraintId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#deleteConstraint");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ConstraintApi;

public class ConstraintApiExample {

    public static void main(String[] args) {
        ConstraintApi apiInstance = new ConstraintApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        Long constraintId = 789; // Long | Numeric ID of the constraint
        try {
            apiInstance.deleteConstraint(flagId, segmentId, constraintId);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#deleteConstraint");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment
Long *constraintId = 789; // Numeric ID of the constraint

ConstraintApi *apiInstance = [[ConstraintApi alloc] init];

// Delete constraint
[apiInstance deleteConstraintWith:flagId
    segmentId:segmentId
    constraintId:constraintId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.ConstraintApi()
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment
var constraintId = 789; // {{Long}} Numeric ID of the constraint

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteConstraint(flagId, segmentId, constraintId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteConstraintExample
    {
        public void main()
        {

            var apiInstance = new ConstraintApi();
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment
            var constraintId = 789;  // Long | Numeric ID of the constraint

            try
            {
                // Delete constraint
                apiInstance.deleteConstraint(flagId, segmentId, constraintId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ConstraintApi.deleteConstraint: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiConstraintApi();
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment
$constraintId = 789; // Long | Numeric ID of the constraint

try {
    $api_instance->deleteConstraint($flagId, $segmentId, $constraintId);
} catch (Exception $e) {
    echo 'Exception when calling ConstraintApi->deleteConstraint: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ConstraintApi;

my $api_instance = WWW::SwaggerClient::ConstraintApi->new();
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment
my $constraintId = 789; # Long | Numeric ID of the constraint

eval { 
    $api_instance->deleteConstraint(flagId => $flagId, segmentId => $segmentId, constraintId => $constraintId);
};
if ($@) {
    warn "Exception when calling ConstraintApi->deleteConstraint: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ConstraintApi()
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment
constraintId = 789 # Long | Numeric ID of the constraint

try: 
    # Delete constraint
    api_instance.delete_constraint(flagId, segmentId, constraintId)
except ApiException as e:
    print("Exception when calling ConstraintApi->deleteConstraint: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required
constraintId*
Long (int64)
Numeric ID of the constraint
Required

Responses

Status: 200 - Constraint deleted successfully

Status: 400 - Bad request - invalid IDs

Status: 404 - Flag, segment or constraint not found

Status: 500 - Internal server error


findConstraints

Get constraints for segment


/flags/{flagId}/segments/{segmentId}/constraints

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}/constraints"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ConstraintApi;

import java.io.File;
import java.util.*;

public class ConstraintApiExample {

    public static void main(String[] args) {
        
        ConstraintApi apiInstance = new ConstraintApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            array[Constraint] result = apiInstance.findConstraints(flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#findConstraints");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ConstraintApi;

public class ConstraintApiExample {

    public static void main(String[] args) {
        ConstraintApi apiInstance = new ConstraintApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            array[Constraint] result = apiInstance.findConstraints(flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#findConstraints");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment

ConstraintApi *apiInstance = [[ConstraintApi alloc] init];

// Get constraints for segment
[apiInstance findConstraintsWith:flagId
    segmentId:segmentId
              completionHandler: ^(array[Constraint] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.ConstraintApi()
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findConstraints(flagId, segmentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findConstraintsExample
    {
        public void main()
        {

            var apiInstance = new ConstraintApi();
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment

            try
            {
                // Get constraints for segment
                array[Constraint] result = apiInstance.findConstraints(flagId, segmentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ConstraintApi.findConstraints: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiConstraintApi();
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment

try {
    $result = $api_instance->findConstraints($flagId, $segmentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConstraintApi->findConstraints: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ConstraintApi;

my $api_instance = WWW::SwaggerClient::ConstraintApi->new();
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment

eval { 
    my $result = $api_instance->findConstraints(flagId => $flagId, segmentId => $segmentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConstraintApi->findConstraints: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ConstraintApi()
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment

try: 
    # Get constraints for segment
    api_response = api_instance.find_constraints(flagId, segmentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConstraintApi->findConstraints: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required

Responses

Status: 200 - Constraints under the segment

Status: 400 - Bad request - invalid flag ID or segment ID

Status: 404 - Flag or segment not found

Status: 500 - Internal server error


putConstraint

Update constraint


/flags/{flagId}/segments/{segmentId}/constraints/{constraintId}

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}/constraints/{constraintId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ConstraintApi;

import java.io.File;
import java.util.*;

public class ConstraintApiExample {

    public static void main(String[] args) {
        
        ConstraintApi apiInstance = new ConstraintApi();
        PutConstraintRequest body = {
  "property" : "region",
  "operator" : "IN",
  "value" : "US,CA,MX"
}; // PutConstraintRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        Long constraintId = 789; // Long | Numeric ID of the constraint
        try {
            Constraint result = apiInstance.putConstraint(body, flagId, segmentId, constraintId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#putConstraint");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ConstraintApi;

public class ConstraintApiExample {

    public static void main(String[] args) {
        ConstraintApi apiInstance = new ConstraintApi();
        PutConstraintRequest body = {
  "property" : "region",
  "operator" : "IN",
  "value" : "US,CA,MX"
}; // PutConstraintRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        Long constraintId = 789; // Long | Numeric ID of the constraint
        try {
            Constraint result = apiInstance.putConstraint(body, flagId, segmentId, constraintId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConstraintApi#putConstraint");
            e.printStackTrace();
        }
    }
}
PutConstraintRequest *body = {
  "property" : "region",
  "operator" : "IN",
  "value" : "US,CA,MX"
}; // 
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment
Long *constraintId = 789; // Numeric ID of the constraint

ConstraintApi *apiInstance = [[ConstraintApi alloc] init];

// Update constraint
[apiInstance putConstraintWith:body
    flagId:flagId
    segmentId:segmentId
    constraintId:constraintId
              completionHandler: ^(Constraint output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.ConstraintApi()
var body = {
  "property" : "region",
  "operator" : "IN",
  "value" : "US,CA,MX"
}; // {{PutConstraintRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment
var constraintId = 789; // {{Long}} Numeric ID of the constraint

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putConstraint(bodyflagIdsegmentIdconstraintId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putConstraintExample
    {
        public void main()
        {

            var apiInstance = new ConstraintApi();
            var body = new PutConstraintRequest(); // PutConstraintRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment
            var constraintId = 789;  // Long | Numeric ID of the constraint

            try
            {
                // Update constraint
                Constraint result = apiInstance.putConstraint(body, flagId, segmentId, constraintId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ConstraintApi.putConstraint: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiConstraintApi();
$body = {
  "property" : "region",
  "operator" : "IN",
  "value" : "US,CA,MX"
}; // PutConstraintRequest | 
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment
$constraintId = 789; // Long | Numeric ID of the constraint

try {
    $result = $api_instance->putConstraint($body, $flagId, $segmentId, $constraintId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConstraintApi->putConstraint: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ConstraintApi;

my $api_instance = WWW::SwaggerClient::ConstraintApi->new();
my $body = WWW::SwaggerClient::Object::PutConstraintRequest->new(); # PutConstraintRequest | 
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment
my $constraintId = 789; # Long | Numeric ID of the constraint

eval { 
    my $result = $api_instance->putConstraint(body => $body, flagId => $flagId, segmentId => $segmentId, constraintId => $constraintId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConstraintApi->putConstraint: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ConstraintApi()
body = {
  "property" : "region",
  "operator" : "IN",
  "value" : "US,CA,MX"
} # PutConstraintRequest | 
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment
constraintId = 789 # Long | Numeric ID of the constraint

try: 
    # Update constraint
    api_response = api_instance.put_constraint(body, flagId, segmentId, constraintId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConstraintApi->putConstraint: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required
constraintId*
Long (int64)
Numeric ID of the constraint
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Updated constraint

Status: 400 - Bad request - invalid input data

Status: 404 - Flag, segment or constraint not found

Status: 500 - Internal server error


Distribution

findDistributions

Get distributions for segment


/flags/{flagId}/segments/{segmentId}/distributions

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}/distributions"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DistributionApi;

import java.io.File;
import java.util.*;

public class DistributionApiExample {

    public static void main(String[] args) {
        
        DistributionApi apiInstance = new DistributionApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            array[Distribution] result = apiInstance.findDistributions(flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DistributionApi#findDistributions");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DistributionApi;

public class DistributionApiExample {

    public static void main(String[] args) {
        DistributionApi apiInstance = new DistributionApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            array[Distribution] result = apiInstance.findDistributions(flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DistributionApi#findDistributions");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment

DistributionApi *apiInstance = [[DistributionApi alloc] init];

// Get distributions for segment
[apiInstance findDistributionsWith:flagId
    segmentId:segmentId
              completionHandler: ^(array[Distribution] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.DistributionApi()
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findDistributions(flagId, segmentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findDistributionsExample
    {
        public void main()
        {

            var apiInstance = new DistributionApi();
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment

            try
            {
                // Get distributions for segment
                array[Distribution] result = apiInstance.findDistributions(flagId, segmentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DistributionApi.findDistributions: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDistributionApi();
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment

try {
    $result = $api_instance->findDistributions($flagId, $segmentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DistributionApi->findDistributions: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DistributionApi;

my $api_instance = WWW::SwaggerClient::DistributionApi->new();
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment

eval { 
    my $result = $api_instance->findDistributions(flagId => $flagId, segmentId => $segmentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DistributionApi->findDistributions: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DistributionApi()
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment

try: 
    # Get distributions for segment
    api_response = api_instance.find_distributions(flagId, segmentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DistributionApi->findDistributions: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required

Responses

Status: 200 - Distributions under the segment

Status: 400 - Bad request - invalid flag ID or segment ID

Status: 404 - Flag or segment not found

Status: 500 - Internal server error


putDistributions

Update distributions

Replace the distribution with the new setting. The sum of all percentages must equal 100.


/flags/{flagId}/segments/{segmentId}/distributions

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}/distributions"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DistributionApi;

import java.io.File;
import java.util.*;

public class DistributionApiExample {

    public static void main(String[] args) {
        
        DistributionApi apiInstance = new DistributionApi();
        PutDistributionsRequest body = {
  "distributions" : [ {
    "variantID" : 1,
    "variantKey" : "control",
    "percent" : 50
  }, {
    "variantID" : 2,
    "variantKey" : "treatment",
    "percent" : 50
  } ]
}; // PutDistributionsRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            array[Distribution] result = apiInstance.putDistributions(body, flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DistributionApi#putDistributions");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DistributionApi;

public class DistributionApiExample {

    public static void main(String[] args) {
        DistributionApi apiInstance = new DistributionApi();
        PutDistributionsRequest body = {
  "distributions" : [ {
    "variantID" : 1,
    "variantKey" : "control",
    "percent" : 50
  }, {
    "variantID" : 2,
    "variantKey" : "treatment",
    "percent" : 50
  } ]
}; // PutDistributionsRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            array[Distribution] result = apiInstance.putDistributions(body, flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DistributionApi#putDistributions");
            e.printStackTrace();
        }
    }
}
PutDistributionsRequest *body = {
  "distributions" : [ {
    "variantID" : 1,
    "variantKey" : "control",
    "percent" : 50
  }, {
    "variantID" : 2,
    "variantKey" : "treatment",
    "percent" : 50
  } ]
}; // 
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment

DistributionApi *apiInstance = [[DistributionApi alloc] init];

// Update distributions
[apiInstance putDistributionsWith:body
    flagId:flagId
    segmentId:segmentId
              completionHandler: ^(array[Distribution] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.DistributionApi()
var body = {
  "distributions" : [ {
    "variantID" : 1,
    "variantKey" : "control",
    "percent" : 50
  }, {
    "variantID" : 2,
    "variantKey" : "treatment",
    "percent" : 50
  } ]
}; // {{PutDistributionsRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putDistributions(bodyflagIdsegmentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putDistributionsExample
    {
        public void main()
        {

            var apiInstance = new DistributionApi();
            var body = new PutDistributionsRequest(); // PutDistributionsRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment

            try
            {
                // Update distributions
                array[Distribution] result = apiInstance.putDistributions(body, flagId, segmentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DistributionApi.putDistributions: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDistributionApi();
$body = {
  "distributions" : [ {
    "variantID" : 1,
    "variantKey" : "control",
    "percent" : 50
  }, {
    "variantID" : 2,
    "variantKey" : "treatment",
    "percent" : 50
  } ]
}; // PutDistributionsRequest | 
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment

try {
    $result = $api_instance->putDistributions($body, $flagId, $segmentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DistributionApi->putDistributions: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DistributionApi;

my $api_instance = WWW::SwaggerClient::DistributionApi->new();
my $body = WWW::SwaggerClient::Object::PutDistributionsRequest->new(); # PutDistributionsRequest | 
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment

eval { 
    my $result = $api_instance->putDistributions(body => $body, flagId => $flagId, segmentId => $segmentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DistributionApi->putDistributions: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DistributionApi()
body = {
  "distributions" : [ {
    "variantID" : 1,
    "variantKey" : "control",
    "percent" : 50
  }, {
    "variantID" : 2,
    "variantKey" : "treatment",
    "percent" : 50
  } ]
} # PutDistributionsRequest | 
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment

try: 
    # Update distributions
    api_response = api_instance.put_distributions(body, flagId, segmentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DistributionApi->putDistributions: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Updated distributions

Status: 400 - Bad request - invalid input data or percentages don't sum to 100

Status: 404 - Flag, segment or variants not found

Status: 500 - Internal server error


Evaluation

postEvaluation

Evaluate flag


/evaluation

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/evaluation"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.EvaluationApi;

import java.io.File;
import java.util.*;

public class EvaluationApiExample {

    public static void main(String[] args) {
        
        EvaluationApi apiInstance = new EvaluationApi();
        EvalContext body = {
  "flagID" : 1,
  "entityID" : "user123",
  "entityType" : "user",
  "entityContext" : {
    "region" : "US",
    "tier" : "premium"
  },
  "enableDebug" : false
}; // EvalContext | 
        try {
            EvalResult result = apiInstance.postEvaluation(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EvaluationApi#postEvaluation");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.EvaluationApi;

public class EvaluationApiExample {

    public static void main(String[] args) {
        EvaluationApi apiInstance = new EvaluationApi();
        EvalContext body = {
  "flagID" : 1,
  "entityID" : "user123",
  "entityType" : "user",
  "entityContext" : {
    "region" : "US",
    "tier" : "premium"
  },
  "enableDebug" : false
}; // EvalContext | 
        try {
            EvalResult result = apiInstance.postEvaluation(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EvaluationApi#postEvaluation");
            e.printStackTrace();
        }
    }
}
EvalContext *body = {
  "flagID" : 1,
  "entityID" : "user123",
  "entityType" : "user",
  "entityContext" : {
    "region" : "US",
    "tier" : "premium"
  },
  "enableDebug" : false
}; // 

EvaluationApi *apiInstance = [[EvaluationApi alloc] init];

// Evaluate flag
[apiInstance postEvaluationWith:body
              completionHandler: ^(EvalResult output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.EvaluationApi()
var body = {
  "flagID" : 1,
  "entityID" : "user123",
  "entityType" : "user",
  "entityContext" : {
    "region" : "US",
    "tier" : "premium"
  },
  "enableDebug" : false
}; // {{EvalContext}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.postEvaluation(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class postEvaluationExample
    {
        public void main()
        {

            var apiInstance = new EvaluationApi();
            var body = new EvalContext(); // EvalContext | 

            try
            {
                // Evaluate flag
                EvalResult result = apiInstance.postEvaluation(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EvaluationApi.postEvaluation: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiEvaluationApi();
$body = {
  "flagID" : 1,
  "entityID" : "user123",
  "entityType" : "user",
  "entityContext" : {
    "region" : "US",
    "tier" : "premium"
  },
  "enableDebug" : false
}; // EvalContext | 

try {
    $result = $api_instance->postEvaluation($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EvaluationApi->postEvaluation: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EvaluationApi;

my $api_instance = WWW::SwaggerClient::EvaluationApi->new();
my $body = WWW::SwaggerClient::Object::EvalContext->new(); # EvalContext | 

eval { 
    my $result = $api_instance->postEvaluation(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EvaluationApi->postEvaluation: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.EvaluationApi()
body = {
  "flagID" : 1,
  "entityID" : "user123",
  "entityType" : "user",
  "entityContext" : {
    "region" : "US",
    "tier" : "premium"
  },
  "enableDebug" : false
} # EvalContext | 

try: 
    # Evaluate flag
    api_response = api_instance.post_evaluation(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EvaluationApi->postEvaluation: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - Evaluation result

Status: 400 - Bad request - invalid evaluation context

Status: 404 - Flag not found

Status: 429 - Too Many Requests - rate limit exceeded

Status: 500 - Internal server error


postEvaluationBatch

Batch evaluate flags

Evaluate multiple flags for multiple entities in a single request. More efficient than multiple single evaluation requests.


/evaluation/batch

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/evaluation/batch"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.EvaluationApi;

import java.io.File;
import java.util.*;

public class EvaluationApiExample {

    public static void main(String[] args) {
        
        EvaluationApi apiInstance = new EvaluationApi();
        EvaluationBatchRequest body = {
  "entities" : [ {
    "entityID" : "user123",
    "entityType" : "user",
    "entityContext" : {
      "region" : "US",
      "tier" : "premium"
    }
  }, {
    "entityID" : "user456",
    "entityType" : "user",
    "entityContext" : {
      "region" : "EU",
      "tier" : "basic"
    }
  } ],
  "flagIDs" : [ 1, 2 ],
  "enableDebug" : false
}; // EvaluationBatchRequest | 
        try {
            EvaluationBatchResponse result = apiInstance.postEvaluationBatch(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EvaluationApi#postEvaluationBatch");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.EvaluationApi;

public class EvaluationApiExample {

    public static void main(String[] args) {
        EvaluationApi apiInstance = new EvaluationApi();
        EvaluationBatchRequest body = {
  "entities" : [ {
    "entityID" : "user123",
    "entityType" : "user",
    "entityContext" : {
      "region" : "US",
      "tier" : "premium"
    }
  }, {
    "entityID" : "user456",
    "entityType" : "user",
    "entityContext" : {
      "region" : "EU",
      "tier" : "basic"
    }
  } ],
  "flagIDs" : [ 1, 2 ],
  "enableDebug" : false
}; // EvaluationBatchRequest | 
        try {
            EvaluationBatchResponse result = apiInstance.postEvaluationBatch(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EvaluationApi#postEvaluationBatch");
            e.printStackTrace();
        }
    }
}
EvaluationBatchRequest *body = {
  "entities" : [ {
    "entityID" : "user123",
    "entityType" : "user",
    "entityContext" : {
      "region" : "US",
      "tier" : "premium"
    }
  }, {
    "entityID" : "user456",
    "entityType" : "user",
    "entityContext" : {
      "region" : "EU",
      "tier" : "basic"
    }
  } ],
  "flagIDs" : [ 1, 2 ],
  "enableDebug" : false
}; // 

EvaluationApi *apiInstance = [[EvaluationApi alloc] init];

// Batch evaluate flags
[apiInstance postEvaluationBatchWith:body
              completionHandler: ^(EvaluationBatchResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.EvaluationApi()
var body = {
  "entities" : [ {
    "entityID" : "user123",
    "entityType" : "user",
    "entityContext" : {
      "region" : "US",
      "tier" : "premium"
    }
  }, {
    "entityID" : "user456",
    "entityType" : "user",
    "entityContext" : {
      "region" : "EU",
      "tier" : "basic"
    }
  } ],
  "flagIDs" : [ 1, 2 ],
  "enableDebug" : false
}; // {{EvaluationBatchRequest}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.postEvaluationBatch(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class postEvaluationBatchExample
    {
        public void main()
        {

            var apiInstance = new EvaluationApi();
            var body = new EvaluationBatchRequest(); // EvaluationBatchRequest | 

            try
            {
                // Batch evaluate flags
                EvaluationBatchResponse result = apiInstance.postEvaluationBatch(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EvaluationApi.postEvaluationBatch: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiEvaluationApi();
$body = {
  "entities" : [ {
    "entityID" : "user123",
    "entityType" : "user",
    "entityContext" : {
      "region" : "US",
      "tier" : "premium"
    }
  }, {
    "entityID" : "user456",
    "entityType" : "user",
    "entityContext" : {
      "region" : "EU",
      "tier" : "basic"
    }
  } ],
  "flagIDs" : [ 1, 2 ],
  "enableDebug" : false
}; // EvaluationBatchRequest | 

try {
    $result = $api_instance->postEvaluationBatch($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EvaluationApi->postEvaluationBatch: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EvaluationApi;

my $api_instance = WWW::SwaggerClient::EvaluationApi->new();
my $body = WWW::SwaggerClient::Object::EvaluationBatchRequest->new(); # EvaluationBatchRequest | 

eval { 
    my $result = $api_instance->postEvaluationBatch(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EvaluationApi->postEvaluationBatch: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.EvaluationApi()
body = {
  "entities" : [ {
    "entityID" : "user123",
    "entityType" : "user",
    "entityContext" : {
      "region" : "US",
      "tier" : "premium"
    }
  }, {
    "entityID" : "user456",
    "entityType" : "user",
    "entityContext" : {
      "region" : "EU",
      "tier" : "basic"
    }
  } ],
  "flagIDs" : [ 1, 2 ],
  "enableDebug" : false
} # EvaluationBatchRequest | 

try: 
    # Batch evaluate flags
    api_response = api_instance.post_evaluation_batch(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EvaluationApi->postEvaluationBatch: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - Evaluation batch result

Status: 400 - Bad request - invalid evaluation context

Status: 429 - Too Many Requests - rate limit exceeded

Status: 500 - Internal server error


Export

getExportEvalCacheJSON

Export eval cache as JSON

Export JSON format of the eval cache dump. This endpoint exports the current state of the evaluation cache in JSON format.


/export/eval_cache/json

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/export/eval_cache/json"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ExportApi;

import java.io.File;
import java.util.*;

public class ExportApiExample {

    public static void main(String[] args) {
        
        ExportApi apiInstance = new ExportApi();
        try {
            map['String', Object] result = apiInstance.getExportEvalCacheJSON();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ExportApi#getExportEvalCacheJSON");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ExportApi;

public class ExportApiExample {

    public static void main(String[] args) {
        ExportApi apiInstance = new ExportApi();
        try {
            map['String', Object] result = apiInstance.getExportEvalCacheJSON();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ExportApi#getExportEvalCacheJSON");
            e.printStackTrace();
        }
    }
}

ExportApi *apiInstance = [[ExportApi alloc] init];

// Export eval cache as JSON
[apiInstance getExportEvalCacheJSONWithCompletionHandler: 
              ^(map['String', Object] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.ExportApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getExportEvalCacheJSON(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getExportEvalCacheJSONExample
    {
        public void main()
        {

            var apiInstance = new ExportApi();

            try
            {
                // Export eval cache as JSON
                map['String', Object] result = apiInstance.getExportEvalCacheJSON();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ExportApi.getExportEvalCacheJSON: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiExportApi();

try {
    $result = $api_instance->getExportEvalCacheJSON();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ExportApi->getExportEvalCacheJSON: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ExportApi;

my $api_instance = WWW::SwaggerClient::ExportApi->new();

eval { 
    my $result = $api_instance->getExportEvalCacheJSON();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ExportApi->getExportEvalCacheJSON: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ExportApi()

try: 
    # Export eval cache as JSON
    api_response = api_instance.get_export_eval_cache_json()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExportApi->getExportEvalCacheJSON: %s\n" % e)

Parameters

Responses

Status: 200 - Eval cache JSON export

Status: 500 - Internal server error


getExportSQLite

Export database as SQLite

Export sqlite3 format of the db dump, which is converted from the main database. Returns a SQLite database file that can be used for backup or migration purposes.


/export/sqlite

Usage and SDK Samples

curl -X GET\
-H "Accept: application/octet-stream,application/json"\
"http://localhost:18000/api/v1/export/sqlite?exclude_snapshots="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ExportApi;

import java.io.File;
import java.util.*;

public class ExportApiExample {

    public static void main(String[] args) {
        
        ExportApi apiInstance = new ExportApi();
        Boolean excludeSnapshots = true; // Boolean | Export without snapshots data - useful for smaller db without snapshots
        try {
            byte[] result = apiInstance.getExportSQLite(excludeSnapshots);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ExportApi#getExportSQLite");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ExportApi;

public class ExportApiExample {

    public static void main(String[] args) {
        ExportApi apiInstance = new ExportApi();
        Boolean excludeSnapshots = true; // Boolean | Export without snapshots data - useful for smaller db without snapshots
        try {
            byte[] result = apiInstance.getExportSQLite(excludeSnapshots);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ExportApi#getExportSQLite");
            e.printStackTrace();
        }
    }
}
Boolean *excludeSnapshots = true; // Export without snapshots data - useful for smaller db without snapshots (optional) (default to false)

ExportApi *apiInstance = [[ExportApi alloc] init];

// Export database as SQLite
[apiInstance getExportSQLiteWith:excludeSnapshots
              completionHandler: ^(byte[] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.ExportApi()
var opts = { 
  'excludeSnapshots': true // {{Boolean}} Export without snapshots data - useful for smaller db without snapshots
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getExportSQLite(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getExportSQLiteExample
    {
        public void main()
        {

            var apiInstance = new ExportApi();
            var excludeSnapshots = true;  // Boolean | Export without snapshots data - useful for smaller db without snapshots (optional)  (default to false)

            try
            {
                // Export database as SQLite
                byte[] result = apiInstance.getExportSQLite(excludeSnapshots);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ExportApi.getExportSQLite: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiExportApi();
$excludeSnapshots = true; // Boolean | Export without snapshots data - useful for smaller db without snapshots

try {
    $result = $api_instance->getExportSQLite($excludeSnapshots);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ExportApi->getExportSQLite: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ExportApi;

my $api_instance = WWW::SwaggerClient::ExportApi->new();
my $excludeSnapshots = true; # Boolean | Export without snapshots data - useful for smaller db without snapshots

eval { 
    my $result = $api_instance->getExportSQLite(excludeSnapshots => $excludeSnapshots);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ExportApi->getExportSQLite: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ExportApi()
excludeSnapshots = true # Boolean | Export without snapshots data - useful for smaller db without snapshots (optional) (default to false)

try: 
    # Export database as SQLite
    api_response = api_instance.get_export_sq_lite(excludeSnapshots=excludeSnapshots)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ExportApi->getExportSQLite: %s\n" % e)

Parameters

Query parameters
Name Description
exclude_snapshots
Boolean
Export without snapshots data - useful for smaller db without snapshots

Responses

Status: 200 - SQLite database file

Status: 400 - Bad request - invalid parameters

Status: 500 - Internal server error


Flag

createFlag

Create a new flag


/flags

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        CreateFlagRequest body = {
  "description" : "New feature flag",
  "key" : "new_feature"
}; // CreateFlagRequest | 
        try {
            Flag result = apiInstance.createFlag(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#createFlag");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        CreateFlagRequest body = {
  "description" : "New feature flag",
  "key" : "new_feature"
}; // CreateFlagRequest | 
        try {
            Flag result = apiInstance.createFlag(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#createFlag");
            e.printStackTrace();
        }
    }
}
CreateFlagRequest *body = {
  "description" : "New feature flag",
  "key" : "new_feature"
}; // 

FlagApi *apiInstance = [[FlagApi alloc] init];

// Create a new flag
[apiInstance createFlagWith:body
              completionHandler: ^(Flag output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var body = {
  "description" : "New feature flag",
  "key" : "new_feature"
}; // {{CreateFlagRequest}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createFlag(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createFlagExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var body = new CreateFlagRequest(); // CreateFlagRequest | 

            try
            {
                // Create a new flag
                Flag result = apiInstance.createFlag(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.createFlag: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$body = {
  "description" : "New feature flag",
  "key" : "new_feature"
}; // CreateFlagRequest | 

try {
    $result = $api_instance->createFlag($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->createFlag: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $body = WWW::SwaggerClient::Object::CreateFlagRequest->new(); # CreateFlagRequest | 

eval { 
    my $result = $api_instance->createFlag(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->createFlag: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
body = {
  "description" : "New feature flag",
  "key" : "new_feature"
} # CreateFlagRequest | 

try: 
    # Create a new flag
    api_response = api_instance.create_flag(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->createFlag: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - Created flag

Status: 400 - Bad request - invalid input data

Status: 500 - Internal server error


deleteFlag

Delete flag


/flags/{flagId}

Usage and SDK Samples

curl -X DELETE\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            apiInstance.deleteFlag(flagId);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#deleteFlag");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            apiInstance.deleteFlag(flagId);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#deleteFlag");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag

FlagApi *apiInstance = [[FlagApi alloc] init];

// Delete flag
[apiInstance deleteFlagWith:flagId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteFlag(flagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteFlagExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Delete flag
                apiInstance.deleteFlag(flagId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.deleteFlag: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$flagId = 789; // Long | Numeric ID of the flag

try {
    $api_instance->deleteFlag($flagId);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->deleteFlag: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    $api_instance->deleteFlag(flagId => $flagId);
};
if ($@) {
    warn "Exception when calling FlagApi->deleteFlag: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Delete flag
    api_instance.delete_flag(flagId)
except ApiException as e:
    print("Exception when calling FlagApi->deleteFlag: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required

Responses

Status: 200 - Flag deleted

Status: default - Generic error response


findFlags

Get all flags


/flags

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags?limit=&offset=&enabled=&description=&key=&descriptionLike=&preload=&deleted=&tags="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        Long limit = 789; // Long | The numbers of flags to return
        Long offset = 789; // Long | Return flags given the offset, it should usually set together with limit
        Boolean enabled = true; // Boolean | Return flags having given enabled status
        String description = description_example; // String | Filter flags by exact description match
        String key = key_example; // String | Filter flags by exact key match
        String descriptionLike = descriptionLike_example; // String | Filter flags by partial description match
        Boolean preload = true; // Boolean | Preload segments, variants, and tags
        Boolean deleted = true; // Boolean | Include deleted flags in results
        String tags = tags_example; // String | Filter flags by tags (comma-separated)
        try {
            array[Flag] result = apiInstance.findFlags(limit, offset, enabled, description, key, descriptionLike, preload, deleted, tags);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#findFlags");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        Long limit = 789; // Long | The numbers of flags to return
        Long offset = 789; // Long | Return flags given the offset, it should usually set together with limit
        Boolean enabled = true; // Boolean | Return flags having given enabled status
        String description = description_example; // String | Filter flags by exact description match
        String key = key_example; // String | Filter flags by exact key match
        String descriptionLike = descriptionLike_example; // String | Filter flags by partial description match
        Boolean preload = true; // Boolean | Preload segments, variants, and tags
        Boolean deleted = true; // Boolean | Include deleted flags in results
        String tags = tags_example; // String | Filter flags by tags (comma-separated)
        try {
            array[Flag] result = apiInstance.findFlags(limit, offset, enabled, description, key, descriptionLike, preload, deleted, tags);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#findFlags");
            e.printStackTrace();
        }
    }
}
Long *limit = 789; // The numbers of flags to return (optional)
Long *offset = 789; // Return flags given the offset, it should usually set together with limit (optional) (default to 0)
Boolean *enabled = true; // Return flags having given enabled status (optional)
String *description = description_example; // Filter flags by exact description match (optional)
String *key = key_example; // Filter flags by exact key match (optional)
String *descriptionLike = descriptionLike_example; // Filter flags by partial description match (optional)
Boolean *preload = true; // Preload segments, variants, and tags (optional) (default to false)
Boolean *deleted = true; // Include deleted flags in results (optional) (default to false)
String *tags = tags_example; // Filter flags by tags (comma-separated) (optional)

FlagApi *apiInstance = [[FlagApi alloc] init];

// Get all flags
[apiInstance findFlagsWith:limit
    offset:offset
    enabled:enabled
    description:description
    key:key
    descriptionLike:descriptionLike
    preload:preload
    deleted:deleted
    tags:tags
              completionHandler: ^(array[Flag] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var opts = { 
  'limit': 789, // {{Long}} The numbers of flags to return
  'offset': 789, // {{Long}} Return flags given the offset, it should usually set together with limit
  'enabled': true, // {{Boolean}} Return flags having given enabled status
  'description': description_example, // {{String}} Filter flags by exact description match
  'key': key_example, // {{String}} Filter flags by exact key match
  'descriptionLike': descriptionLike_example, // {{String}} Filter flags by partial description match
  'preload': true, // {{Boolean}} Preload segments, variants, and tags
  'deleted': true, // {{Boolean}} Include deleted flags in results
  'tags': tags_example // {{String}} Filter flags by tags (comma-separated)
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findFlags(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findFlagsExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var limit = 789;  // Long | The numbers of flags to return (optional) 
            var offset = 789;  // Long | Return flags given the offset, it should usually set together with limit (optional)  (default to 0)
            var enabled = true;  // Boolean | Return flags having given enabled status (optional) 
            var description = description_example;  // String | Filter flags by exact description match (optional) 
            var key = key_example;  // String | Filter flags by exact key match (optional) 
            var descriptionLike = descriptionLike_example;  // String | Filter flags by partial description match (optional) 
            var preload = true;  // Boolean | Preload segments, variants, and tags (optional)  (default to false)
            var deleted = true;  // Boolean | Include deleted flags in results (optional)  (default to false)
            var tags = tags_example;  // String | Filter flags by tags (comma-separated) (optional) 

            try
            {
                // Get all flags
                array[Flag] result = apiInstance.findFlags(limit, offset, enabled, description, key, descriptionLike, preload, deleted, tags);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.findFlags: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$limit = 789; // Long | The numbers of flags to return
$offset = 789; // Long | Return flags given the offset, it should usually set together with limit
$enabled = true; // Boolean | Return flags having given enabled status
$description = description_example; // String | Filter flags by exact description match
$key = key_example; // String | Filter flags by exact key match
$descriptionLike = descriptionLike_example; // String | Filter flags by partial description match
$preload = true; // Boolean | Preload segments, variants, and tags
$deleted = true; // Boolean | Include deleted flags in results
$tags = tags_example; // String | Filter flags by tags (comma-separated)

try {
    $result = $api_instance->findFlags($limit, $offset, $enabled, $description, $key, $descriptionLike, $preload, $deleted, $tags);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->findFlags: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $limit = 789; # Long | The numbers of flags to return
my $offset = 789; # Long | Return flags given the offset, it should usually set together with limit
my $enabled = true; # Boolean | Return flags having given enabled status
my $description = description_example; # String | Filter flags by exact description match
my $key = key_example; # String | Filter flags by exact key match
my $descriptionLike = descriptionLike_example; # String | Filter flags by partial description match
my $preload = true; # Boolean | Preload segments, variants, and tags
my $deleted = true; # Boolean | Include deleted flags in results
my $tags = tags_example; # String | Filter flags by tags (comma-separated)

eval { 
    my $result = $api_instance->findFlags(limit => $limit, offset => $offset, enabled => $enabled, description => $description, key => $key, descriptionLike => $descriptionLike, preload => $preload, deleted => $deleted, tags => $tags);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->findFlags: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
limit = 789 # Long | The numbers of flags to return (optional)
offset = 789 # Long | Return flags given the offset, it should usually set together with limit (optional) (default to 0)
enabled = true # Boolean | Return flags having given enabled status (optional)
description = description_example # String | Filter flags by exact description match (optional)
key = key_example # String | Filter flags by exact key match (optional)
descriptionLike = descriptionLike_example # String | Filter flags by partial description match (optional)
preload = true # Boolean | Preload segments, variants, and tags (optional) (default to false)
deleted = true # Boolean | Include deleted flags in results (optional) (default to false)
tags = tags_example # String | Filter flags by tags (comma-separated) (optional)

try: 
    # Get all flags
    api_response = api_instance.find_flags(limit=limit, offset=offset, enabled=enabled, description=description, key=key, descriptionLike=descriptionLike, preload=preload, deleted=deleted, tags=tags)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->findFlags: %s\n" % e)

Parameters

Query parameters
Name Description
limit
Long (int64)
The numbers of flags to return
offset
Long (int64)
Return flags given the offset, it should usually set together with limit
enabled
Boolean
Return flags having given enabled status
description
String
Filter flags by exact description match
key
String
Filter flags by exact key match
descriptionLike
String
Filter flags by partial description match
preload
Boolean
Preload segments, variants, and tags
deleted
Boolean
Include deleted flags in results
tags
String
Filter flags by tags (comma-separated)

Responses

Status: 200 - List of flags

Status: 400 - Bad request - invalid parameters

Status: 500 - Internal server error


getFlag

Get flag by ID


/flags/{flagId}

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.getFlag(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#getFlag");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.getFlag(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#getFlag");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag

FlagApi *apiInstance = [[FlagApi alloc] init];

// Get flag by ID
[apiInstance getFlagWith:flagId
              completionHandler: ^(Flag output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getFlag(flagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getFlagExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Get flag by ID
                Flag result = apiInstance.getFlag(flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.getFlag: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->getFlag($flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->getFlag: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->getFlag(flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->getFlag: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Get flag by ID
    api_response = api_instance.get_flag(flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->getFlag: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required

Responses

Status: 200 - Flag details

Status: 400 - Bad request - invalid flag ID

Status: 404 - Flag not found

Status: 500 - Internal server error


getFlagEntityTypes

Get all entity types


/flags/entity_types

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/entity_types"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        try {
            array['String'] result = apiInstance.getFlagEntityTypes();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#getFlagEntityTypes");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        try {
            array['String'] result = apiInstance.getFlagEntityTypes();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#getFlagEntityTypes");
            e.printStackTrace();
        }
    }
}

FlagApi *apiInstance = [[FlagApi alloc] init];

// Get all entity types
[apiInstance getFlagEntityTypesWithCompletionHandler: 
              ^(array['String'] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getFlagEntityTypes(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getFlagEntityTypesExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();

            try
            {
                // Get all entity types
                array['String'] result = apiInstance.getFlagEntityTypes();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.getFlagEntityTypes: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();

try {
    $result = $api_instance->getFlagEntityTypes();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->getFlagEntityTypes: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();

eval { 
    my $result = $api_instance->getFlagEntityTypes();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->getFlagEntityTypes: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()

try: 
    # Get all entity types
    api_response = api_instance.get_flag_entity_types()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->getFlagEntityTypes: %s\n" % e)

Parameters

Responses

Status: 200 - List of entity types

Status: 500 - Internal server error


getFlagSnapshots

Get flag snapshots


/flags/{flagId}/snapshots

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/snapshots?limit=&offset=&sort="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long limit = 789; // Long | The number of snapshots to return
        Long offset = 789; // Long | Return snapshots given the offset
        String sort = sort_example; // String | Sort order
        try {
            array[FlagSnapshot] result = apiInstance.getFlagSnapshots(flagId, limit, offset, sort);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#getFlagSnapshots");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long limit = 789; // Long | The number of snapshots to return
        Long offset = 789; // Long | Return snapshots given the offset
        String sort = sort_example; // String | Sort order
        try {
            array[FlagSnapshot] result = apiInstance.getFlagSnapshots(flagId, limit, offset, sort);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#getFlagSnapshots");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag
Long *limit = 789; // The number of snapshots to return (optional)
Long *offset = 789; // Return snapshots given the offset (optional) (default to 0)
String *sort = sort_example; // Sort order (optional)

FlagApi *apiInstance = [[FlagApi alloc] init];

// Get flag snapshots
[apiInstance getFlagSnapshotsWith:flagId
    limit:limit
    offset:offset
    sort:sort
              completionHandler: ^(array[FlagSnapshot] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var flagId = 789; // {{Long}} Numeric ID of the flag
var opts = { 
  'limit': 789, // {{Long}} The number of snapshots to return
  'offset': 789, // {{Long}} Return snapshots given the offset
  'sort': sort_example // {{String}} Sort order
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getFlagSnapshots(flagId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getFlagSnapshotsExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var flagId = 789;  // Long | Numeric ID of the flag
            var limit = 789;  // Long | The number of snapshots to return (optional) 
            var offset = 789;  // Long | Return snapshots given the offset (optional)  (default to 0)
            var sort = sort_example;  // String | Sort order (optional) 

            try
            {
                // Get flag snapshots
                array[FlagSnapshot] result = apiInstance.getFlagSnapshots(flagId, limit, offset, sort);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.getFlagSnapshots: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$flagId = 789; // Long | Numeric ID of the flag
$limit = 789; // Long | The number of snapshots to return
$offset = 789; // Long | Return snapshots given the offset
$sort = sort_example; // String | Sort order

try {
    $result = $api_instance->getFlagSnapshots($flagId, $limit, $offset, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->getFlagSnapshots: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $flagId = 789; # Long | Numeric ID of the flag
my $limit = 789; # Long | The number of snapshots to return
my $offset = 789; # Long | Return snapshots given the offset
my $sort = sort_example; # String | Sort order

eval { 
    my $result = $api_instance->getFlagSnapshots(flagId => $flagId, limit => $limit, offset => $offset, sort => $sort);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->getFlagSnapshots: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
flagId = 789 # Long | Numeric ID of the flag
limit = 789 # Long | The number of snapshots to return (optional)
offset = 789 # Long | Return snapshots given the offset (optional) (default to 0)
sort = sort_example # String | Sort order (optional)

try: 
    # Get flag snapshots
    api_response = api_instance.get_flag_snapshots(flagId, limit=limit, offset=offset, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->getFlagSnapshots: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
Query parameters
Name Description
limit
Long (int64)
The number of snapshots to return
offset
Long (int64)
Return snapshots given the offset
sort
String
Sort order

Responses

Status: 200 - List of flag snapshots

Status: 400 - Bad request - invalid flag ID or parameters

Status: 404 - Flag not found

Status: 500 - Internal server error


putFlag

Update flag


/flags/{flagId}

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        PutFlagRequest body = ; // PutFlagRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.putFlag(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#putFlag");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        PutFlagRequest body = ; // PutFlagRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.putFlag(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#putFlag");
            e.printStackTrace();
        }
    }
}
PutFlagRequest *body = ; // 
Long *flagId = 789; // Numeric ID of the flag

FlagApi *apiInstance = [[FlagApi alloc] init];

// Update flag
[apiInstance putFlagWith:body
    flagId:flagId
              completionHandler: ^(Flag output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var body = ; // {{PutFlagRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putFlag(bodyflagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putFlagExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var body = new PutFlagRequest(); // PutFlagRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Update flag
                Flag result = apiInstance.putFlag(body, flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.putFlag: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$body = ; // PutFlagRequest | 
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->putFlag($body, $flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->putFlag: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $body = WWW::SwaggerClient::Object::PutFlagRequest->new(); # PutFlagRequest | 
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->putFlag(body => $body, flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->putFlag: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
body =  # PutFlagRequest | 
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Update flag
    api_response = api_instance.put_flag(body, flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->putFlag: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Updated flag

Status: default - Generic error response


restoreFlag

Restore deleted flag


/flags/{flagId}/restore

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/restore"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.restoreFlag(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#restoreFlag");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.restoreFlag(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#restoreFlag");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag

FlagApi *apiInstance = [[FlagApi alloc] init];

// Restore deleted flag
[apiInstance restoreFlagWith:flagId
              completionHandler: ^(Flag output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.restoreFlag(flagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class restoreFlagExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Restore deleted flag
                Flag result = apiInstance.restoreFlag(flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.restoreFlag: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->restoreFlag($flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->restoreFlag: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->restoreFlag(flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->restoreFlag: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Restore deleted flag
    api_response = api_instance.restore_flag(flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->restoreFlag: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required

Responses

Status: 200 - Flag restored

Status: 400 - Bad request - invalid flag ID

Status: 404 - Flag not found

Status: 500 - Internal server error


setFlagEnabled

Set flag enabled status


/flags/{flagId}/enabled

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/enabled"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FlagApi;

import java.io.File;
import java.util.*;

public class FlagApiExample {

    public static void main(String[] args) {
        
        FlagApi apiInstance = new FlagApi();
        SetFlagEnabledRequest body = {
  "enabled" : true
}; // SetFlagEnabledRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.setFlagEnabled(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#setFlagEnabled");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FlagApi;

public class FlagApiExample {

    public static void main(String[] args) {
        FlagApi apiInstance = new FlagApi();
        SetFlagEnabledRequest body = {
  "enabled" : true
}; // SetFlagEnabledRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Flag result = apiInstance.setFlagEnabled(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FlagApi#setFlagEnabled");
            e.printStackTrace();
        }
    }
}
SetFlagEnabledRequest *body = {
  "enabled" : true
}; // 
Long *flagId = 789; // Numeric ID of the flag

FlagApi *apiInstance = [[FlagApi alloc] init];

// Set flag enabled status
[apiInstance setFlagEnabledWith:body
    flagId:flagId
              completionHandler: ^(Flag output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.FlagApi()
var body = {
  "enabled" : true
}; // {{SetFlagEnabledRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.setFlagEnabled(bodyflagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class setFlagEnabledExample
    {
        public void main()
        {

            var apiInstance = new FlagApi();
            var body = new SetFlagEnabledRequest(); // SetFlagEnabledRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Set flag enabled status
                Flag result = apiInstance.setFlagEnabled(body, flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FlagApi.setFlagEnabled: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiFlagApi();
$body = {
  "enabled" : true
}; // SetFlagEnabledRequest | 
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->setFlagEnabled($body, $flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->setFlagEnabled: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FlagApi;

my $api_instance = WWW::SwaggerClient::FlagApi->new();
my $body = WWW::SwaggerClient::Object::SetFlagEnabledRequest->new(); # SetFlagEnabledRequest | 
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->setFlagEnabled(body => $body, flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FlagApi->setFlagEnabled: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FlagApi()
body = {
  "enabled" : true
} # SetFlagEnabledRequest | 
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Set flag enabled status
    api_response = api_instance.set_flag_enabled(body, flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->setFlagEnabled: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Flag updated

Status: 400 - Bad request - invalid flag ID or request body

Status: 404 - Flag not found

Status: 500 - Internal server error


Health

getHealth

Health check

Check if Flagent is healthy


/health

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/health"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.HealthApi;

import java.io.File;
import java.util.*;

public class HealthApiExample {

    public static void main(String[] args) {
        
        HealthApi apiInstance = new HealthApi();
        try {
            Health result = apiInstance.getHealth();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HealthApi#getHealth");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.HealthApi;

public class HealthApiExample {

    public static void main(String[] args) {
        HealthApi apiInstance = new HealthApi();
        try {
            Health result = apiInstance.getHealth();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HealthApi#getHealth");
            e.printStackTrace();
        }
    }
}

HealthApi *apiInstance = [[HealthApi alloc] init];

// Health check
[apiInstance getHealthWithCompletionHandler: 
              ^(Health output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.HealthApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getHealth(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getHealthExample
    {
        public void main()
        {

            var apiInstance = new HealthApi();

            try
            {
                // Health check
                Health result = apiInstance.getHealth();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling HealthApi.getHealth: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiHealthApi();

try {
    $result = $api_instance->getHealth();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling HealthApi->getHealth: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::HealthApi;

my $api_instance = WWW::SwaggerClient::HealthApi->new();

eval { 
    my $result = $api_instance->getHealth();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling HealthApi->getHealth: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.HealthApi()

try: 
    # Health check
    api_response = api_instance.get_health()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling HealthApi->getHealth: %s\n" % e)

Parameters

Responses

Status: 200 - Service is healthy

Status: default - Generic error response


getInfo

Get version information


/info

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/info"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.HealthApi;

import java.io.File;
import java.util.*;

public class HealthApiExample {

    public static void main(String[] args) {
        
        HealthApi apiInstance = new HealthApi();
        try {
            Info result = apiInstance.getInfo();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HealthApi#getInfo");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.HealthApi;

public class HealthApiExample {

    public static void main(String[] args) {
        HealthApi apiInstance = new HealthApi();
        try {
            Info result = apiInstance.getInfo();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling HealthApi#getInfo");
            e.printStackTrace();
        }
    }
}

HealthApi *apiInstance = [[HealthApi alloc] init];

// Get version information
[apiInstance getInfoWithCompletionHandler: 
              ^(Info output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.HealthApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getInfo(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getInfoExample
    {
        public void main()
        {

            var apiInstance = new HealthApi();

            try
            {
                // Get version information
                Info result = apiInstance.getInfo();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling HealthApi.getInfo: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiHealthApi();

try {
    $result = $api_instance->getInfo();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling HealthApi->getInfo: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::HealthApi;

my $api_instance = WWW::SwaggerClient::HealthApi->new();

eval { 
    my $result = $api_instance->getInfo();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling HealthApi->getInfo: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.HealthApi()

try: 
    # Get version information
    api_response = api_instance.get_info()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling HealthApi->getInfo: %s\n" % e)

Parameters

Responses

Status: 200 - Version information


Segment

createSegment

Create segment

Create a new segment for the flag. Segments define the audience and are evaluated in order by rank.


/flags/{flagId}/segments

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SegmentApi;

import java.io.File;
import java.util.*;

public class SegmentApiExample {

    public static void main(String[] args) {
        
        SegmentApi apiInstance = new SegmentApi();
        CreateSegmentRequest body = {
  "description" : "US users",
  "rolloutPercent" : 100
}; // CreateSegmentRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Segment result = apiInstance.createSegment(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#createSegment");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SegmentApi;

public class SegmentApiExample {

    public static void main(String[] args) {
        SegmentApi apiInstance = new SegmentApi();
        CreateSegmentRequest body = {
  "description" : "US users",
  "rolloutPercent" : 100
}; // CreateSegmentRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Segment result = apiInstance.createSegment(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#createSegment");
            e.printStackTrace();
        }
    }
}
CreateSegmentRequest *body = {
  "description" : "US users",
  "rolloutPercent" : 100
}; // 
Long *flagId = 789; // Numeric ID of the flag

SegmentApi *apiInstance = [[SegmentApi alloc] init];

// Create segment
[apiInstance createSegmentWith:body
    flagId:flagId
              completionHandler: ^(Segment output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.SegmentApi()
var body = {
  "description" : "US users",
  "rolloutPercent" : 100
}; // {{CreateSegmentRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createSegment(bodyflagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createSegmentExample
    {
        public void main()
        {

            var apiInstance = new SegmentApi();
            var body = new CreateSegmentRequest(); // CreateSegmentRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Create segment
                Segment result = apiInstance.createSegment(body, flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SegmentApi.createSegment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiSegmentApi();
$body = {
  "description" : "US users",
  "rolloutPercent" : 100
}; // CreateSegmentRequest | 
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->createSegment($body, $flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->createSegment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SegmentApi;

my $api_instance = WWW::SwaggerClient::SegmentApi->new();
my $body = WWW::SwaggerClient::Object::CreateSegmentRequest->new(); # CreateSegmentRequest | 
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->createSegment(body => $body, flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SegmentApi->createSegment: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SegmentApi()
body = {
  "description" : "US users",
  "rolloutPercent" : 100
} # CreateSegmentRequest | 
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Create segment
    api_response = api_instance.create_segment(body, flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SegmentApi->createSegment: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Created segment

Status: 400 - Bad request - invalid input data

Status: 404 - Flag not found

Status: 500 - Internal server error


deleteSegment

Delete segment

Delete a segment. This will also delete all constraints and distributions associated with the segment.


/flags/{flagId}/segments/{segmentId}

Usage and SDK Samples

curl -X DELETE\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SegmentApi;

import java.io.File;
import java.util.*;

public class SegmentApiExample {

    public static void main(String[] args) {
        
        SegmentApi apiInstance = new SegmentApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            apiInstance.deleteSegment(flagId, segmentId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#deleteSegment");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SegmentApi;

public class SegmentApiExample {

    public static void main(String[] args) {
        SegmentApi apiInstance = new SegmentApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            apiInstance.deleteSegment(flagId, segmentId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#deleteSegment");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment

SegmentApi *apiInstance = [[SegmentApi alloc] init];

// Delete segment
[apiInstance deleteSegmentWith:flagId
    segmentId:segmentId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.SegmentApi()
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteSegment(flagId, segmentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteSegmentExample
    {
        public void main()
        {

            var apiInstance = new SegmentApi();
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment

            try
            {
                // Delete segment
                apiInstance.deleteSegment(flagId, segmentId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SegmentApi.deleteSegment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiSegmentApi();
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment

try {
    $api_instance->deleteSegment($flagId, $segmentId);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->deleteSegment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SegmentApi;

my $api_instance = WWW::SwaggerClient::SegmentApi->new();
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment

eval { 
    $api_instance->deleteSegment(flagId => $flagId, segmentId => $segmentId);
};
if ($@) {
    warn "Exception when calling SegmentApi->deleteSegment: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SegmentApi()
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment

try: 
    # Delete segment
    api_instance.delete_segment(flagId, segmentId)
except ApiException as e:
    print("Exception when calling SegmentApi->deleteSegment: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required

Responses

Status: 200 - Segment deleted successfully

Status: 400 - Bad request - invalid flag ID or segment ID

Status: 404 - Flag or segment not found

Status: 500 - Internal server error


findSegments

Get segments for flag


/flags/{flagId}/segments

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SegmentApi;

import java.io.File;
import java.util.*;

public class SegmentApiExample {

    public static void main(String[] args) {
        
        SegmentApi apiInstance = new SegmentApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            array[Segment] result = apiInstance.findSegments(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#findSegments");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SegmentApi;

public class SegmentApiExample {

    public static void main(String[] args) {
        SegmentApi apiInstance = new SegmentApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            array[Segment] result = apiInstance.findSegments(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#findSegments");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag

SegmentApi *apiInstance = [[SegmentApi alloc] init];

// Get segments for flag
[apiInstance findSegmentsWith:flagId
              completionHandler: ^(array[Segment] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.SegmentApi()
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findSegments(flagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findSegmentsExample
    {
        public void main()
        {

            var apiInstance = new SegmentApi();
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Get segments for flag
                array[Segment] result = apiInstance.findSegments(flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SegmentApi.findSegments: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiSegmentApi();
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->findSegments($flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->findSegments: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SegmentApi;

my $api_instance = WWW::SwaggerClient::SegmentApi->new();
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->findSegments(flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SegmentApi->findSegments: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SegmentApi()
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Get segments for flag
    api_response = api_instance.find_segments(flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SegmentApi->findSegments: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required

Responses

Status: 200 - Segments ordered by rank

Status: 400 - Bad request - invalid flag ID

Status: 404 - Flag not found

Status: 500 - Internal server error


putSegment

Update segment


/flags/{flagId}/segments/{segmentId}

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/{segmentId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SegmentApi;

import java.io.File;
import java.util.*;

public class SegmentApiExample {

    public static void main(String[] args) {
        
        SegmentApi apiInstance = new SegmentApi();
        PutSegmentRequest body = {
  "description" : "US users - updated",
  "rolloutPercent" : 50
}; // PutSegmentRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            Segment result = apiInstance.putSegment(body, flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#putSegment");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SegmentApi;

public class SegmentApiExample {

    public static void main(String[] args) {
        SegmentApi apiInstance = new SegmentApi();
        PutSegmentRequest body = {
  "description" : "US users - updated",
  "rolloutPercent" : 50
}; // PutSegmentRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long segmentId = 789; // Long | Numeric ID of the segment
        try {
            Segment result = apiInstance.putSegment(body, flagId, segmentId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#putSegment");
            e.printStackTrace();
        }
    }
}
PutSegmentRequest *body = {
  "description" : "US users - updated",
  "rolloutPercent" : 50
}; // 
Long *flagId = 789; // Numeric ID of the flag
Long *segmentId = 789; // Numeric ID of the segment

SegmentApi *apiInstance = [[SegmentApi alloc] init];

// Update segment
[apiInstance putSegmentWith:body
    flagId:flagId
    segmentId:segmentId
              completionHandler: ^(Segment output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.SegmentApi()
var body = {
  "description" : "US users - updated",
  "rolloutPercent" : 50
}; // {{PutSegmentRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag
var segmentId = 789; // {{Long}} Numeric ID of the segment

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putSegment(bodyflagIdsegmentId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putSegmentExample
    {
        public void main()
        {

            var apiInstance = new SegmentApi();
            var body = new PutSegmentRequest(); // PutSegmentRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag
            var segmentId = 789;  // Long | Numeric ID of the segment

            try
            {
                // Update segment
                Segment result = apiInstance.putSegment(body, flagId, segmentId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SegmentApi.putSegment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiSegmentApi();
$body = {
  "description" : "US users - updated",
  "rolloutPercent" : 50
}; // PutSegmentRequest | 
$flagId = 789; // Long | Numeric ID of the flag
$segmentId = 789; // Long | Numeric ID of the segment

try {
    $result = $api_instance->putSegment($body, $flagId, $segmentId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->putSegment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SegmentApi;

my $api_instance = WWW::SwaggerClient::SegmentApi->new();
my $body = WWW::SwaggerClient::Object::PutSegmentRequest->new(); # PutSegmentRequest | 
my $flagId = 789; # Long | Numeric ID of the flag
my $segmentId = 789; # Long | Numeric ID of the segment

eval { 
    my $result = $api_instance->putSegment(body => $body, flagId => $flagId, segmentId => $segmentId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SegmentApi->putSegment: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SegmentApi()
body = {
  "description" : "US users - updated",
  "rolloutPercent" : 50
} # PutSegmentRequest | 
flagId = 789 # Long | Numeric ID of the flag
segmentId = 789 # Long | Numeric ID of the segment

try: 
    # Update segment
    api_response = api_instance.put_segment(body, flagId, segmentId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SegmentApi->putSegment: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
segmentId*
Long (int64)
Numeric ID of the segment
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Updated segment

Status: 400 - Bad request - invalid input data

Status: 404 - Flag or segment not found

Status: 500 - Internal server error


putSegmentReorder

Reorder segments


/flags/{flagId}/segments/reorder

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/segments/reorder"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SegmentApi;

import java.io.File;
import java.util.*;

public class SegmentApiExample {

    public static void main(String[] args) {
        
        SegmentApi apiInstance = new SegmentApi();
        PutSegmentReorderRequest body = {
  "segmentIDs" : [ 2, 1, 3 ]
}; // PutSegmentReorderRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            apiInstance.putSegmentReorder(body, flagId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#putSegmentReorder");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SegmentApi;

public class SegmentApiExample {

    public static void main(String[] args) {
        SegmentApi apiInstance = new SegmentApi();
        PutSegmentReorderRequest body = {
  "segmentIDs" : [ 2, 1, 3 ]
}; // PutSegmentReorderRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            apiInstance.putSegmentReorder(body, flagId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SegmentApi#putSegmentReorder");
            e.printStackTrace();
        }
    }
}
PutSegmentReorderRequest *body = {
  "segmentIDs" : [ 2, 1, 3 ]
}; // 
Long *flagId = 789; // Numeric ID of the flag

SegmentApi *apiInstance = [[SegmentApi alloc] init];

// Reorder segments
[apiInstance putSegmentReorderWith:body
    flagId:flagId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.SegmentApi()
var body = {
  "segmentIDs" : [ 2, 1, 3 ]
}; // {{PutSegmentReorderRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.putSegmentReorder(bodyflagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putSegmentReorderExample
    {
        public void main()
        {

            var apiInstance = new SegmentApi();
            var body = new PutSegmentReorderRequest(); // PutSegmentReorderRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Reorder segments
                apiInstance.putSegmentReorder(body, flagId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SegmentApi.putSegmentReorder: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiSegmentApi();
$body = {
  "segmentIDs" : [ 2, 1, 3 ]
}; // PutSegmentReorderRequest | 
$flagId = 789; // Long | Numeric ID of the flag

try {
    $api_instance->putSegmentReorder($body, $flagId);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->putSegmentReorder: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SegmentApi;

my $api_instance = WWW::SwaggerClient::SegmentApi->new();
my $body = WWW::SwaggerClient::Object::PutSegmentReorderRequest->new(); # PutSegmentReorderRequest | 
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    $api_instance->putSegmentReorder(body => $body, flagId => $flagId);
};
if ($@) {
    warn "Exception when calling SegmentApi->putSegmentReorder: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SegmentApi()
body = {
  "segmentIDs" : [ 2, 1, 3 ]
} # PutSegmentReorderRequest | 
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Reorder segments
    api_instance.put_segment_reorder(body, flagId)
except ApiException as e:
    print("Exception when calling SegmentApi->putSegmentReorder: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Segments reordered successfully

Status: 400 - Bad request - invalid flag ID or segment IDs

Status: 404 - Flag or segments not found

Status: 500 - Internal server error


Tag

createFlagTag

Create tag and associate with flag

Create a tag and associate it with the flag. Tags are used for organizing and filtering flags.


/flags/{flagId}/tags

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/tags"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TagApi;

import java.io.File;
import java.util.*;

public class TagApiExample {

    public static void main(String[] args) {
        
        TagApi apiInstance = new TagApi();
        CreateTagRequest body = {
  "value" : "production"
}; // CreateTagRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Tag result = apiInstance.createFlagTag(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#createFlagTag");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TagApi;

public class TagApiExample {

    public static void main(String[] args) {
        TagApi apiInstance = new TagApi();
        CreateTagRequest body = {
  "value" : "production"
}; // CreateTagRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Tag result = apiInstance.createFlagTag(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#createFlagTag");
            e.printStackTrace();
        }
    }
}
CreateTagRequest *body = {
  "value" : "production"
}; // 
Long *flagId = 789; // Numeric ID of the flag

TagApi *apiInstance = [[TagApi alloc] init];

// Create tag and associate with flag
[apiInstance createFlagTagWith:body
    flagId:flagId
              completionHandler: ^(Tag output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.TagApi()
var body = {
  "value" : "production"
}; // {{CreateTagRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createFlagTag(bodyflagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createFlagTagExample
    {
        public void main()
        {

            var apiInstance = new TagApi();
            var body = new CreateTagRequest(); // CreateTagRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Create tag and associate with flag
                Tag result = apiInstance.createFlagTag(body, flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TagApi.createFlagTag: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiTagApi();
$body = {
  "value" : "production"
}; // CreateTagRequest | 
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->createFlagTag($body, $flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TagApi->createFlagTag: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TagApi;

my $api_instance = WWW::SwaggerClient::TagApi->new();
my $body = WWW::SwaggerClient::Object::CreateTagRequest->new(); # CreateTagRequest | 
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->createFlagTag(body => $body, flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TagApi->createFlagTag: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.TagApi()
body = {
  "value" : "production"
} # CreateTagRequest | 
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Create tag and associate with flag
    api_response = api_instance.create_flag_tag(body, flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TagApi->createFlagTag: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Created tag

Status: 400 - Bad request - invalid input data

Status: 404 - Flag not found

Status: 500 - Internal server error


deleteFlagTag

Remove tag from flag


/flags/{flagId}/tags/{tagId}

Usage and SDK Samples

curl -X DELETE\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/tags/{tagId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TagApi;

import java.io.File;
import java.util.*;

public class TagApiExample {

    public static void main(String[] args) {
        
        TagApi apiInstance = new TagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long tagId = 789; // Long | Numeric ID of the tag
        try {
            apiInstance.deleteFlagTag(flagId, tagId);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#deleteFlagTag");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TagApi;

public class TagApiExample {

    public static void main(String[] args) {
        TagApi apiInstance = new TagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long tagId = 789; // Long | Numeric ID of the tag
        try {
            apiInstance.deleteFlagTag(flagId, tagId);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#deleteFlagTag");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag
Long *tagId = 789; // Numeric ID of the tag

TagApi *apiInstance = [[TagApi alloc] init];

// Remove tag from flag
[apiInstance deleteFlagTagWith:flagId
    tagId:tagId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.TagApi()
var flagId = 789; // {{Long}} Numeric ID of the flag
var tagId = 789; // {{Long}} Numeric ID of the tag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteFlagTag(flagId, tagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteFlagTagExample
    {
        public void main()
        {

            var apiInstance = new TagApi();
            var flagId = 789;  // Long | Numeric ID of the flag
            var tagId = 789;  // Long | Numeric ID of the tag

            try
            {
                // Remove tag from flag
                apiInstance.deleteFlagTag(flagId, tagId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TagApi.deleteFlagTag: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiTagApi();
$flagId = 789; // Long | Numeric ID of the flag
$tagId = 789; // Long | Numeric ID of the tag

try {
    $api_instance->deleteFlagTag($flagId, $tagId);
} catch (Exception $e) {
    echo 'Exception when calling TagApi->deleteFlagTag: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TagApi;

my $api_instance = WWW::SwaggerClient::TagApi->new();
my $flagId = 789; # Long | Numeric ID of the flag
my $tagId = 789; # Long | Numeric ID of the tag

eval { 
    $api_instance->deleteFlagTag(flagId => $flagId, tagId => $tagId);
};
if ($@) {
    warn "Exception when calling TagApi->deleteFlagTag: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.TagApi()
flagId = 789 # Long | Numeric ID of the flag
tagId = 789 # Long | Numeric ID of the tag

try: 
    # Remove tag from flag
    api_instance.delete_flag_tag(flagId, tagId)
except ApiException as e:
    print("Exception when calling TagApi->deleteFlagTag: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
tagId*
Long (int64)
Numeric ID of the tag
Required

Responses

Status: 200 - Tag removed

Status: default - Generic error response


findAllTags

Get all tags


/tags

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/tags?limit=&offset=&value_like="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TagApi;

import java.io.File;
import java.util.*;

public class TagApiExample {

    public static void main(String[] args) {
        
        TagApi apiInstance = new TagApi();
        Long limit = 789; // Long | The numbers of tags to return
        Long offset = 789; // Long | Return tags given the offset
        String valueLike = valueLike_example; // String | Return tags partially matching given value
        try {
            array[Tag] result = apiInstance.findAllTags(limit, offset, valueLike);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#findAllTags");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TagApi;

public class TagApiExample {

    public static void main(String[] args) {
        TagApi apiInstance = new TagApi();
        Long limit = 789; // Long | The numbers of tags to return
        Long offset = 789; // Long | Return tags given the offset
        String valueLike = valueLike_example; // String | Return tags partially matching given value
        try {
            array[Tag] result = apiInstance.findAllTags(limit, offset, valueLike);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#findAllTags");
            e.printStackTrace();
        }
    }
}
Long *limit = 789; // The numbers of tags to return (optional)
Long *offset = 789; // Return tags given the offset (optional) (default to 0)
String *valueLike = valueLike_example; // Return tags partially matching given value (optional)

TagApi *apiInstance = [[TagApi alloc] init];

// Get all tags
[apiInstance findAllTagsWith:limit
    offset:offset
    valueLike:valueLike
              completionHandler: ^(array[Tag] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.TagApi()
var opts = { 
  'limit': 789, // {{Long}} The numbers of tags to return
  'offset': 789, // {{Long}} Return tags given the offset
  'valueLike': valueLike_example // {{String}} Return tags partially matching given value
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findAllTags(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findAllTagsExample
    {
        public void main()
        {

            var apiInstance = new TagApi();
            var limit = 789;  // Long | The numbers of tags to return (optional) 
            var offset = 789;  // Long | Return tags given the offset (optional)  (default to 0)
            var valueLike = valueLike_example;  // String | Return tags partially matching given value (optional) 

            try
            {
                // Get all tags
                array[Tag] result = apiInstance.findAllTags(limit, offset, valueLike);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TagApi.findAllTags: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiTagApi();
$limit = 789; // Long | The numbers of tags to return
$offset = 789; // Long | Return tags given the offset
$valueLike = valueLike_example; // String | Return tags partially matching given value

try {
    $result = $api_instance->findAllTags($limit, $offset, $valueLike);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TagApi->findAllTags: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TagApi;

my $api_instance = WWW::SwaggerClient::TagApi->new();
my $limit = 789; # Long | The numbers of tags to return
my $offset = 789; # Long | Return tags given the offset
my $valueLike = valueLike_example; # String | Return tags partially matching given value

eval { 
    my $result = $api_instance->findAllTags(limit => $limit, offset => $offset, valueLike => $valueLike);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TagApi->findAllTags: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.TagApi()
limit = 789 # Long | The numbers of tags to return (optional)
offset = 789 # Long | Return tags given the offset (optional) (default to 0)
valueLike = valueLike_example # String | Return tags partially matching given value (optional)

try: 
    # Get all tags
    api_response = api_instance.find_all_tags(limit=limit, offset=offset, valueLike=valueLike)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TagApi->findAllTags: %s\n" % e)

Parameters

Query parameters
Name Description
limit
Long (int64)
The numbers of tags to return
offset
Long (int64)
Return tags given the offset
value_like
String
Return tags partially matching given value

Responses

Status: 200 - List of all tags

Status: 400 - Bad request - invalid parameters

Status: 500 - Internal server error


findFlagTags

Get tags for flag


/flags/{flagId}/tags

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/tags"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TagApi;

import java.io.File;
import java.util.*;

public class TagApiExample {

    public static void main(String[] args) {
        
        TagApi apiInstance = new TagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            array[Tag] result = apiInstance.findFlagTags(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#findFlagTags");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.TagApi;

public class TagApiExample {

    public static void main(String[] args) {
        TagApi apiInstance = new TagApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            array[Tag] result = apiInstance.findFlagTags(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TagApi#findFlagTags");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag

TagApi *apiInstance = [[TagApi alloc] init];

// Get tags for flag
[apiInstance findFlagTagsWith:flagId
              completionHandler: ^(array[Tag] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.TagApi()
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findFlagTags(flagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findFlagTagsExample
    {
        public void main()
        {

            var apiInstance = new TagApi();
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Get tags for flag
                array[Tag] result = apiInstance.findFlagTags(flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling TagApi.findFlagTags: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiTagApi();
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->findFlagTags($flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TagApi->findFlagTags: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TagApi;

my $api_instance = WWW::SwaggerClient::TagApi->new();
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->findFlagTags(flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TagApi->findFlagTags: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.TagApi()
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Get tags for flag
    api_response = api_instance.find_flag_tags(flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TagApi->findFlagTags: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required

Responses

Status: 200 - Tags for the flag

Status: 400 - Bad request - invalid flag ID

Status: 404 - Flag not found

Status: 500 - Internal server error


Variant

createVariant

Create variant

Create a variant for the flag. Variants are the possible outcomes of flag evaluation.


/flags/{flagId}/variants

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/variants"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.VariantApi;

import java.io.File;
import java.util.*;

public class VariantApiExample {

    public static void main(String[] args) {
        
        VariantApi apiInstance = new VariantApi();
        CreateVariantRequest body = {
  "key" : "treatment",
  "attachment" : {
    "color" : "blue",
    "size" : "large"
  }
}; // CreateVariantRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Variant result = apiInstance.createVariant(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#createVariant");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.VariantApi;

public class VariantApiExample {

    public static void main(String[] args) {
        VariantApi apiInstance = new VariantApi();
        CreateVariantRequest body = {
  "key" : "treatment",
  "attachment" : {
    "color" : "blue",
    "size" : "large"
  }
}; // CreateVariantRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            Variant result = apiInstance.createVariant(body, flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#createVariant");
            e.printStackTrace();
        }
    }
}
CreateVariantRequest *body = {
  "key" : "treatment",
  "attachment" : {
    "color" : "blue",
    "size" : "large"
  }
}; // 
Long *flagId = 789; // Numeric ID of the flag

VariantApi *apiInstance = [[VariantApi alloc] init];

// Create variant
[apiInstance createVariantWith:body
    flagId:flagId
              completionHandler: ^(Variant output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.VariantApi()
var body = {
  "key" : "treatment",
  "attachment" : {
    "color" : "blue",
    "size" : "large"
  }
}; // {{CreateVariantRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createVariant(bodyflagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createVariantExample
    {
        public void main()
        {

            var apiInstance = new VariantApi();
            var body = new CreateVariantRequest(); // CreateVariantRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Create variant
                Variant result = apiInstance.createVariant(body, flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VariantApi.createVariant: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiVariantApi();
$body = {
  "key" : "treatment",
  "attachment" : {
    "color" : "blue",
    "size" : "large"
  }
}; // CreateVariantRequest | 
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->createVariant($body, $flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VariantApi->createVariant: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::VariantApi;

my $api_instance = WWW::SwaggerClient::VariantApi->new();
my $body = WWW::SwaggerClient::Object::CreateVariantRequest->new(); # CreateVariantRequest | 
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->createVariant(body => $body, flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling VariantApi->createVariant: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.VariantApi()
body = {
  "key" : "treatment",
  "attachment" : {
    "color" : "blue",
    "size" : "large"
  }
} # CreateVariantRequest | 
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Create variant
    api_response = api_instance.create_variant(body, flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling VariantApi->createVariant: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Created variant

Status: 400 - Bad request - invalid input data

Status: 404 - Flag not found

Status: 500 - Internal server error


deleteVariant

Delete variant

Delete a variant. This will also remove it from all distributions.


/flags/{flagId}/variants/{variantId}

Usage and SDK Samples

curl -X DELETE\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/variants/{variantId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.VariantApi;

import java.io.File;
import java.util.*;

public class VariantApiExample {

    public static void main(String[] args) {
        
        VariantApi apiInstance = new VariantApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long variantId = 789; // Long | Numeric ID of the variant
        try {
            apiInstance.deleteVariant(flagId, variantId);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#deleteVariant");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.VariantApi;

public class VariantApiExample {

    public static void main(String[] args) {
        VariantApi apiInstance = new VariantApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        Long variantId = 789; // Long | Numeric ID of the variant
        try {
            apiInstance.deleteVariant(flagId, variantId);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#deleteVariant");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag
Long *variantId = 789; // Numeric ID of the variant

VariantApi *apiInstance = [[VariantApi alloc] init];

// Delete variant
[apiInstance deleteVariantWith:flagId
    variantId:variantId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.VariantApi()
var flagId = 789; // {{Long}} Numeric ID of the flag
var variantId = 789; // {{Long}} Numeric ID of the variant

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteVariant(flagId, variantId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteVariantExample
    {
        public void main()
        {

            var apiInstance = new VariantApi();
            var flagId = 789;  // Long | Numeric ID of the flag
            var variantId = 789;  // Long | Numeric ID of the variant

            try
            {
                // Delete variant
                apiInstance.deleteVariant(flagId, variantId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VariantApi.deleteVariant: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiVariantApi();
$flagId = 789; // Long | Numeric ID of the flag
$variantId = 789; // Long | Numeric ID of the variant

try {
    $api_instance->deleteVariant($flagId, $variantId);
} catch (Exception $e) {
    echo 'Exception when calling VariantApi->deleteVariant: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::VariantApi;

my $api_instance = WWW::SwaggerClient::VariantApi->new();
my $flagId = 789; # Long | Numeric ID of the flag
my $variantId = 789; # Long | Numeric ID of the variant

eval { 
    $api_instance->deleteVariant(flagId => $flagId, variantId => $variantId);
};
if ($@) {
    warn "Exception when calling VariantApi->deleteVariant: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.VariantApi()
flagId = 789 # Long | Numeric ID of the flag
variantId = 789 # Long | Numeric ID of the variant

try: 
    # Delete variant
    api_instance.delete_variant(flagId, variantId)
except ApiException as e:
    print("Exception when calling VariantApi->deleteVariant: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
variantId*
Long (int64)
Numeric ID of the variant
Required

Responses

Status: 200 - Variant deleted successfully

Status: 400 - Bad request - invalid IDs

Status: 404 - Flag or variant not found

Status: 500 - Internal server error


findVariants

Get variants for flag


/flags/{flagId}/variants

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/variants"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.VariantApi;

import java.io.File;
import java.util.*;

public class VariantApiExample {

    public static void main(String[] args) {
        
        VariantApi apiInstance = new VariantApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            array[Variant] result = apiInstance.findVariants(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#findVariants");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.VariantApi;

public class VariantApiExample {

    public static void main(String[] args) {
        VariantApi apiInstance = new VariantApi();
        Long flagId = 789; // Long | Numeric ID of the flag
        try {
            array[Variant] result = apiInstance.findVariants(flagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#findVariants");
            e.printStackTrace();
        }
    }
}
Long *flagId = 789; // Numeric ID of the flag

VariantApi *apiInstance = [[VariantApi alloc] init];

// Get variants for flag
[apiInstance findVariantsWith:flagId
              completionHandler: ^(array[Variant] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.VariantApi()
var flagId = 789; // {{Long}} Numeric ID of the flag

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findVariants(flagId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findVariantsExample
    {
        public void main()
        {

            var apiInstance = new VariantApi();
            var flagId = 789;  // Long | Numeric ID of the flag

            try
            {
                // Get variants for flag
                array[Variant] result = apiInstance.findVariants(flagId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VariantApi.findVariants: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiVariantApi();
$flagId = 789; // Long | Numeric ID of the flag

try {
    $result = $api_instance->findVariants($flagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VariantApi->findVariants: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::VariantApi;

my $api_instance = WWW::SwaggerClient::VariantApi->new();
my $flagId = 789; # Long | Numeric ID of the flag

eval { 
    my $result = $api_instance->findVariants(flagId => $flagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling VariantApi->findVariants: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.VariantApi()
flagId = 789 # Long | Numeric ID of the flag

try: 
    # Get variants for flag
    api_response = api_instance.find_variants(flagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling VariantApi->findVariants: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required

Responses

Status: 200 - Variants ordered by variantID

Status: 400 - Bad request - invalid flag ID

Status: 404 - Flag not found

Status: 500 - Internal server error


putVariant

Update variant


/flags/{flagId}/variants/{variantId}

Usage and SDK Samples

curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:18000/api/v1/flags/{flagId}/variants/{variantId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.VariantApi;

import java.io.File;
import java.util.*;

public class VariantApiExample {

    public static void main(String[] args) {
        
        VariantApi apiInstance = new VariantApi();
        PutVariantRequest body = {
  "key" : "treatment_updated",
  "attachment" : {
    "color" : "red",
    "size" : "small"
  }
}; // PutVariantRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long variantId = 789; // Long | Numeric ID of the variant
        try {
            Variant result = apiInstance.putVariant(body, flagId, variantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#putVariant");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.VariantApi;

public class VariantApiExample {

    public static void main(String[] args) {
        VariantApi apiInstance = new VariantApi();
        PutVariantRequest body = {
  "key" : "treatment_updated",
  "attachment" : {
    "color" : "red",
    "size" : "small"
  }
}; // PutVariantRequest | 
        Long flagId = 789; // Long | Numeric ID of the flag
        Long variantId = 789; // Long | Numeric ID of the variant
        try {
            Variant result = apiInstance.putVariant(body, flagId, variantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling VariantApi#putVariant");
            e.printStackTrace();
        }
    }
}
PutVariantRequest *body = {
  "key" : "treatment_updated",
  "attachment" : {
    "color" : "red",
    "size" : "small"
  }
}; // 
Long *flagId = 789; // Numeric ID of the flag
Long *variantId = 789; // Numeric ID of the variant

VariantApi *apiInstance = [[VariantApi alloc] init];

// Update variant
[apiInstance putVariantWith:body
    flagId:flagId
    variantId:variantId
              completionHandler: ^(Variant output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FlagentApi = require('flagent_api');

var api = new FlagentApi.VariantApi()
var body = {
  "key" : "treatment_updated",
  "attachment" : {
    "color" : "red",
    "size" : "small"
  }
}; // {{PutVariantRequest}} 
var flagId = 789; // {{Long}} Numeric ID of the flag
var variantId = 789; // {{Long}} Numeric ID of the variant

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putVariant(bodyflagIdvariantId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putVariantExample
    {
        public void main()
        {

            var apiInstance = new VariantApi();
            var body = new PutVariantRequest(); // PutVariantRequest | 
            var flagId = 789;  // Long | Numeric ID of the flag
            var variantId = 789;  // Long | Numeric ID of the variant

            try
            {
                // Update variant
                Variant result = apiInstance.putVariant(body, flagId, variantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VariantApi.putVariant: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiVariantApi();
$body = {
  "key" : "treatment_updated",
  "attachment" : {
    "color" : "red",
    "size" : "small"
  }
}; // PutVariantRequest | 
$flagId = 789; // Long | Numeric ID of the flag
$variantId = 789; // Long | Numeric ID of the variant

try {
    $result = $api_instance->putVariant($body, $flagId, $variantId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VariantApi->putVariant: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::VariantApi;

my $api_instance = WWW::SwaggerClient::VariantApi->new();
my $body = WWW::SwaggerClient::Object::PutVariantRequest->new(); # PutVariantRequest | 
my $flagId = 789; # Long | Numeric ID of the flag
my $variantId = 789; # Long | Numeric ID of the variant

eval { 
    my $result = $api_instance->putVariant(body => $body, flagId => $flagId, variantId => $variantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling VariantApi->putVariant: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.VariantApi()
body = {
  "key" : "treatment_updated",
  "attachment" : {
    "color" : "red",
    "size" : "small"
  }
} # PutVariantRequest | 
flagId = 789 # Long | Numeric ID of the flag
variantId = 789 # Long | Numeric ID of the variant

try: 
    # Update variant
    api_response = api_instance.put_variant(body, flagId, variantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling VariantApi->putVariant: %s\n" % e)

Parameters

Path parameters
Name Description
flagId*
Long (int64)
Numeric ID of the flag
Required
variantId*
Long (int64)
Numeric ID of the variant
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Updated variant

Status: 400 - Bad request - invalid input data

Status: 404 - Flag or variant not found

Status: 500 - Internal server error