2
docsによれば、If-Match eTagはコレクションからアイテムを削除する必要はありませんが、 :Google Appsスクリプトを使用してコレクションからリソースを削除する際にETagエラーを解決するには
"Request failed for returned code 403. Server response:
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>matchHeaderRequired</code>
<location type='header'>If-Match|If-None-Match</location>
<internalReason>If-Match or If-None-Match header or entry etag attribute required</internalReason>
</error>
</errors>"
私は何が欠けていますか?実際にリソースをゴミ箱に入れたいのであれば、どのようにIf-Matchタグを指定すればよいでしょうか?私は "If-Match:" * ""を私のオプションで固執しようとしましたが、成功することはありませんでした。
これは、このPythonクライアントライブラリのエラーに関連していますか? DeleteResource from Google Docs with Python
マイApps Scriptのコードは次のとおりです。オプションのための
function deleteResourceFromCollection_(originCollectionId,resourceId) {
var options = buildDeleteOptions_();
var result = UrlFetchApp.fetch(DOC_API_URL+ACTIVE_USER+"/private/full/"+originCollectionId+"/contents/"+resourceId, options);
}
//////////////////////////////////////////////
// Build URLFetchApp Delete Options
//////////////////////////////////////////////
function buildDeleteOptions_() {
return {
method : "delete",
headers : {"GData-Version": "3.0"},
oAuthServiceName: "google",
oAuthUseToken: "always",
};
}
あなたがもしマッチを入れていました:ヘッダに? –