{"swagger":"2.0","info":{"description":"Planned API design for 719 - A/B Variations","version":"1.0.0","title":"719 - A/B Variations - API"},"host":"api","basePath":"/","tags":[{"name":"A/B Variations","description":"Retrieve / Update A/B Variations."}],"schemes":["https","http"],"paths":{"/AllVariationTypesAndVariations":{"get":{"tags":["A/B Variations"],"summary":"Gets the list of all A/B Variation Types and Variations under each Type, that are valid for current date/time.","operationId":"getAllVariationsUnderAllVariationTypes","produces":["application/json"],"parameters":[],"responses":{"200":{"description":"Successful operation.","schema":{"type":"array","items":{"$ref":"#/definitions/VariationTypes"}}},"404":{"description":"No A/B Variations found."}}}},"/GetVariationDetails":{"get":{"tags":["A/B Variations"],"summary":"Gets all the variations in a specific VariationType.","operationId":"getVariationDetails","produces":["application/json"],"parameters":[{"in":"query","name":"variantTypeName","schema":{"type":"string"},"example":"MiTek Variation"}],"responses":{"200":{"description":"Successful operation.","schema":{"type":"array","items":{"$ref":"#/definitions/Variations"}}},"404":{"description":"No A/B Variations found."}}}},"/SaveVariation":{"put":{"tags":["A/B Variations"],"description":"Retrieve A/B Variation Types and their corresponding Variations.","summary":"Updates the Percentage information of Varitions in a given VariationType.","operationId":"saveVariation","parameters":[{"in":"body","name":"variations","description":"All Variations under a given Variation Type.","schema":{"type":"object","required":true,"$ref":"#/definitions/Variations"}}],"responses":{"201":{"description":"Successfully saved.","content":{"application/json":{"schema":{"type":"object","items":{"$ref":"#/definitions/Variations"}}}}},"405":{"description":"Validation exception. The sum of all the weights does not add up to 100%."},"500":{"description":"Unable to save Variation."}}}}},"definitions":{"VariationType":{"type":"object","properties":{"variationTypeId":{"type":"integer","format":"uint64","example":1,"description":"Identifier of the A/B Variation type."},"variationTypeName":{"type":"string","example":"MiTek A/B Variation","description":"Name of the A/B Variation type."},"start":{"type":"string","example":"2022-08-21 16:33:25.540","description":"Start date of the A/B Variation type."},"end":{"type":"string","example":"2022-08-21 16:33:25.540","description":"End date of the A/B Variation type."},"variations":{"type":"array","description":"List of all variations under the given Variation Type.","items":{"$ref":"#/definitions/Variation"}}}},"Variation":{"type":"object","required":["name","userPercentage"],"properties":{"variationTypeId":{"type":"integer","format":"uint64","example":1,"description":"Identifier of the A/B Variation type."},"variationId":{"type":"integer","format":"uint64","example":1,"description":"Auto-generated identifier of the A/B Variation type."},"name":{"type":"string","example":"Mandatory","description":"Name of the A/B Variation sub-type. Alphanumeric, between 3 and 20 characters."},"userPercentage":{"type":"integer","format":"unit64","example":60,"description":"Percentage of users on a given A/B Variation sub-type. Numeric, between 0 and 100."}}},"Variations":{"type":"object","properties":{"variationTypeId":{"type":"integer","description":"Variation Type Id to which the variation items belong."},"variationItems":{"type":"array","example":[{"id":1,"name":"Mandatory","userPercentage":"60"},{"id":2,"name":"Optional","userPercentage":"40"}],"items":{"$ref":"#/definitions/Variation"}}}},"VariationTypes":{"type":"object","properties":{"variationTypeItems":{"type":"array","items":{"$ref":"#/definitions/VariationType"},"example":[{"id":1,"variationTypeName":"MiTek Variation","start":"2022-10-11 16:33:25.540","end":"2022-12-21 00:00:00.000","variationItems":[{"id":1,"name":"Mandatory","userPercentage":"60"},{"id":2,"name":"Optional","userPercentage":"40"}]},{"id":2,"variationTypeName":"A/B Testing #2","start":"2022-6-11 12:10:25.000","end":"2022-08-09 00:00:00.000","variationItems":[{"id":1,"name":"VariationType#2 - Variation1","userPercentage":"20"},{"id":2,"name":"VariationType#2 - Variation2","userPercentage":"80"}]}]}}}}}