Create source link
curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>"
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links"
payload = {
"name": "<string>",
"code": "<string>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>"
}
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({
name: '<string>',
code: '<string>',
utm_source: '<string>',
utm_medium: '<string>',
utm_campaign: '<string>',
utm_term: '<string>',
utm_content: '<string>'
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links', 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}/offers/{offer}/source-links",
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([
'name' => '<string>',
'code' => '<string>',
'utm_source' => '<string>',
'utm_medium' => '<string>',
'utm_campaign' => '<string>',
'utm_term' => '<string>',
'utm_content' => '<string>'
]),
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}/offers/{offer}/source-links"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\"\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}/offers/{offer}/source-links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links")
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 \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"offer_id": 123,
"is_main": true,
"name": "<string>",
"code": "<string>",
"link": "<string>",
"landing_link": "<string>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"opens_count": 123,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}Посилання-джерела
Створити посилання-джерело
Створює окреме посилання на оплату тарифу під одне джерело трафіку
POST
/
api
/
v1
/
bot
/
{bot}
/
offers
/
{offer}
/
source-links
Create source link
curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>"
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links"
payload = {
"name": "<string>",
"code": "<string>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>"
}
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({
name: '<string>',
code: '<string>',
utm_source: '<string>',
utm_medium: '<string>',
utm_campaign: '<string>',
utm_term: '<string>',
utm_content: '<string>'
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links', 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}/offers/{offer}/source-links",
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([
'name' => '<string>',
'code' => '<string>',
'utm_source' => '<string>',
'utm_medium' => '<string>',
'utm_campaign' => '<string>',
'utm_term' => '<string>',
'utm_content' => '<string>'
]),
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}/offers/{offer}/source-links"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\"\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}/offers/{offer}/source-links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/offers/{offer}/source-links")
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 \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"utm_source\": \"<string>\",\n \"utm_medium\": \"<string>\",\n \"utm_campaign\": \"<string>\",\n \"utm_term\": \"<string>\",\n \"utm_content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"offer_id": 123,
"is_main": true,
"name": "<string>",
"code": "<string>",
"link": "<string>",
"landing_link": "<string>",
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"opens_count": 123,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}Тіло
application/json
Your own identifier for the link, returned in orders and webhooks as source_link.code. Latin letters, digits, - and _, up to 32 characters. Must be free among the codes of source links and the public link slugs (bot_slug, landing_slug) of offers, funnels and funnel links. Generated when omitted. Can be changed later with PATCH, the old addresses then stop working
Maximum string length:
32Pattern:
^[A-Za-z0-9_-]+$