Blogger API中的URL和customMetaData选项
我正在使用BloggerAPI创建帖子 在Blogger API的文档中: 在文章的资源表示中,我对两列感兴趣:url和customMetaData 我可以设置标题和内容,但URL和搜索描述不起作用 我想在customMetaData中发送搜索描述,但我不知道所需的JSON结构,因为文档中没有给出这样的内容 我的代码:Blogger API中的URL和customMetaData选项,api,google-apps-script,google-api,blogger,google-api-client,Api,Google Apps Script,Google Api,Blogger,Google Api Client,我正在使用BloggerAPI创建帖子 在Blogger API的文档中: 在文章的资源表示中,我对两列感兴趣:url和customMetaData 我可以设置标题和内容,但URL和搜索描述不起作用 我想在customMetaData中发送搜索描述,但我不知道所需的JSON结构,因为文档中没有给出这样的内容 我的代码: var postUrl = "https://www.googleapis.com/blogger/v3/blogs/blogId/posts"; postUrl = p
var postUrl = "https://www.googleapis.com/blogger/v3/blogs/blogId/posts";
postUrl = postUrl.replace("blogId",blogId);
var options = {
method:"post",
contentType:"application/json",
headers: { Authorization: "Bearer "+ ScriptApp.getOAuthToken()},
muteHttpExceptions: true,
payload: JSON.stringify({
title: title,
content: content,
url: url,
customMetaData: JSON.stringify({
description: description
})
})
}
var res = UrlFetchApp.fetch(postUrl, options).getContentText();
Logger.log(res)
你找到解决办法了吗?没有,什么都没找到。我认为目前不可能。你找到解决方案了吗?没有,什么都没有找到。我认为这目前是不可能的。
var postUrl = "https://www.googleapis.com/blogger/v3/blogs/blogId/posts";
postUrl = postUrl.replace("blogId",blogId);
var options = {
method:"post",
contentType:"application/json",
headers: { Authorization: "Bearer "+ ScriptApp.getOAuthToken()},
muteHttpExceptions: true,
payload: JSON.stringify({
title: title,
content: content,
url: url,
customMetaData: JSON.stringify({
description: description
})
})
}
var res = UrlFetchApp.fetch(postUrl, options).getContentText();
Logger.log(res)