bucketingGet
Get Experiments and Variations for the user.
Returns a key/value pairing of all experiments that the user has been segmented into, as well as the variation the users are assigned. If there are no experiments currently being delivered to the user, an empty response will be returned.
/bucketing
Usage and SDK Samples
curl -X GET \
-H "Accept: application/json" \
"https://universal-api.taplytics.com/v1/bucketing?token=token_example&user_id=userId_example&verbose=true&attributes=&customData=Object"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BucketingApi;
import java.io.File;
import java.util.*;
public class BucketingApiExample {
public static void main(String[] args) {
// Create an instance of the API class
BucketingApi apiInstance = new BucketingApi();
String token = token_example; // String | SDK token for the project
String userId = userId_example; // String | ID for current user
UserAttributes attributes = ; // UserAttributes | serialized attributes object
Object customData = Object; // Object | serialized custom data object
Boolean verbose = true; // Boolean | Flag to return object of experiments and variations with variables
try {
apiInstance.bucketingGet(token, userId, attributes, customData, verbose);
} catch (ApiException e) {
System.err.println("Exception when calling BucketingApi#bucketingGet");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String token = new String(); // String | SDK token for the project
final String userId = new String(); // String | ID for current user
final UserAttributes attributes = new UserAttributes(); // UserAttributes | serialized attributes object
final Object customData = new Object(); // Object | serialized custom data object
final Boolean verbose = new Boolean(); // Boolean | Flag to return object of experiments and variations with variables
try {
final result = await api_instance.bucketingGet(token, userId, attributes, customData, verbose);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->bucketingGet: $e\n');
}
import org.openapitools.client.api.BucketingApi;
public class BucketingApiExample {
public static void main(String[] args) {
BucketingApi apiInstance = new BucketingApi();
String token = token_example; // String | SDK token for the project
String userId = userId_example; // String | ID for current user
UserAttributes attributes = ; // UserAttributes | serialized attributes object
Object customData = Object; // Object | serialized custom data object
Boolean verbose = true; // Boolean | Flag to return object of experiments and variations with variables
try {
apiInstance.bucketingGet(token, userId, attributes, customData, verbose);
} catch (ApiException e) {
System.err.println("Exception when calling BucketingApi#bucketingGet");
e.printStackTrace();
}
}
}
// Create an instance of the API class
BucketingApi *apiInstance = [[BucketingApi alloc] init];
String *token = token_example; // SDK token for the project (default to null)
String *userId = userId_example; // ID for current user (default to null)
UserAttributes *attributes = ; // serialized attributes object (default to null)
Object *customData = Object; // serialized custom data object (default to null)
Boolean *verbose = true; // Flag to return object of experiments and variations with variables (optional) (default to null)
// Get Experiments and Variations for the user.
[apiInstance bucketingGetWith:token
userId:userId
attributes:attributes
customData:customData
verbose:verbose
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var TaplyticsUniversalApi = require('taplytics_universal_api');
// Create an instance of the API class
var api = new TaplyticsUniversalApi.BucketingApi()
var token = token_example; // {String} SDK token for the project
var userId = userId_example; // {String} ID for current user
var attributes = ; // {UserAttributes} serialized attributes object
var customData = Object; // {Object} serialized custom data object
var opts = {
'verbose': true // {Boolean} Flag to return object of experiments and variations with variables
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.bucketingGet(token, userId, attributes, customData, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class bucketingGetExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new BucketingApi();
var token = token_example; // String | SDK token for the project (default to null)
var userId = userId_example; // String | ID for current user (default to null)
var attributes = new UserAttributes(); // UserAttributes | serialized attributes object (default to null)
var customData = new Object(); // Object | serialized custom data object (default to null)
var verbose = true; // Boolean | Flag to return object of experiments and variations with variables (optional) (default to null)
try {
// Get Experiments and Variations for the user.
apiInstance.bucketingGet(token, userId, attributes, customData, verbose);
} catch (Exception e) {
Debug.Print("Exception when calling BucketingApi.bucketingGet: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BucketingApi();
$token = token_example; // String | SDK token for the project
$userId = userId_example; // String | ID for current user
$attributes = ; // UserAttributes | serialized attributes object
$customData = Object; // Object | serialized custom data object
$verbose = true; // Boolean | Flag to return object of experiments and variations with variables
try {
$api_instance->bucketingGet($token, $userId, $attributes, $customData, $verbose);
} catch (Exception $e) {
echo 'Exception when calling BucketingApi->bucketingGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BucketingApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BucketingApi->new();
my $token = token_example; # String | SDK token for the project
my $userId = userId_example; # String | ID for current user
my $attributes = ; # UserAttributes | serialized attributes object
my $customData = Object; # Object | serialized custom data object
my $verbose = true; # Boolean | Flag to return object of experiments and variations with variables
eval {
$api_instance->bucketingGet(token => $token, userId => $userId, attributes => $attributes, customData => $customData, verbose => $verbose);
};
if ($@) {
warn "Exception when calling BucketingApi->bucketingGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.BucketingApi()
token = token_example # String | SDK token for the project (default to null)
userId = userId_example # String | ID for current user (default to null)
attributes = # UserAttributes | serialized attributes object (default to null)
customData = Object # Object | serialized custom data object (default to null)
verbose = true # Boolean | Flag to return object of experiments and variations with variables (optional) (default to null)
try:
# Get Experiments and Variations for the user.
api_instance.bucketing_get(token, userId, attributes, customData, verbose=verbose)
except ApiException as e:
print("Exception when calling BucketingApi->bucketingGet: %s\n" % e)
extern crate BucketingApi;
pub fn main() {
let token = token_example; // String
let userId = userId_example; // String
let attributes = ; // UserAttributes
let customData = Object; // Object
let verbose = true; // Boolean
let mut context = BucketingApi::Context::default();
let result = client.bucketingGet(token, userId, attributes, customData, verbose, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
token* |
String
SDK token for the project
Required
|
user_id* |
String
ID for current user
Required
|
verbose |
Boolean
Flag to return object of experiments and variations with variables
|
attributes* |
UserAttributes
serialized attributes object
Required
|
customData* |
Object
serialized custom data object
Required
|