editStory
Edita una historia en nombre de una cuenta empresarial.
Devuelve: Si la llamada tiene éxito, devuelve Story.
Parámetros
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
business_connection_id | String | Sí | ID de la conexión empresarial |
story_id | Integer | Sí | ID de la historia |
content | InputStoryContent | Sí | Objeto JSON InputStoryContent |
caption | String | Opcional | Nueva leyenda |
parse_mode | String | Opcional | HTML, Markdown o MarkdownV2 |
caption_entities | Array of MessageEntity | Opcional | Array JSON de MessageEntity |
areas | Array of StoryArea | Opcional | Array JSON de StoryArea |
Ejemplo de solicitud
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/editStory" \
-H "Content-Type: application/json" \
-d '{
"business_connection_id": "BUSINESS_CONNECTION_ID",
"story_id": 1,
"content": {
"type": "photo",
"photo": "attach://photo"
}
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/editStory",
json={
"business_connection_id": "BUSINESS_CONNECTION_ID",
"story_id": 1,
"content": {
"type": "photo",
"photo": "attach://photo"
}
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editStory`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"business_connection_id": "BUSINESS_CONNECTION_ID",
"story_id": 1,
"content": {
"type": "photo",
"photo": "attach://photo"
}
}),
});
console.log(await res.json());
Guía paso a paso: Cómo crear un bot en Telegram paso a paso: de BotFather a tu primer mensaje
Métodos relacionados
postStoryPublica una historia en nombre de una cuenta empresarial.deleteStoryElimina una historia en nombre de una cuenta empresarial.repostStoryRepublica una historia entre cuentas empresariales (Bot API 9.3).