curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/admin/actions/{actionId}/distribution \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"rewardsConfig": {
"mechanism": "all",
"amountToDistribute": 1,
"allocations": [
{
"allocationType": "assets",
"amountToDistribute": 2,
"rewardId": "<string>",
"id": "<string>",
"supply": 1
}
]
},
"pointsToDistribute": 1,
"bonusXpToDistribute": 1
}
'{
"pointsToDistribute": 1,
"bonusXpToDistribute": 1,
"rewardsConfig": {
"mechanism": "all",
"amountToDistribute": 1,
"allocations": [
{
"id": "<string>",
"allocationType": "assets",
"supply": 1,
"amountToDistribute": 2,
"distributed": 1,
"isLive": true,
"rewardId": "<string>"
}
]
},
"actionId": "<string>"
}Assign a distribution details to an action.
curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/admin/actions/{actionId}/distribution \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"rewardsConfig": {
"mechanism": "all",
"amountToDistribute": 1,
"allocations": [
{
"allocationType": "assets",
"amountToDistribute": 2,
"rewardId": "<string>",
"id": "<string>",
"supply": 1
}
]
},
"pointsToDistribute": 1,
"bonusXpToDistribute": 1
}
'{
"pointsToDistribute": 1,
"bonusXpToDistribute": 1,
"rewardsConfig": {
"mechanism": "all",
"amountToDistribute": 1,
"allocations": [
{
"id": "<string>",
"allocationType": "assets",
"supply": 1,
"amountToDistribute": 2,
"distributed": 1,
"isLive": true,
"rewardId": "<string>"
}
]
},
"actionId": "<string>"
}The id of the action to assign distribution details to
The input required to assign distribution details to an action
Show child attributes
The mechanism used to distribute the rewards
all, priority, random, select The number of different reward allocations to select from the allocations array. For example, if there are 5 allocations but amountToDistribute is 2, only 2 of those 5 allocations will be selected based on the specified mechanism (all, priority or random).
x >= 0The reward allocations to distribute. If any of the allocations are new, the id field should be null. If any of the allocations are updates to existing allocations, the id field should be the id of the allocation to update. If an existing allocation is not included in the array, it will be removed from the distribution event.
Show child attributes
The type of allocation, either assets or entries. If the reward has a type of assets-and-entries, this allocation can have both assets and entries. Otherwise, it can only have one type matching the reward's allocation type.
assets, entries The quantity of this specific reward to distribute when this allocation is selected. For example, if amountToDistribute is 3, then 3 units of this reward will be given to the recipient.
x >= 1The id of the reward the allocation relates to
Only required if updating an existing allocation
The maximum number of rewards available for this allocation. Set to 'Infinity' for unlimited supply. This value is only used when the reward has individual supply tracking (isSharedAssetsSupply or isSharedEntriesSupply is false).
x >= 0The amount of points to distribute.
x >= 0The amount of bonus xp to distribute
x >= 0Successful response
The amount of points to distribute.
x >= 0The amount of bonus xp to distribute
x >= 0Show child attributes
The mechanism used to distribute the rewards
all, priority, random, select The number of different reward allocations to select from the allocations array. For example, if there are 5 allocations but amountToDistribute is 2, only 2 of those 5 allocations will be selected based on the specified mechanism (all, priority or random).
x >= 0The reward allocations to distribute. If any of the allocations are new, the id field should be null. If any of the allocations are updates to existing allocations, the id field should be the id of the allocation to update. If an existing allocation is not included in the array, it will be removed from the distribution event.
Show child attributes
The ID of this allocation
The type of allocation, either assets or entries. If the reward has a type of assets-and-entries, this allocation can have both assets and entries. Otherwise, it can only have one type matching the reward's allocation type.
assets, entries The total supply of this allocation. Only used if isSharedAssetsSupply or isSharedEntriesSupply is false on the reward.
x >= 0The quantity of this specific reward to distribute when this allocation is selected. For example, if amountToDistribute is 3, then 3 units of this reward will be given to the recipient.
x >= 1The amount already distributed for this allocation
x >= 0Whether this allocation is live
The id of the reward the allocation relates to.
The id of the action with assigned distribution details
Was this page helpful?