如何使用wix api和wix api访问令牌创建wix博客草稿文章


{
"draftPost": {
"title": "abc1",
"richContent": {
"nodes": [
{
"type": "paragraph",
"text": "This is a paragraph of text."
},
{
"type": "paragraph",
"textData": {
"text": "This is a paragraph of text."
}
},
{
"type": "paragraph",
"style": {
"paddingTop": "20px"
},
"textData": {
"text": "This is a paragraph of text."
}
} 
]
}
},
"publish": false
}

我曾尝试用上面的代码创建wix博客草稿顺便说一下,只创建了标题,但没有创建描述原因是什么?请让我知道解决方案与详细的例子由于

我想知道使用wix api创建wix博客文章的详细方法

问题是段落是容器,而不是文本本身。

这意味着您需要在段落中添加一个文本节点来实际显示文本。文档中只有几个这样的例子:https://dev.wix.com/api/rest/wix-blog/blog/draft-posts/list-draft-posts

例如:

{ "draftPost": {
"title": "abc1",     
"richContent": {
"nodes": [ {
"type": "PARAGRAPH",
"id": "",
"nodes": [            {
"type": "TEXT",
"id": "",
"nodes": [],
"textData":               {
"text": "This is a paragraph of text.",
"decorations": []
}
}],
"paragraphData":             {
"textStyle": {"textAlignment": "AUTO"},
"indentation": 0
}
} ]
}
}
}

最新更新