Box Developerドキュメントの新しいベータ版サイトがまもなくリリースされる予定です。最新の開発者向けガイド、APIリファレンス、AI搭載の検索により、Boxを使用した迅速な開発をサポートします。更新情報については今しばらくお待ちください。
特定のファイルバージョンを昇格させます。
以前のバージョンが存在する場合は、この方法を使用して古いバージョンのいずれかをバージョン履歴の先頭に移動できます。
これにより、古いバージョンの新しいコピーが作成されて、バージョン履歴の先頭に配置されます。このファイルは古いバージョンとまったく同じ内容になり、ハッシュダイジェスト、etag、およびファイル名も同じになります。
コメントなど、他のプロパティが以前の値に更新されることはありません。
このエンドポイントは、PDF、DOC、PPTXなどのファイル形式で機能するため、Box Notesの復元には使用しないでください。
12345ファイルを表す一意の識別子。
ファイルIDを確認するには、ウェブアプリケーションでファイルにアクセスして、URLからIDをコピーします。たとえば、URLがhttps://*.app.box.com/files/123の場合、file_idは123です。
id,type,nameレスポンスに含める属性のコンマ区切りリスト。このパラメータを使用すると、標準のレスポンスには通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドはレスポンスに含まれず、リクエストしたフィールドのほかには、Mini版の表示のフィールドしか返されないことに注意してください。
"11446498"ファイルバージョンID。
"file_version"昇格させるタイプ。
次の値に固定: file_version
新しく作成されたファイルバージョンオ ブジェクトを返します。
予期しないクライアントエラー。
curl -i -X POST "https://api.box.com/2.0/files/12345/versions/current" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-H "content-type: application/json" \
-d '{
"type": "file_version",
"id": "456456"
}'await client.fileVersions.promoteFileVersion(file.id, {
requestBody: {
id: fileVersions.entries![0].id,
type: 'file_version' as PromoteFileVersionRequestBodyTypeField,
} satisfies PromoteFileVersionRequestBody,
} satisfies PromoteFileVersionOptionalsInput);client.file_versions.promote_file_version(
file.id, id=file_versions.entries[0].id, type=PromoteFileVersionType.FILE_VERSION
)await client.FileVersions.PromoteFileVersionAsync(fileId: file.Id, requestBody: new PromoteFileVersionRequestBody() { Id = NullableUtils.Unwrap(fileVersions.Entries)[0].Id, Type = PromoteFileVersionRequestBodyTypeField.FileVersion });try await client.fileVersions.promoteFileVersion(fileId: file.id, requestBody: PromoteFileVersionRequestBody(id: fileVersions.entries![0].id, type: PromoteFileVersionRequestBodyTypeField.fileVersion))client.getFileVersions().promoteFileVersion(file.getId(), new PromoteFileVersionRequestBody.Builder().id(fileVersions.getEntries().get(0).getId()).type(PromoteFileVersionRequestBodyTypeField.FILE_VERSION).build())await client.FileVersions.PromoteFileVersionAsync(fileId: file.Id, requestBody: new PromoteFileVersionRequestBody() { Id = NullableUtils.Unwrap(fileVersions.Entries)[0].Id, Type = PromoteFileVersionRequestBodyTypeField.FileVersion });await client.fileVersions.promoteFileVersion(file.id, {
requestBody: {
id: fileVersions.entries![0].id,
type: 'file_version' as PromoteFileVersionRequestBodyTypeField,
} satisfies PromoteFileVersionRequestBody,
} satisfies PromoteFileVersionOptionalsInput);{
"id": "12345",
"type": "file_version",
"created_at": "2012-12-12T10:53:43-08:00",
"modified_at": "2012-12-12T10:53:43-08:00",
"modified_by": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"name": "tigers.jpeg",
"purged_at": "2012-12-12T10:53:43-08:00",
"restored_at": "2012-12-12T10:53:43-08:00",
"restored_by": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc",
"size": 629644,
"trashed_at": "2012-12-12T10:53:43-08:00",
"trashed_by": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"uploader_display_name": "Ellis Wiggins",
"version_number": "1"
}