共有リンクで表されるファイルまたはフォルダを返します。
共有項目は、共有リンクで表されるファイルまたはフォルダであり、現在の会社内に存在する項目である場合も、別の会社内に存在する項目である場合もあります。
アプリケーションからこのエンドポイントを呼び出すと、共有項目についての情報を取得できます(共有リンクが存在する場合のみ)。
id,type,name
応答に含める属性のカンマ区切りリスト。このパラメータを使用すると、標準の応答には通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドは応答に含まれず、リクエストしたフィールドのほかには、簡易版レプリゼンテーションのフィールドしか返されないことに注意してください。
shared_link=https://cloud.box.com/shared/static/gjasdasjhasd&shared_link_password=letmein
共有リンクとその共有リンクの省略可能なパスワードを含むヘッダー。
このヘッダーの形式は次のようになります。
shared_link=[link]&shared_link_password=[password]
1
項目が変更されている場合にのみ、その項目を返します。
その項目の最後に認識されたetag
値をこのヘッダーに渡すと、それ以降に項目が変更されていない場合、エンドポイントは304 Not Modified
を返して失敗します。
curl -X GET https://api.box.com/2.0/shared_items \
-H 'Authorization: Bearer <ACCESS_TOKEN>" '
-H "BoxApi: shared_link=https://cloud.box.com/shared/static/gjasdasjhasd&shared_link_password=letmein"
String sharedLink = "https://app.box.com/s/abcdefghijklmnopqrstuvwxyz123456";
String password = "foo";
BoxItem.Info itemInfo = BoxItem.getSharedItem(api, sharedLink, password);
client.sharedItems.get(
'https://app.box.com/s/1a2b3c4d5e',
null,
{fields: 'type,id,parent,extension,shared_link'},
callback
);
client.sharedItems.get(
sharedLinkURL: "https://app.box.com/s/qqwertyuiopasdfghjklzxcvbnm123456"
) { (result: Result<SharedItem, BoxSDKError>) in
guard case let .success(item) = result else {
print("Error resolving shared item")
return
}
print("The shared link resolves to item:")
switch item {
case let .file(file):
print("- File \(file.name) (ID: \(file.id))")
case let .folder(folder):
print("- Folder \(file.name) (ID: \(file.id))")
case let .webLink(webLink):
print("- Web Link \(file.name) (ID: \(file.id))")
}
}