0
我想使用Sniply API與以下谷歌腳本代碼,但我不斷收到一條錯誤消息。除了按鈕配置一切似乎正常工作,順便說一句。谷歌腳本button_action提取錯誤
代碼如下:
// Main Parmaters
var url = "picky.com"
var message = "This is a text from the Google Spreadsheet API2"
// Button Parameters (Optional)
var button_text = "I am a button2"
var button_url = "mailto:[email protected]"
var button_background_color = "#000000"
var button_text_color = "#ffffff"
// Button (Optional)
var button_action =
{
"text": button_text,
"url": button_url,
"text_color": button_text_color,
"background_color": button_background_color,
}
var sniply =
{
"button_action": button_action,
"url": url,
"message": message,
}
var options =
{
"method": "post",
"headers" : {
"Authorization" : accesstoken,
},
"payload": sniply,
}
var response = UrlFetchApp.fetch('http://snip.ly/api/snips/', options);
Logger.log(response.getContentText());
錯誤消息,我得到的是:
要求失敗,返回http://snip.ly/api/snips/代碼400截斷服務器響應:{ 「BUTTON_ACTION」:[{ 「non_field_errors」 :「無效數據」]}]}(請使用muteHttpExceptions選項查看完整迴應)
我將不勝感激,如果你能幫助我..
歡呼聲, EMG