Blogger API-如何在插入新帖子时添加标签?

Cyr*_*ril 0 api label blogger

我正在尝试使用Blogger API v3.0插入新博客文章,以下是我的示例有效负载

var payload = {
  "title"   : "This is the post title2",
  "content" : "This is <b>HTML</b> post2"
};
Run Code Online (Sandbox Code Playgroud)

这可以按预期工作,但是我在发布这些新帖子时需要插入标签,我查看了文档和Google,但没有帮助。我尝试了如下

var payload = {
  "title"   : "This is the post title2",
  "content" : "This is <b>HTML</b> post2",
  "labels"  : "test_post,test,post"
};
Run Code Online (Sandbox Code Playgroud)

基于v1.0 php示例,仍然无法成功。

pao*_*olo 5

发布资源”文档指出该labels属性是一个列表。您的有效负载应该看起来像这样:

var payload = {
  "title"   : "This is the post title2",
  "content" : "This is <b>HTML</b> post2",
  "labels"  : [
                "test_post",
                "test",
                "post"
              ]
};
Run Code Online (Sandbox Code Playgroud)