尝试使用 API 发布主题时失败,并显示以下错误消息: {‘action’: ‘create_post’, ‘errors’: [‘Body is too short (minimum is 1 character)’, ‘Body seems unclear, is it a complete sentence?’]}
要发布的消息大约有 25K,是一个新闻列表
手动发布可以成功
但使用 API 发布时会失败
默认帖子大小是 35K(?),我已经(在设置中)增加了它以允许这个更长的消息
如果使用下面的代码发布一个简短的句子,则可以正常工作
将 body min entropy 改为 0,也没有帮助
在论坛上搜索过,没有找到解决方案
有什么想法/建议吗?谢谢…
这是 Python 代码:
import requests
# Authentication headers
headers = {
"Api-Key": '***',
"Api-Username": 'newsbot',
}
lines = "some news, around 25K"
# Topic data
topic_data = {
"title":"latest news",
"raw": lines,
"category": 28,
}
# Send a POST request to create the topic
response = requests.post('https://www.mydomain.com/posts.json', json=topic_data, headers=headers)
# Check if the request was successful
if response.status_code == 200:
print("Topic created successfully!")
topic_id = response.json().get("id")
print(f"Topic ID: {topic_id}")
else:
print(response.json())
print(f"Failed to create the topic. Status code: {response.status_code}")
顺便说一句,要发布的内容是像这样的新闻列表:
[grid]


[/grid]
<details>
<summary><b>news title</b></summary>
news conentnews conentnews conentnews conentnews
conent news conentnews conentnews conentnews conentnews
conentnews conentnews conentnews conentnews conentnews
conentnews conentnews conentnews conentnews conent
about this long for one news
[The New source 2023-10-16T21:16:45Z](https://www.newssource.com/live/anews)