Create affiliate program
curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/affiliate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"active": true,
"description": "<string>",
"reward_amount": 1.01,
"offer_ids": [
123
],
"conversion_window": 1,
"min_payout": 1,
"duration_amount": 2
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/affiliate"
payload = {
"title": "<string>",
"active": True,
"description": "<string>",
"reward_amount": 1.01,
"offer_ids": [123],
"conversion_window": 1,
"min_payout": 1,
"duration_amount": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
active: true,
description: '<string>',
reward_amount: 1.01,
offer_ids: [123],
conversion_window: 1,
min_payout: 1,
duration_amount: 2
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/affiliate', 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://app.zenedu.io/api/v1/bot/{bot}/affiliate",
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([
'title' => '<string>',
'active' => true,
'description' => '<string>',
'reward_amount' => 1.01,
'offer_ids' => [
123
],
'conversion_window' => 1,
'min_payout' => 1,
'duration_amount' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.zenedu.io/api/v1/bot/{bot}/affiliate"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"reward_amount\": 1.01,\n \"offer_ids\": [\n 123\n ],\n \"conversion_window\": 1,\n \"min_payout\": 1,\n \"duration_amount\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.zenedu.io/api/v1/bot/{bot}/affiliate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"reward_amount\": 1.01,\n \"offer_ids\": [\n 123\n ],\n \"conversion_window\": 1,\n \"min_payout\": 1,\n \"duration_amount\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/affiliate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"reward_amount\": 1.01,\n \"offer_ids\": [\n 123\n ],\n \"conversion_window\": 1,\n \"min_payout\": 1,\n \"duration_amount\": 2\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"title": "<string>",
"active": true,
"is_active": true,
"description": "<string>",
"reward_type": "<string>",
"reward_amount": 123,
"offer_ids": [
123
],
"conversion_window": 123,
"min_payout": 123,
"duration_type": "<string>",
"duration_amount": 123,
"currency": "<string>",
"links_count": 123,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Affiliates
Create affiliate program
Creates the bot’s affiliate program.
POST
/
api
/
v1
/
bot
/
{bot}
/
affiliate
Create affiliate program
curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/affiliate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"active": true,
"description": "<string>",
"reward_amount": 1.01,
"offer_ids": [
123
],
"conversion_window": 1,
"min_payout": 1,
"duration_amount": 2
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/affiliate"
payload = {
"title": "<string>",
"active": True,
"description": "<string>",
"reward_amount": 1.01,
"offer_ids": [123],
"conversion_window": 1,
"min_payout": 1,
"duration_amount": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
active: true,
description: '<string>',
reward_amount: 1.01,
offer_ids: [123],
conversion_window: 1,
min_payout: 1,
duration_amount: 2
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/affiliate', 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://app.zenedu.io/api/v1/bot/{bot}/affiliate",
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([
'title' => '<string>',
'active' => true,
'description' => '<string>',
'reward_amount' => 1.01,
'offer_ids' => [
123
],
'conversion_window' => 1,
'min_payout' => 1,
'duration_amount' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.zenedu.io/api/v1/bot/{bot}/affiliate"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"reward_amount\": 1.01,\n \"offer_ids\": [\n 123\n ],\n \"conversion_window\": 1,\n \"min_payout\": 1,\n \"duration_amount\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.zenedu.io/api/v1/bot/{bot}/affiliate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"reward_amount\": 1.01,\n \"offer_ids\": [\n 123\n ],\n \"conversion_window\": 1,\n \"min_payout\": 1,\n \"duration_amount\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/affiliate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"active\": true,\n \"description\": \"<string>\",\n \"reward_amount\": 1.01,\n \"offer_ids\": [\n 123\n ],\n \"conversion_window\": 1,\n \"min_payout\": 1,\n \"duration_amount\": 2\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"title": "<string>",
"active": true,
"is_active": true,
"description": "<string>",
"reward_type": "<string>",
"reward_amount": 123,
"offer_ids": [
123
],
"conversion_window": 123,
"min_payout": 123,
"duration_type": "<string>",
"duration_amount": 123,
"currency": "<string>",
"links_count": 123,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Authorizations
API token from the Zenedu dashboard
Path Parameters
Bot ID
Body
application/json
Maximum string length:
255Available options:
percent, fixed Reward amount (percent value, or fixed amount in the account currency)
Required range:
x >= 0.01Offer IDs the program applies to
Attribution window in days
Required range:
x >= 0Minimum payout amount
Required range:
x >= 0Available options:
months, years Required range:
x >= 1Response
Affiliate program created
Show child attributes
Show child attributes