Create a reward
curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/admin/rewards \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"communityId": "<string>",
"assetPointsPrice": 1,
"entryPointsPrice": 1,
"redemptionConfig": {
"type": "rich-text",
"additionalInformation": [
{
"variableConfigId": "<string>",
"required": true,
"position": 2
}
],
"autoRedeem": false,
"content": "<string>",
"instructions": "<string>",
"instructionsImageUrl": "<string>",
"supportEmail": "jsmith@example.com",
"supportPhoneNumber": "<string>",
"supportUrl": "<string>",
"redeemByDate": "<string>"
},
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"assetsSupply": 1,
"entriesSupply": 1,
"additionalCommunityIds": [
"<string>"
],
"maxAssetsPerUser": 2,
"maxEntriesPerUser": 2,
"allocations": [
{
"id": "<string>",
"supply": 1,
"amountToDistribute": 2,
"isShop": true,
"isLive": true
}
],
"isSharedAssetsSupply": true,
"isSharedEntriesSupply": true,
"tags": [
"<string>"
],
"campaigns": [
"<string>"
],
"featured": true,
"startsAt": "<string>",
"expiresAt": "<string>",
"drawsAt": "<string>",
"isManualGiveaway": true,
"isGlobalTemplate": true,
"availableAsTemplateForOrganisations": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://{subdomain}.nudj.cx/api/v2/admin/rewards"
payload = {
"communityId": "<string>",
"assetPointsPrice": 1,
"entryPointsPrice": 1,
"redemptionConfig": {
"type": "rich-text",
"additionalInformation": [
{
"variableConfigId": "<string>",
"required": True,
"position": 2
}
],
"autoRedeem": False,
"content": "<string>",
"instructions": "<string>",
"instructionsImageUrl": "<string>",
"supportEmail": "jsmith@example.com",
"supportPhoneNumber": "<string>",
"supportUrl": "<string>",
"redeemByDate": "<string>"
},
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"assetsSupply": 1,
"entriesSupply": 1,
"additionalCommunityIds": ["<string>"],
"maxAssetsPerUser": 2,
"maxEntriesPerUser": 2,
"allocations": [
{
"id": "<string>",
"supply": 1,
"amountToDistribute": 2,
"isShop": True,
"isLive": True
}
],
"isSharedAssetsSupply": True,
"isSharedEntriesSupply": True,
"tags": ["<string>"],
"campaigns": ["<string>"],
"featured": True,
"startsAt": "<string>",
"expiresAt": "<string>",
"drawsAt": "<string>",
"isManualGiveaway": True,
"isGlobalTemplate": True,
"availableAsTemplateForOrganisations": ["<string>"],
"metadata": {}
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
communityId: '<string>',
assetPointsPrice: 1,
entryPointsPrice: 1,
redemptionConfig: {
type: 'rich-text',
additionalInformation: [{variableConfigId: '<string>', required: true, position: 2}],
autoRedeem: false,
content: '<string>',
instructions: '<string>',
instructionsImageUrl: '<string>',
supportEmail: 'jsmith@example.com',
supportPhoneNumber: '<string>',
supportUrl: '<string>',
redeemByDate: '<string>'
},
details: {
title: '<string>',
description: '<string>',
light: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'},
dark: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'}
},
assetsSupply: 1,
entriesSupply: 1,
additionalCommunityIds: ['<string>'],
maxAssetsPerUser: 2,
maxEntriesPerUser: 2,
allocations: [{id: '<string>', supply: 1, amountToDistribute: 2, isShop: true, isLive: true}],
isSharedAssetsSupply: true,
isSharedEntriesSupply: true,
tags: ['<string>'],
campaigns: ['<string>'],
featured: true,
startsAt: '<string>',
expiresAt: '<string>',
drawsAt: '<string>',
isManualGiveaway: true,
isGlobalTemplate: true,
availableAsTemplateForOrganisations: ['<string>'],
metadata: {}
})
};
fetch('https://{subdomain}.nudj.cx/api/v2/admin/rewards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.nudj.cx/api/v2/admin/rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'communityId' => '<string>',
'assetPointsPrice' => 1,
'entryPointsPrice' => 1,
'redemptionConfig' => [
'type' => 'rich-text',
'additionalInformation' => [
[
'variableConfigId' => '<string>',
'required' => true,
'position' => 2
]
],
'autoRedeem' => false,
'content' => '<string>',
'instructions' => '<string>',
'instructionsImageUrl' => '<string>',
'supportEmail' => 'jsmith@example.com',
'supportPhoneNumber' => '<string>',
'supportUrl' => '<string>',
'redeemByDate' => '<string>'
],
'details' => [
'title' => '<string>',
'description' => '<string>',
'light' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
],
'dark' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
]
],
'assetsSupply' => 1,
'entriesSupply' => 1,
'additionalCommunityIds' => [
'<string>'
],
'maxAssetsPerUser' => 2,
'maxEntriesPerUser' => 2,
'allocations' => [
[
'id' => '<string>',
'supply' => 1,
'amountToDistribute' => 2,
'isShop' => true,
'isLive' => true
]
],
'isSharedAssetsSupply' => true,
'isSharedEntriesSupply' => true,
'tags' => [
'<string>'
],
'campaigns' => [
'<string>'
],
'featured' => true,
'startsAt' => '<string>',
'expiresAt' => '<string>',
'drawsAt' => '<string>',
'isManualGiveaway' => true,
'isGlobalTemplate' => true,
'availableAsTemplateForOrganisations' => [
'<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.nudj.cx/api/v2/admin/rewards"
payload := strings.NewReader("{\n \"communityId\": \"<string>\",\n \"assetPointsPrice\": 1,\n \"entryPointsPrice\": 1,\n \"redemptionConfig\": {\n \"type\": \"rich-text\",\n \"additionalInformation\": [\n {\n \"variableConfigId\": \"<string>\",\n \"required\": true,\n \"position\": 2\n }\n ],\n \"autoRedeem\": false,\n \"content\": \"<string>\",\n \"instructions\": \"<string>\",\n \"instructionsImageUrl\": \"<string>\",\n \"supportEmail\": \"jsmith@example.com\",\n \"supportPhoneNumber\": \"<string>\",\n \"supportUrl\": \"<string>\",\n \"redeemByDate\": \"<string>\"\n },\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n },\n \"assetsSupply\": 1,\n \"entriesSupply\": 1,\n \"additionalCommunityIds\": [\n \"<string>\"\n ],\n \"maxAssetsPerUser\": 2,\n \"maxEntriesPerUser\": 2,\n \"allocations\": [\n {\n \"id\": \"<string>\",\n \"supply\": 1,\n \"amountToDistribute\": 2,\n \"isShop\": true,\n \"isLive\": true\n }\n ],\n \"isSharedAssetsSupply\": true,\n \"isSharedEntriesSupply\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"campaigns\": [\n \"<string>\"\n ],\n \"featured\": true,\n \"startsAt\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"drawsAt\": \"<string>\",\n \"isManualGiveaway\": true,\n \"isGlobalTemplate\": true,\n \"availableAsTemplateForOrganisations\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.nudj.cx/api/v2/admin/rewards")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"communityId\": \"<string>\",\n \"assetPointsPrice\": 1,\n \"entryPointsPrice\": 1,\n \"redemptionConfig\": {\n \"type\": \"rich-text\",\n \"additionalInformation\": [\n {\n \"variableConfigId\": \"<string>\",\n \"required\": true,\n \"position\": 2\n }\n ],\n \"autoRedeem\": false,\n \"content\": \"<string>\",\n \"instructions\": \"<string>\",\n \"instructionsImageUrl\": \"<string>\",\n \"supportEmail\": \"jsmith@example.com\",\n \"supportPhoneNumber\": \"<string>\",\n \"supportUrl\": \"<string>\",\n \"redeemByDate\": \"<string>\"\n },\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n },\n \"assetsSupply\": 1,\n \"entriesSupply\": 1,\n \"additionalCommunityIds\": [\n \"<string>\"\n ],\n \"maxAssetsPerUser\": 2,\n \"maxEntriesPerUser\": 2,\n \"allocations\": [\n {\n \"id\": \"<string>\",\n \"supply\": 1,\n \"amountToDistribute\": 2,\n \"isShop\": true,\n \"isLive\": true\n }\n ],\n \"isSharedAssetsSupply\": true,\n \"isSharedEntriesSupply\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"campaigns\": [\n \"<string>\"\n ],\n \"featured\": true,\n \"startsAt\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"drawsAt\": \"<string>\",\n \"isManualGiveaway\": true,\n \"isGlobalTemplate\": true,\n \"availableAsTemplateForOrganisations\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/admin/rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"communityId\": \"<string>\",\n \"assetPointsPrice\": 1,\n \"entryPointsPrice\": 1,\n \"redemptionConfig\": {\n \"type\": \"rich-text\",\n \"additionalInformation\": [\n {\n \"variableConfigId\": \"<string>\",\n \"required\": true,\n \"position\": 2\n }\n ],\n \"autoRedeem\": false,\n \"content\": \"<string>\",\n \"instructions\": \"<string>\",\n \"instructionsImageUrl\": \"<string>\",\n \"supportEmail\": \"jsmith@example.com\",\n \"supportPhoneNumber\": \"<string>\",\n \"supportUrl\": \"<string>\",\n \"redeemByDate\": \"<string>\"\n },\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n },\n \"assetsSupply\": 1,\n \"entriesSupply\": 1,\n \"additionalCommunityIds\": [\n \"<string>\"\n ],\n \"maxAssetsPerUser\": 2,\n \"maxEntriesPerUser\": 2,\n \"allocations\": [\n {\n \"id\": \"<string>\",\n \"supply\": 1,\n \"amountToDistribute\": 2,\n \"isShop\": true,\n \"isLive\": true\n }\n ],\n \"isSharedAssetsSupply\": true,\n \"isSharedEntriesSupply\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"campaigns\": [\n \"<string>\"\n ],\n \"featured\": true,\n \"startsAt\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"drawsAt\": \"<string>\",\n \"isManualGiveaway\": true,\n \"isGlobalTemplate\": true,\n \"availableAsTemplateForOrganisations\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organisationId": "<string>",
"communityId": "<string>",
"additionalCommunityIds": [
"<string>"
],
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"assetPointsPrice": 1,
"assetPointsSwapValue": 1,
"entryPointsPrice": 1,
"assetsSupply": 1,
"entriesSupply": 1,
"maxAssetsPerUser": 2,
"maxEntriesPerUser": 2,
"allocationsType": "assets-only",
"isSharedAssetsSupply": true,
"isSharedEntriesSupply": true,
"allocations": [
{
"id": "<string>",
"allocationType": "assets",
"supply": 1,
"amountToDistribute": 2,
"distributed": 1,
"isShop": true,
"isLive": true
}
],
"redemptionConfig": {
"type": "rich-text",
"additionalInformation": [
{
"variableConfigId": "<string>",
"required": true,
"position": 2
}
],
"autoRedeem": false,
"content": "<string>",
"instructions": "<string>",
"instructionsImageUrl": "<string>",
"supportEmail": "jsmith@example.com",
"supportPhoneNumber": "<string>",
"supportUrl": "<string>",
"redeemByDate": "<string>"
},
"tags": [
"<string>"
],
"campaigns": [
"<string>"
],
"status": "archived",
"isManualGiveaway": true,
"availableAsTemplateForOrganisations": [
"<string>"
],
"isGlobalTemplate": true,
"metadata": {},
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"featured": true,
"drawsAt": "<string>",
"startsAt": "<string>",
"expiresAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Reward
Create a reward
Create a new reward.
POST
/
rewards
Create a reward
curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/admin/rewards \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"communityId": "<string>",
"assetPointsPrice": 1,
"entryPointsPrice": 1,
"redemptionConfig": {
"type": "rich-text",
"additionalInformation": [
{
"variableConfigId": "<string>",
"required": true,
"position": 2
}
],
"autoRedeem": false,
"content": "<string>",
"instructions": "<string>",
"instructionsImageUrl": "<string>",
"supportEmail": "jsmith@example.com",
"supportPhoneNumber": "<string>",
"supportUrl": "<string>",
"redeemByDate": "<string>"
},
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"assetsSupply": 1,
"entriesSupply": 1,
"additionalCommunityIds": [
"<string>"
],
"maxAssetsPerUser": 2,
"maxEntriesPerUser": 2,
"allocations": [
{
"id": "<string>",
"supply": 1,
"amountToDistribute": 2,
"isShop": true,
"isLive": true
}
],
"isSharedAssetsSupply": true,
"isSharedEntriesSupply": true,
"tags": [
"<string>"
],
"campaigns": [
"<string>"
],
"featured": true,
"startsAt": "<string>",
"expiresAt": "<string>",
"drawsAt": "<string>",
"isManualGiveaway": true,
"isGlobalTemplate": true,
"availableAsTemplateForOrganisations": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://{subdomain}.nudj.cx/api/v2/admin/rewards"
payload = {
"communityId": "<string>",
"assetPointsPrice": 1,
"entryPointsPrice": 1,
"redemptionConfig": {
"type": "rich-text",
"additionalInformation": [
{
"variableConfigId": "<string>",
"required": True,
"position": 2
}
],
"autoRedeem": False,
"content": "<string>",
"instructions": "<string>",
"instructionsImageUrl": "<string>",
"supportEmail": "jsmith@example.com",
"supportPhoneNumber": "<string>",
"supportUrl": "<string>",
"redeemByDate": "<string>"
},
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"assetsSupply": 1,
"entriesSupply": 1,
"additionalCommunityIds": ["<string>"],
"maxAssetsPerUser": 2,
"maxEntriesPerUser": 2,
"allocations": [
{
"id": "<string>",
"supply": 1,
"amountToDistribute": 2,
"isShop": True,
"isLive": True
}
],
"isSharedAssetsSupply": True,
"isSharedEntriesSupply": True,
"tags": ["<string>"],
"campaigns": ["<string>"],
"featured": True,
"startsAt": "<string>",
"expiresAt": "<string>",
"drawsAt": "<string>",
"isManualGiveaway": True,
"isGlobalTemplate": True,
"availableAsTemplateForOrganisations": ["<string>"],
"metadata": {}
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
communityId: '<string>',
assetPointsPrice: 1,
entryPointsPrice: 1,
redemptionConfig: {
type: 'rich-text',
additionalInformation: [{variableConfigId: '<string>', required: true, position: 2}],
autoRedeem: false,
content: '<string>',
instructions: '<string>',
instructionsImageUrl: '<string>',
supportEmail: 'jsmith@example.com',
supportPhoneNumber: '<string>',
supportUrl: '<string>',
redeemByDate: '<string>'
},
details: {
title: '<string>',
description: '<string>',
light: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'},
dark: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'}
},
assetsSupply: 1,
entriesSupply: 1,
additionalCommunityIds: ['<string>'],
maxAssetsPerUser: 2,
maxEntriesPerUser: 2,
allocations: [{id: '<string>', supply: 1, amountToDistribute: 2, isShop: true, isLive: true}],
isSharedAssetsSupply: true,
isSharedEntriesSupply: true,
tags: ['<string>'],
campaigns: ['<string>'],
featured: true,
startsAt: '<string>',
expiresAt: '<string>',
drawsAt: '<string>',
isManualGiveaway: true,
isGlobalTemplate: true,
availableAsTemplateForOrganisations: ['<string>'],
metadata: {}
})
};
fetch('https://{subdomain}.nudj.cx/api/v2/admin/rewards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.nudj.cx/api/v2/admin/rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'communityId' => '<string>',
'assetPointsPrice' => 1,
'entryPointsPrice' => 1,
'redemptionConfig' => [
'type' => 'rich-text',
'additionalInformation' => [
[
'variableConfigId' => '<string>',
'required' => true,
'position' => 2
]
],
'autoRedeem' => false,
'content' => '<string>',
'instructions' => '<string>',
'instructionsImageUrl' => '<string>',
'supportEmail' => 'jsmith@example.com',
'supportPhoneNumber' => '<string>',
'supportUrl' => '<string>',
'redeemByDate' => '<string>'
],
'details' => [
'title' => '<string>',
'description' => '<string>',
'light' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
],
'dark' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
]
],
'assetsSupply' => 1,
'entriesSupply' => 1,
'additionalCommunityIds' => [
'<string>'
],
'maxAssetsPerUser' => 2,
'maxEntriesPerUser' => 2,
'allocations' => [
[
'id' => '<string>',
'supply' => 1,
'amountToDistribute' => 2,
'isShop' => true,
'isLive' => true
]
],
'isSharedAssetsSupply' => true,
'isSharedEntriesSupply' => true,
'tags' => [
'<string>'
],
'campaigns' => [
'<string>'
],
'featured' => true,
'startsAt' => '<string>',
'expiresAt' => '<string>',
'drawsAt' => '<string>',
'isManualGiveaway' => true,
'isGlobalTemplate' => true,
'availableAsTemplateForOrganisations' => [
'<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.nudj.cx/api/v2/admin/rewards"
payload := strings.NewReader("{\n \"communityId\": \"<string>\",\n \"assetPointsPrice\": 1,\n \"entryPointsPrice\": 1,\n \"redemptionConfig\": {\n \"type\": \"rich-text\",\n \"additionalInformation\": [\n {\n \"variableConfigId\": \"<string>\",\n \"required\": true,\n \"position\": 2\n }\n ],\n \"autoRedeem\": false,\n \"content\": \"<string>\",\n \"instructions\": \"<string>\",\n \"instructionsImageUrl\": \"<string>\",\n \"supportEmail\": \"jsmith@example.com\",\n \"supportPhoneNumber\": \"<string>\",\n \"supportUrl\": \"<string>\",\n \"redeemByDate\": \"<string>\"\n },\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n },\n \"assetsSupply\": 1,\n \"entriesSupply\": 1,\n \"additionalCommunityIds\": [\n \"<string>\"\n ],\n \"maxAssetsPerUser\": 2,\n \"maxEntriesPerUser\": 2,\n \"allocations\": [\n {\n \"id\": \"<string>\",\n \"supply\": 1,\n \"amountToDistribute\": 2,\n \"isShop\": true,\n \"isLive\": true\n }\n ],\n \"isSharedAssetsSupply\": true,\n \"isSharedEntriesSupply\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"campaigns\": [\n \"<string>\"\n ],\n \"featured\": true,\n \"startsAt\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"drawsAt\": \"<string>\",\n \"isManualGiveaway\": true,\n \"isGlobalTemplate\": true,\n \"availableAsTemplateForOrganisations\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.nudj.cx/api/v2/admin/rewards")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"communityId\": \"<string>\",\n \"assetPointsPrice\": 1,\n \"entryPointsPrice\": 1,\n \"redemptionConfig\": {\n \"type\": \"rich-text\",\n \"additionalInformation\": [\n {\n \"variableConfigId\": \"<string>\",\n \"required\": true,\n \"position\": 2\n }\n ],\n \"autoRedeem\": false,\n \"content\": \"<string>\",\n \"instructions\": \"<string>\",\n \"instructionsImageUrl\": \"<string>\",\n \"supportEmail\": \"jsmith@example.com\",\n \"supportPhoneNumber\": \"<string>\",\n \"supportUrl\": \"<string>\",\n \"redeemByDate\": \"<string>\"\n },\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n },\n \"assetsSupply\": 1,\n \"entriesSupply\": 1,\n \"additionalCommunityIds\": [\n \"<string>\"\n ],\n \"maxAssetsPerUser\": 2,\n \"maxEntriesPerUser\": 2,\n \"allocations\": [\n {\n \"id\": \"<string>\",\n \"supply\": 1,\n \"amountToDistribute\": 2,\n \"isShop\": true,\n \"isLive\": true\n }\n ],\n \"isSharedAssetsSupply\": true,\n \"isSharedEntriesSupply\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"campaigns\": [\n \"<string>\"\n ],\n \"featured\": true,\n \"startsAt\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"drawsAt\": \"<string>\",\n \"isManualGiveaway\": true,\n \"isGlobalTemplate\": true,\n \"availableAsTemplateForOrganisations\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/admin/rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"communityId\": \"<string>\",\n \"assetPointsPrice\": 1,\n \"entryPointsPrice\": 1,\n \"redemptionConfig\": {\n \"type\": \"rich-text\",\n \"additionalInformation\": [\n {\n \"variableConfigId\": \"<string>\",\n \"required\": true,\n \"position\": 2\n }\n ],\n \"autoRedeem\": false,\n \"content\": \"<string>\",\n \"instructions\": \"<string>\",\n \"instructionsImageUrl\": \"<string>\",\n \"supportEmail\": \"jsmith@example.com\",\n \"supportPhoneNumber\": \"<string>\",\n \"supportUrl\": \"<string>\",\n \"redeemByDate\": \"<string>\"\n },\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n },\n \"assetsSupply\": 1,\n \"entriesSupply\": 1,\n \"additionalCommunityIds\": [\n \"<string>\"\n ],\n \"maxAssetsPerUser\": 2,\n \"maxEntriesPerUser\": 2,\n \"allocations\": [\n {\n \"id\": \"<string>\",\n \"supply\": 1,\n \"amountToDistribute\": 2,\n \"isShop\": true,\n \"isLive\": true\n }\n ],\n \"isSharedAssetsSupply\": true,\n \"isSharedEntriesSupply\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"campaigns\": [\n \"<string>\"\n ],\n \"featured\": true,\n \"startsAt\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"drawsAt\": \"<string>\",\n \"isManualGiveaway\": true,\n \"isGlobalTemplate\": true,\n \"availableAsTemplateForOrganisations\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organisationId": "<string>",
"communityId": "<string>",
"additionalCommunityIds": [
"<string>"
],
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"assetPointsPrice": 1,
"assetPointsSwapValue": 1,
"entryPointsPrice": 1,
"assetsSupply": 1,
"entriesSupply": 1,
"maxAssetsPerUser": 2,
"maxEntriesPerUser": 2,
"allocationsType": "assets-only",
"isSharedAssetsSupply": true,
"isSharedEntriesSupply": true,
"allocations": [
{
"id": "<string>",
"allocationType": "assets",
"supply": 1,
"amountToDistribute": 2,
"distributed": 1,
"isShop": true,
"isLive": true
}
],
"redemptionConfig": {
"type": "rich-text",
"additionalInformation": [
{
"variableConfigId": "<string>",
"required": true,
"position": 2
}
],
"autoRedeem": false,
"content": "<string>",
"instructions": "<string>",
"instructionsImageUrl": "<string>",
"supportEmail": "jsmith@example.com",
"supportPhoneNumber": "<string>",
"supportUrl": "<string>",
"redeemByDate": "<string>"
},
"tags": [
"<string>"
],
"campaigns": [
"<string>"
],
"status": "archived",
"isManualGiveaway": true,
"availableAsTemplateForOrganisations": [
"<string>"
],
"isGlobalTemplate": true,
"metadata": {},
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"featured": true,
"drawsAt": "<string>",
"startsAt": "<string>",
"expiresAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Body
application/json
The input required to create a reward
Response
Successful response
A reward
Was this page helpful?

