メインコンテンツへスキップ
DELETE
/
files
/
{file_id}
cURL
curl -i -X DELETE "https://api.box.com/2.0/files/12345" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
{
  "type": "error",
  "status": 400,
  "code": "item_name_invalid",
  "message": "Method Not Allowed",
  "context_info": {
    "message": "Something went wrong"
  },
  "help_url": "https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/",
  "request_id": "abcdef123456"
}
このリソースは、バージョン2024.0のエンドポイントで使用されています。 詳細については、 Box APIのバージョン管理を参照してください。Box SDKのバージョニング戦略について詳しく学ぶ。」

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

if-match
string

変更を加える前にこの項目が最近変更されていないことを確認します。

その項目の最後に認識されたetag値をこのヘッダーに渡すと、それ以降に項目が変更されている場合、エンドポイントは412 Precondition Failedを返して失敗します。

Path Parameters

file_id
string
required

ファイルを表す一意の識別子。

ファイルIDを確認するには、ウェブアプリケーションでファイルにアクセスして、URLからIDをコピーします。たとえば、URLがhttps://*.app.box.com/files/123の場合、file_id123です。

Response

ファイルが正常に削除された場合は、空のレスポンスを返します。