- 【MACRO】Google Apps Script 質問スレ【DRIVE】
254 :デフォルトの名無しさん[sage]:2015/07/19(日) 04:21:49.78 ID:eNaDFGYO - 分かる人がいたら教えて下さい
function upload() { var clientId = '*************'; var imgUrl = 'http://www.google.co.jp/images/srpr/logo11w.png'; var service = getService(); //aouth2のなんか if (service.hasAccess()) { var url = 'https://api.imgur.com/3/image'; var response = UrlFetchApp.fetch(url, { //ここでエラーが出る method: 'post', headers: { Authorization: 'Client-ID ' + clientId, }, data: { image: imgUrl, type: 'URL' } }); var result = JSON.parse(response.getContentText()); return result; } else { こういうエラーが出ます {"data":{"error":"No image data was sent to the upload api","request":"\/3\/image","method":"POST"},"success":false,"status":400} どこが間違えてるんでしょうか imgur apiのページ https://api.imgur.com/
|