Create a Context
POST/context
A POST request for creating a new context and assigning variants to your users.
Request
Header Parameters
The User-Agent of your SDK.
The environment in which you are running your experiments. These can be found and created in your ABsmartly Web Console settings.
The application in which you are running your experiments. These can be found and created in your ABsmartly Web Console settings.
The application version which you are running your experiments on.
- application/json
Body
required
Units data for which to create the context and variant assignments. Unit types can be found and created in your ABsmartly Web Console settings.
{
"type": "user_id" // The name of the unit type
"uid": "4a42766ca6313d26f49985e799ff4f3790fb86efa0fce46edb3ea8fbf1ea3408" // The value of the unit that you are tracking.
}
- Array [
- ]
units object[]required
Possible values: non-empty
and <= 640 characters
Responses
- 200
- 400
- 401
- default
Success
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
units object[]required
Possible values: non-empty
and <= 640 characters
assignments object[]required
Possible values: <= 127
Possible values: <= 127
{
"units": [
{
"type": "user_id",
"uid": "4a42766ca6313d26f49985e799ff4f3790fb86efa0fce46edb3ea8fbf1ea3408"
}
],
"assignments": [
{
"id": 3,
"iteration": 2,
"name": "exp_banner_color",
"variant": 1,
"eligible": true,
"audienceMismatch": false,
"originalVariant": 1,
"config": "string"
}
]
}
Bad request
- application/json
- Schema
- Example (from schema)
Schema
{
"code": 0,
"message": "string"
}
Unauthorized
Unexpected error
- application/json
- Schema
- Example (from schema)
Schema
{
"code": 0,
"message": "string"
}