postStoryЧастично
Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
Поддерживается частично
needs can_manage_stories; attach:// photo/video, caption/entities, active_period, post_to_chat_page, protect_content, location/suggested_reaction/link/weather areas; unique_gift areas → 400 STORY_AREA_UNSUPPORTED
Параметры
Unique identifier of the business connection
Content of the story
Period after which the story is moved to the archive, in seconds; must be one of
6 * 3600, 12 * 3600, 86400, or 2 * 86400Caption of the story, 0-2048 characters after entities parsing
Mode for parsing entities in the story caption. See formatting options for more details.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
A JSON-serialized list of clickable areas to be shown on the story
Pass True to keep the story accessible after it expires
Pass True if the content of the story must be protected from forwarding and screenshotting
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/postStory" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "<business_connection_id>",
"content": {},
"active_period": 1
}'aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)
result = await bot.post_story(
business_connection_id="<business_connection_id>",
content={},
active_period=1,
)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/postStory`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "<business_connection_id>",
"content": {},
"active_period": 1
}),
});
const data = await res.json();Ответ (Story)
JSON
{
"ok": true,
"result": {
"chat": {
"id": 1780243423,
"type": "private"
},
"id": 1780243423
}
}