Conclude experiment
# ---------------------------------------------------------------------------- #
# Conclude experiment. #
# ---------------------------------------------------------------------------- #
PATCH {{flagsUrl}}/projects/{{projectId}}/flags/{{flagKey}}/environments/{{environment}}/ruleset
Content-Type: application/json
Authorization: {{token}}
[
{
"op": "replace",
"path": "/rules/stock_message_test/status",
"value": "concluded"
},
{
"op": "replace",
"path": "/rules/stock_message_test/outcome",
"value": "positive"
},
{
"op": "replace",
"path": "/rules/stock_message_test/comment",
"value": "We saw a statistically significant uplift with the \"On Show Amounts Red\" variation!"
},
{
"op": "replace",
"path": "/rules/stock_message_test/deployed_variation_key",
"value": "on_show_amounts_red"
},
{
"op": "replace",
"path": "/rules/stock_message_test/deployed_td_rule_percentage_included",
"value": 10000
},
{
"op": "replace",
"path": "/rules/stock_message_test/deployed_td_rule_audience_conditions",
"value": []
}
]Stop your flag and conclude your experiment using the Update the Ruleset for a Flag in an Environment API endpoint.
Prerequisite
Before running this request, you must follow the instructions to configure your REST API cookbook.
Create a file
Create a file named conclude-experiment.rest and copy and paste the recipe into the file.
Configure API
{{flagsUrl}}, {{projectId}}, {{flagKey}}, {{environment}}, and {{token}} are defined in the settings.json file. Ensure you have configured your Visual Studio Code project correctly. See Configure the Visual Studio Code REST Client.
PATCH {{flagsUrl}}/projects/{{projectId}}/flags/{{flagKey}}/environments/{{environment}}/ruleset
Content-Type: application/json
Authorization: {{token}}Update rule's status
Update the stock_message_test rule's status to concluded.
- op (operation) – This is a replace.
- path – A JSON-Pointer to the resource or the resource attribute.
- value – Replace to concluded.
{
"op": "replace",
"path": "/rules/stock_message_test/status",
"value": "concluded"
},Update rule's outcome
Update the stock_message_test rule's outcome to positive.
- op (operation) – This is a replace.
- path – A JSON-Pointer to the resource or the resource attribute.
- value – Replace to positive.
{
"op": "replace",
"path": "/rules/stock_message_test/outcome",
"value": "positive"
},Add a comment to the outcome
Update the stock_message_test rule's comment to We saw a statistically significant uplift with the "On Show Amounts Red" variation!.
- op (operation) – This is a replace.
- path – A JSON-Pointer to the resource or the resource attribute.
- value – Add outcome message.
The three previous steps correspond to the following in the UI:
{
"op": "replace",
"path": "/rules/stock_message_test/comment",
"value": "We saw a statistically significant uplift with the \"On Show Amounts Red\" variation!"
},Change deployed variation
Deploy the winning variation by updating the variation key to on_show_amounts_red.
- op (operation) – This is a replace.
- path – A JSON-Pointer to the resource or the resource attribute.
- value – Replace to on_show_amounts_red variation.
{
"op": "replace",
"path": "/rules/stock_message_test/deployed_variation_key",
"value": "on_show_amounts_red"
},Change percentage included
Deploy the winning variation to 100% of the audience.
- op (operation) – This is a replace.
- path – A JSON-Pointer to the resource or the resource attribute.
- value – Change percentage included.
{
"op": "replace",
"path": "/rules/stock_message_test/deployed_td_rule_percentage_included",
"value": 10000
},Change audience
Update the audience to everyone.
- op (operation) – This is a replace.
- path – A JSON-Pointer to the resource or the resource attribute.
- value – Change the audience to empty.
The three previous steps correspond to the following in the UI:
{
"op": "replace",
"path": "/rules/stock_message_test/deployed_td_rule_audience_conditions",
"value": []
}Send request
Click Send Request in Visual Studio Code. See the REST Client's documentation on usage for information on how to send requests using the REST Client extension.