curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allocations": [
{
"is_control": true,
"variation_id": "<string>",
"is_fallback": true,
"priority": 2,
"segment_id": "<string>",
"weight": 50
}
],
"assignment_config": {
"subject": "device"
},
"authentication_flow": "<string>",
"feature_flag_id": "<string>",
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/experimentation/experiments"
payload = {
"allocations": [
{
"is_control": True,
"variation_id": "<string>",
"is_fallback": True,
"priority": 2,
"segment_id": "<string>",
"weight": 50
}
],
"assignment_config": { "subject": "device" },
"authentication_flow": "<string>",
"feature_flag_id": "<string>",
"name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allocations: [
{
is_control: true,
variation_id: '<string>',
is_fallback: true,
priority: 2,
segment_id: '<string>',
weight: 50
}
],
assignment_config: {subject: 'device'},
authentication_flow: '<string>',
feature_flag_id: '<string>',
name: '<string>',
description: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/experimentation/experiments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allocations' => [
[
'is_control' => true,
'variation_id' => '<string>',
'is_fallback' => true,
'priority' => 2,
'segment_id' => '<string>',
'weight' => 50
]
],
'assignment_config' => [
'subject' => 'device'
],
'authentication_flow' => '<string>',
'feature_flag_id' => '<string>',
'name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/experiments"
payload := strings.NewReader("{\n \"allocations\": [\n {\n \"is_control\": true,\n \"variation_id\": \"<string>\",\n \"is_fallback\": true,\n \"priority\": 2,\n \"segment_id\": \"<string>\",\n \"weight\": 50\n }\n ],\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"authentication_flow\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/experimentation/experiments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allocations\": [\n {\n \"is_control\": true,\n \"variation_id\": \"<string>\",\n \"is_fallback\": true,\n \"priority\": 2,\n \"segment_id\": \"<string>\",\n \"weight\": 50\n }\n ],\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"authentication_flow\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/experimentation/experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allocations\": [\n {\n \"is_control\": true,\n \"variation_id\": \"<string>\",\n \"is_fallback\": true,\n \"priority\": 2,\n \"segment_id\": \"<string>\",\n \"weight\": 50\n }\n ],\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"authentication_flow\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"allocations": [
{
"is_control": true,
"is_fallback": true,
"priority": 123,
"segment_id": "<string>",
"variation_id": "<string>",
"weight": 123
}
],
"assignment_config": {
"subject": "device"
},
"authentication_flow": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"feature_flag_id": "<string>",
"id": "<string>",
"is_valid": true,
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z"
}Créer une expérience
Créer une nouvelle expérience avec des allocations de trafic pour des tests A/B.
curl --request POST \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allocations": [
{
"is_control": true,
"variation_id": "<string>",
"is_fallback": true,
"priority": 2,
"segment_id": "<string>",
"weight": 50
}
],
"assignment_config": {
"subject": "device"
},
"authentication_flow": "<string>",
"feature_flag_id": "<string>",
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/experimentation/experiments"
payload = {
"allocations": [
{
"is_control": True,
"variation_id": "<string>",
"is_fallback": True,
"priority": 2,
"segment_id": "<string>",
"weight": 50
}
],
"assignment_config": { "subject": "device" },
"authentication_flow": "<string>",
"feature_flag_id": "<string>",
"name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allocations: [
{
is_control: true,
variation_id: '<string>',
is_fallback: true,
priority: 2,
segment_id: '<string>',
weight: 50
}
],
assignment_config: {subject: 'device'},
authentication_flow: '<string>',
feature_flag_id: '<string>',
name: '<string>',
description: '<string>'
})
};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/experimentation/experiments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allocations' => [
[
'is_control' => true,
'variation_id' => '<string>',
'is_fallback' => true,
'priority' => 2,
'segment_id' => '<string>',
'weight' => 50
]
],
'assignment_config' => [
'subject' => 'device'
],
'authentication_flow' => '<string>',
'feature_flag_id' => '<string>',
'name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/experiments"
payload := strings.NewReader("{\n \"allocations\": [\n {\n \"is_control\": true,\n \"variation_id\": \"<string>\",\n \"is_fallback\": true,\n \"priority\": 2,\n \"segment_id\": \"<string>\",\n \"weight\": 50\n }\n ],\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"authentication_flow\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/experimentation/experiments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allocations\": [\n {\n \"is_control\": true,\n \"variation_id\": \"<string>\",\n \"is_fallback\": true,\n \"priority\": 2,\n \"segment_id\": \"<string>\",\n \"weight\": 50\n }\n ],\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"authentication_flow\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/experimentation/experiments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allocations\": [\n {\n \"is_control\": true,\n \"variation_id\": \"<string>\",\n \"is_fallback\": true,\n \"priority\": 2,\n \"segment_id\": \"<string>\",\n \"weight\": 50\n }\n ],\n \"assignment_config\": {\n \"subject\": \"device\"\n },\n \"authentication_flow\": \"<string>\",\n \"feature_flag_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"allocations": [
{
"is_control": true,
"is_fallback": true,
"priority": 123,
"segment_id": "<string>",
"variation_id": "<string>",
"weight": 123
}
],
"assignment_config": {
"subject": "device"
},
"authentication_flow": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"feature_flag_id": "<string>",
"id": "<string>",
"is_valid": true,
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"ended_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
Créer une expérience avec répartition du trafic
La stratégie de répartition du trafic pour cette expérience
percentage, segment Répartition du trafic associant les variantes à des pondérations ou à des segments
1Show child attributes
Show child attributes
Configuration de l’attribution des utilisateurs aux variantes
Show child attributes
Show child attributes
Le flux d’authentification auquel cette expérience s’applique
L’ID de l’indicateur de fonctionnalité sur lequel cette expérience est basée
^flg_[A-HJ-NP-Za-km-z1-9]+$Un nom en langage clair pour l’expérience
3 - 255^(?!.*\x00)\S(.*\S)?$Une description de l’expérience
3 - 1024^(?!.*\x00)\S(.*\S)?$Réponse
Expérience créée avec succès.
percentage, segment Show child attributes
Show child attributes
Show child attributes
Show child attributes
^exp_[A-HJ-NP-Za-km-z1-9]+$Filtrer par statut. Correspondance exacte.
draft, active, paused, completed, archived