Question
Using Admin API it is possible to fetch the Split definitions. Is it possible to fetch the Split Definitions for one Environment only using the SDK API Key?
Answer
It is possible to use the SDK HTTP call to fetch all the Splits definitions that are added to the Environment's SDK API Key.
Important Note: This call is not published, therefore the structure might change without notice.
The curl below will fetch all Splits information in a JSON structure, the payload is gzipped:
curl -H "Authorization: Bearer [SDK APIKey]" -H "Accept-Encoding: gzip, deflate, br" -H "Accept: application/json" https://sdk.split.io/api/splitChanges?since=-1 | gunzip
An example of response shown below.
{
"splits":[
{
"trafficTypeName":"account",
"name":"sample_feature",
"trafficAllocation":100,
"trafficAllocationSeed":-554128485,
"seed":1569859022,
"status":"ACTIVE",
"killed":false,
"defaultTreatment":"off",
"changeNumber":1580851834698,
"algo":2,
"configurations":{
"off":"{\"off_key\":\"off_value\"}",
"on":"{\"On_key1\":\"on_value1\",\"On_Key2\":\"on_value2\"}"
},
"conditions":[
{
"conditionType":"WHITELIST",
"matcherGroup":{
"combiner":"AND",
"matchers":[
{
"keySelector":null,
"matcherType":"WHITELIST",
"negate":false,
"userDefinedSegmentMatcherData":null,
"whitelistMatcherData":{
"whitelist":[
"bob"
]
},
"unaryNumericMatcherData":null,
"betweenMatcherData":null,
"booleanMatcherData":null,
"dependencyMatcherData":null,
"stringMatcherData":null
}
]},
"partitions":[
{
"treatment":"on",
"size":100
}],
"label":"whitelisted"
},
{
"conditionType":"ROLLOUT",
"matcherGroup":{
"combiner":"AND",
"matchers":[
{
"keySelector":{
"trafficType":"account",
"attribute":"country"
},
"matcherType":"WHITELIST",
"negate":false,
"userDefinedSegmentMatcherData":null,
"whitelistMatcherData":{
"whitelist":[
"US"
]
},
"unaryNumericMatcherData":null,
"betweenMatcherData":null,
"booleanMatcherData":null,
"dependencyMatcherData":null,
"stringMatcherData":null
}]
},
"partitions":[
{
"treatment":"on",
"size":100
},
{
"treatment":"off",
"size":0
}],
"label":"country in list [US]"
},
{
"conditionType":"ROLLOUT",
"matcherGroup":{
"combiner":"AND",
"matchers":[
{
"keySelector":{
"trafficType":"account",
"attribute":null
},
"matcherType":"ALL_KEYS",
"negate":false,
"userDefinedSegmentMatcherData":null,
"whitelistMatcherData":null,
"unaryNumericMatcherData":null,
"betweenMatcherData":null,
"booleanMatcherData":null,
"dependencyMatcherData":null,
"stringMatcherData":null
}]
},
"partitions":[
{
"treatment":"on",
"size":0
},
{
"treatment":"off",
"size":100
}],
"label":"default rule"
}]
},
],
"since":1572295747543,
"till":1580851834698
}
Comments
0 comments
Please sign in to leave a comment.