Schedule an A/B test

Schedule an A/B test to be started at a later time.

Usage

Required ACL: editSettings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import algoliasearch.api.AbtestingClient
import algoliasearch.config.*

val client = AbtestingClient(
  appId = "ALGOLIA_APPLICATION_ID",
  apiKey = "ALGOLIA_API_KEY",
  region = Option("ALGOLIA_APPLICATION_REGION")
)

val response = Await.result(
  client.scheduleABTest(
    scheduleABTestsRequest = ScheduleABTestsRequest(
      endAt = "2022-12-31T00:00:00.000Z",
      scheduledAt = "2022-11-31T00:00:00.000Z",
      name = "myABTest",
      variants = Seq(
        AbTestsVariant(
          index = "AB_TEST_1",
          trafficPercentage = 30
        ),
        AbTestsVariant(
          index = "AB_TEST_2",
          trafficPercentage = 50
        )
      )
    )
  ),
  Duration(100, "sec")
)
Did you find this page helpful?