Get a variant
import requests
url = "https://{FUSION HOST}/api/experiments/{id}/variant"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"collection": "<string>",
"queryPipeline": "<string>",
"params": [
{
"key": "<string>",
"value": "<string>"
}
],
"weight": 123
}Get a variant
Get the variant that would be picked for a given user ID. This is useful for debugging. Note that this assumes all traffic is routed to the experiment.
GET
/
experiments
/
{id}
/
variant
Get a variant
import requests
url = "https://{FUSION HOST}/api/experiments/{id}/variant"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"collection": "<string>",
"queryPipeline": "<string>",
"params": [
{
"key": "<string>",
"value": "<string>"
}
],
"weight": 123
}Authorizations
Basic authAPI key
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The ID of the experiment from which to pick a variant. Use /experiments to get experiment IDs.
Query Parameters
The name of the field containing the user ID for which to pick a variant.
Response
200 - */*
OK
The experiment variant ID.
The experiment variant name.
The data collection associated with this experiment variant.
The query pipeline associated with this experiment variant.
Show child attributes
Show child attributes
This variant's traffic weight.
Was this page helpful?
⌘I