C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.Experiments.ListAsync(
new ListExperimentsRequestParameters {
From = "from",
Take = 1,
Status = ExperimentStatusEnum.Draft,
AuthenticationFlow = "authentication_flow",
FeatureFlagId = "feature_flag_id"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.ListExperimentsRequestParameters;
import com.auth0.client.mgmt.types.ExperimentStatusEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().experiments().list(
ListExperimentsRequestParameters
.builder()
.from("from")
.take(1)
.status(ExperimentStatusEnum.DRAFT)
.authenticationFlow("authentication_flow")
.featureFlagId("feature_flag_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Experiments\Requests\ListExperimentsRequestParameters;
use Auth0\SDK\API\Management\Types\ExperimentStatusEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->experiments->list(
new ListExperimentsRequestParameters([
'from' => 'from',
'take' => 1,
'status' => ExperimentStatusEnum::Draft->value,
'authenticationFlow' => 'authentication_flow',
'featureFlagId' => 'feature_flag_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.experiments.list(
from="from",
take=1,
status="draft",
authentication_flow="authentication_flow",
feature_flag_id="feature_flag_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.experiments.list(
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/experiments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"experiments": [
{
"id": "<string>",
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": {
"subject": "device"
},
"is_valid": true,
"allocations": [
{
"variation_id": "<string>",
"segment_id": "<string>",
"weight": 123,
"priority": 123,
"is_control": true,
"is_fallback": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}
],
"next": "<string>"
}List experiments for the tenant.
Retrieve a paginated list of experiments for the tenant, with optional filters.
GET
https://{tenantDomain}/api/v2
/
experimentation
/
experiments
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Experimentation;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Experimentation.Experiments.ListAsync(
new ListExperimentsRequestParameters {
From = "from",
Take = 1,
Status = ExperimentStatusEnum.Draft,
AuthenticationFlow = "authentication_flow",
FeatureFlagId = "feature_flag_id"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.experimentation.types.ListExperimentsRequestParameters;
import com.auth0.client.mgmt.types.ExperimentStatusEnum;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.experimentation().experiments().list(
ListExperimentsRequestParameters
.builder()
.from("from")
.take(1)
.status(ExperimentStatusEnum.DRAFT)
.authenticationFlow("authentication_flow")
.featureFlagId("feature_flag_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Experimentation\Experiments\Requests\ListExperimentsRequestParameters;
use Auth0\SDK\API\Management\Types\ExperimentStatusEnum;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->experimentation->experiments->list(
new ListExperimentsRequestParameters([
'from' => 'from',
'take' => 1,
'status' => ExperimentStatusEnum::Draft->value,
'authenticationFlow' => 'authentication_flow',
'featureFlagId' => 'feature_flag_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.experimentation.experiments.list(
from="from",
take=1,
status="draft",
authentication_flow="authentication_flow",
feature_flag_id="feature_flag_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.experimentation.experiments.list(
from: "from",
take: 1,
status: "draft",
authentication_flow: "authentication_flow",
feature_flag_id: "feature_flag_id"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/experimentation/experiments \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenantDomain}/api/v2/experimentation/experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/experimentation/experiments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"experiments": [
{
"id": "<string>",
"name": "<string>",
"feature_flag_id": "<string>",
"authentication_flow": "<string>",
"assignment_config": {
"subject": "device"
},
"is_valid": true,
"allocations": [
{
"variation_id": "<string>",
"segment_id": "<string>",
"weight": 123,
"priority": 123,
"is_control": true,
"is_fallback": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}
],
"next": "<string>"
}Autorisations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de requête
Optional Id from which to start selection.
Number of experiments to return per page. Defaults to 25, maximum 50.
Plage requise:
1 <= x <= 50Filter by status. Exact match.
Options disponibles:
draft, active, paused, completed, archived Filter by authentication flow. Exact match.
Filter by feature flag ID. Exact match.
Subscribe to events via Server-Sent Events (SSE)
Précédent
Create an experiment for the Experiment Center.
Suivant
⌘I