Update step button
curl --request PATCH \
--url https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [
{
"settings": {}
}
],
"settings": {
"web_app": true,
"direct_link": true,
"tags": [
"<string>"
],
"task_message": "<string>",
"task_send_task_button_message": "<string>",
"task_add_more_button_label": "<string>",
"task_cancel_button_label": "<string>",
"task_cancel_button_message": "<string>",
"send_task_second_time_error": "<string>"
}
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}"
payload = {
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [{ "settings": {} }],
"settings": {
"web_app": True,
"direct_link": True,
"tags": ["<string>"],
"task_message": "<string>",
"task_send_task_button_message": "<string>",
"task_add_more_button_label": "<string>",
"task_cancel_button_label": "<string>",
"task_cancel_button_message": "<string>",
"send_task_second_time_error": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
link: '<string>',
offer_id: 123,
actions: [{settings: {}}],
settings: {
web_app: true,
direct_link: true,
tags: ['<string>'],
task_message: '<string>',
task_send_task_button_message: '<string>',
task_add_more_button_label: '<string>',
task_cancel_button_label: '<string>',
task_cancel_button_message: '<string>',
send_task_second_time_error: '<string>'
}
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}', 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}/funnels/{product}/steps/{step}/buttons/{button}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'link' => '<string>',
'offer_id' => 123,
'actions' => [
[
'settings' => [
]
]
],
'settings' => [
'web_app' => true,
'direct_link' => true,
'tags' => [
'<string>'
],
'task_message' => '<string>',
'task_send_task_button_message' => '<string>',
'task_add_more_button_label' => '<string>',
'task_cancel_button_label' => '<string>',
'task_cancel_button_message' => '<string>',
'send_task_second_time_error' => '<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}/funnels/{product}/steps/{step}/buttons/{button}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"link\": \"<string>\",\n \"offer_id\": 123,\n \"actions\": [\n {\n \"settings\": {}\n }\n ],\n \"settings\": {\n \"web_app\": true,\n \"direct_link\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"task_message\": \"<string>\",\n \"task_send_task_button_message\": \"<string>\",\n \"task_add_more_button_label\": \"<string>\",\n \"task_cancel_button_label\": \"<string>\",\n \"task_cancel_button_message\": \"<string>\",\n \"send_task_second_time_error\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"link\": \"<string>\",\n \"offer_id\": 123,\n \"actions\": [\n {\n \"settings\": {}\n }\n ],\n \"settings\": {\n \"web_app\": true,\n \"direct_link\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"task_message\": \"<string>\",\n \"task_send_task_button_message\": \"<string>\",\n \"task_add_more_button_label\": \"<string>\",\n \"task_cancel_button_label\": \"<string>\",\n \"task_cancel_button_message\": \"<string>\",\n \"send_task_second_time_error\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"link\": \"<string>\",\n \"offer_id\": 123,\n \"actions\": [\n {\n \"settings\": {}\n }\n ],\n \"settings\": {\n \"web_app\": true,\n \"direct_link\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"task_message\": \"<string>\",\n \"task_send_task_button_message\": \"<string>\",\n \"task_add_more_button_label\": \"<string>\",\n \"task_cancel_button_label\": \"<string>\",\n \"task_cancel_button_message\": \"<string>\",\n \"send_task_second_time_error\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"product_id": 123,
"section_id": 123,
"type": "message",
"name": "<string>",
"text": "<string>",
"active": true,
"sort": 123,
"link_preview": true,
"task_autocheck": true,
"custom_field_id": 123,
"sending_time": {
"option": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"skip_past_date": true,
"delay_time": "2023-11-07T05:31:56Z",
"delay_limit": {
"time_from": 719,
"time_to": 719,
"weekdays": [
"mon"
]
}
},
"menu_time": {
"type": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"delay_time": "2023-11-07T05:31:56Z"
},
"settings": {
"attach_file": true,
"has_spoiler": true,
"attach_style": "<string>",
"autodelete": 123,
"protect_content": true,
"save_profile": true,
"subtype": "<string>",
"question_error_message": "<string>",
"quiz_explanation": "<string>"
},
"cover_url": "<string>",
"attachments": [
{
"id": 123,
"type": "<string>",
"name": "<string>"
}
],
"buttons": [
{
"id": 123,
"type": "link",
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [
{}
],
"settings": {},
"sort": 123
}
],
"options": [
{
"id": 123,
"text": "<string>",
"is_correct": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Шаги
Обновить кнопку шага
Заменяет поля кнопки. Сохраняются все поля, поэтому передавайте кнопку целиком. Возвращает обновлённый шаг.
PATCH
/
api
/
v1
/
bot
/
{bot}
/
funnels
/
{product}
/
steps
/
{step}
/
buttons
/
{button}
Update step button
curl --request PATCH \
--url https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [
{
"settings": {}
}
],
"settings": {
"web_app": true,
"direct_link": true,
"tags": [
"<string>"
],
"task_message": "<string>",
"task_send_task_button_message": "<string>",
"task_add_more_button_label": "<string>",
"task_cancel_button_label": "<string>",
"task_cancel_button_message": "<string>",
"send_task_second_time_error": "<string>"
}
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}"
payload = {
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [{ "settings": {} }],
"settings": {
"web_app": True,
"direct_link": True,
"tags": ["<string>"],
"task_message": "<string>",
"task_send_task_button_message": "<string>",
"task_add_more_button_label": "<string>",
"task_cancel_button_label": "<string>",
"task_cancel_button_message": "<string>",
"send_task_second_time_error": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
link: '<string>',
offer_id: 123,
actions: [{settings: {}}],
settings: {
web_app: true,
direct_link: true,
tags: ['<string>'],
task_message: '<string>',
task_send_task_button_message: '<string>',
task_add_more_button_label: '<string>',
task_cancel_button_label: '<string>',
task_cancel_button_message: '<string>',
send_task_second_time_error: '<string>'
}
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}', 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}/funnels/{product}/steps/{step}/buttons/{button}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'link' => '<string>',
'offer_id' => 123,
'actions' => [
[
'settings' => [
]
]
],
'settings' => [
'web_app' => true,
'direct_link' => true,
'tags' => [
'<string>'
],
'task_message' => '<string>',
'task_send_task_button_message' => '<string>',
'task_add_more_button_label' => '<string>',
'task_cancel_button_label' => '<string>',
'task_cancel_button_message' => '<string>',
'send_task_second_time_error' => '<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}/funnels/{product}/steps/{step}/buttons/{button}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"link\": \"<string>\",\n \"offer_id\": 123,\n \"actions\": [\n {\n \"settings\": {}\n }\n ],\n \"settings\": {\n \"web_app\": true,\n \"direct_link\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"task_message\": \"<string>\",\n \"task_send_task_button_message\": \"<string>\",\n \"task_add_more_button_label\": \"<string>\",\n \"task_cancel_button_label\": \"<string>\",\n \"task_cancel_button_message\": \"<string>\",\n \"send_task_second_time_error\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"link\": \"<string>\",\n \"offer_id\": 123,\n \"actions\": [\n {\n \"settings\": {}\n }\n ],\n \"settings\": {\n \"web_app\": true,\n \"direct_link\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"task_message\": \"<string>\",\n \"task_send_task_button_message\": \"<string>\",\n \"task_add_more_button_label\": \"<string>\",\n \"task_cancel_button_label\": \"<string>\",\n \"task_cancel_button_message\": \"<string>\",\n \"send_task_second_time_error\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/funnels/{product}/steps/{step}/buttons/{button}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"link\": \"<string>\",\n \"offer_id\": 123,\n \"actions\": [\n {\n \"settings\": {}\n }\n ],\n \"settings\": {\n \"web_app\": true,\n \"direct_link\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"task_message\": \"<string>\",\n \"task_send_task_button_message\": \"<string>\",\n \"task_add_more_button_label\": \"<string>\",\n \"task_cancel_button_label\": \"<string>\",\n \"task_cancel_button_message\": \"<string>\",\n \"send_task_second_time_error\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"product_id": 123,
"section_id": 123,
"type": "message",
"name": "<string>",
"text": "<string>",
"active": true,
"sort": 123,
"link_preview": true,
"task_autocheck": true,
"custom_field_id": 123,
"sending_time": {
"option": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"skip_past_date": true,
"delay_time": "2023-11-07T05:31:56Z",
"delay_limit": {
"time_from": 719,
"time_to": 719,
"weekdays": [
"mon"
]
}
},
"menu_time": {
"type": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"delay_time": "2023-11-07T05:31:56Z"
},
"settings": {
"attach_file": true,
"has_spoiler": true,
"attach_style": "<string>",
"autodelete": 123,
"protect_content": true,
"save_profile": true,
"subtype": "<string>",
"question_error_message": "<string>",
"quiz_explanation": "<string>"
},
"cover_url": "<string>",
"attachments": [
{
"id": 123,
"type": "<string>",
"name": "<string>"
}
],
"buttons": [
{
"id": 123,
"type": "link",
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [
{}
],
"settings": {},
"sort": 123
}
],
"options": [
{
"id": 123,
"text": "<string>",
"is_correct": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Авторизации
API token from the Zenedu dashboard
Параметры пути
Bot ID
Funnel ID
Step ID
Button ID
Тело
application/json
Доступные опции:
link, task, action, offer, affiliate, app Maximum string length:
250Required when type is link; https or tg URL
Maximum string length:
250Required when type is offer
Required when type is action
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Ответ
Step
Show child attributes
Show child attributes