ファイル・パブリック・リンク取得
get
/documents/api/1.2/publiclinks/file/{fileId}
指定されたファイルのパブリック・リンクのリストを返します。
リクエスト
サポートされるメディア・タイプ
- application/json
- application/xml
パス・パラメータ
- fileId: string
ファイルのグローバル一意識別子(GUID)。
レスポンス
サポートされるメディア・タイプ
- application/json
- application/xml
200レスポンス
リクエストが処理されました。
ルート・スキーマ: FileLinksResponse
タイプ:
objectレスポンス本文には、指定したファイルに定義されたパブリック・リンクに関する情報が含まれます。
ソースを表示
- count(optional): string
ページにリストされるアイテムの数
- errorCode(optional): string
エラー・コードがゼロ(0)の場合は、エラーなしです
- id(optional): string
ファイルのグローバル一意識別子(GUID)。
- items(optional): array items
公開リンクのリスト。
- type(optional): string
アイテム・タイプ
file。
ネストされたスキーマ: PublicLinkDefinition
タイプ:
objectパブリック・リンク情報。
ソースを表示
- assignedUsers(optional): string
リンクを使用できるユーザーのグループ。
- createdTime(optional): string
パブリック・リンクが作成された日時。
- expirationTime(optional): string
パブリック・リンクの期限が切れる日時
- lastModifiedTime(optional): string
パブリック・リンクが最後に変更された日時
- linkID(optional): string
パブリック・リンクのグローバル一意識別子(GUID)。
- linkName(optional): string
パブリック・リンクの名前。
- ownedBy(optional): object User
ユーザー情報
- password(optional): string
パブリック・リンクのパスワード。 使用できるのは8文字以上50文字以下です。 パスワードでは、大文字と小文字が区別されます。
- role (オプション): string
使用可能な値:
[ "viewer", "downloader", "contributor" ]共有アイテムへのアクセス・レベル - type(optional): string
アイテム・タイプ
publiclink。
ネストされたスキーマ: User
タイプ:
objectユーザー情報
ソースを表示
- displayName(optional): string
ユーザーの表示名
- id(optional): string
ユーザーのグローバル一意識別子(GUID)。
- loginName(optional): string
ユーザーのログイン名。
- type(optional): string
アイテム・タイプ
user。
レスポンスの例(application/json)
{
"count":"2",
"id":"D1E1E9F089AC1EF8481E5B94T0000000000100000001",
"type":"file",
"errorCode":"0",
"items":[
{
"linkID":"LDFD004B846DB106DB8B2906T0000000000100000001",
"linkName":"MyFileLinkOne",
"assignedUsers":"@everybody",
"role":"contributor",
"type":"publiclink",
"createdTime":"2015-06-10T16:13:19Z",
"lastModifiedTime":"2015-06-10T16:13:19Z",
"expirationTime":"2017-01-01T00:00:01Z",
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
}
},
{
"linkID":"LF5E5F73A444FFB8924EF8ACT0000000000100000001",
"linkName":"MyFileLinkTwo",
"assignedUsers":"@everybody",
"role":"contributor",
"type":"publiclink",
"createdTime":"2015-06-10T16:17:11Z",
"lastModifiedTime":"2015-06-10T16:17:11Z",
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
}
}
]
}
400レスポンス
リクエスト・パラメータが正しい形式ではありません。
403レスポンス
ユーザーに読取り権限がない場合は禁止されています。
404レスポンス
ファイルIDが見つかりません。
例
次の例では、指定したファイルに定義されたパブリック・リンクに関する情報が返されます。
GET .../publiclinks/file/D1E1E9F089AC1EF8481E5B94T0000000000100000001
リクエスト・ヘッダー
なし。
リクエスト本文
なし。
HTTPステータス・コード
HTTP_STATUS = 200
JSONレスポンス
{
"count": "2",
"errorCode": "0",
"id": "D1E1E9F089AC1EF8481E5B94T0000000000100000001",
"type": "file",
"items": [
{
"type": "publiclink",
"linkID": "LDFD004B846DB106DB8B2906T0000000000100000001",
"linkName": "MyFileLinkOne",
"ownedBy": {
"displayName": "User AA",
"loginName": "userAALoginName",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"role": "contributor",
"assignedUsers": "@everybody",
"createdTime": "2015-06-10T16:13:19Z",
"lastModifiedTime": "2015-06-10T16:13:19Z",
"expirationTime": "2017-01-01T00:00:01Z"
},
{
"type": "publiclink",
"linkID": "LDF81E2BEDFDC8D8B3D2FB65T0000000000100000001",
"linkName": "MyFileLinkTwo",
"ownedBy": {
"displayName": "User AA",
"loginName": "userAALoginName",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"role": "contributor",
"assignedUsers": "@everybody",
"createdTime": "2015-06-10T16:17:11Z",
"lastModifiedTime": "2015-06-10T16:17:11Z"
}
]
}
例2
次の例では、戻り値は正常に返されますが、ファイルIDにはパブリック・リンクがありません。
GET .../publiclinks/file/D67E2BA6086ED32238E0E56F45B3E9DD64907CA0D19F
リクエスト・ヘッダー
なし。
リクエスト本文
なし。
HTTPステータス・コード
HTTP_STATUS = 200
JSONレスポンス
{
"count": "0",
"errorCode": "0",
"id": "D67E2BA6086ED32238E0E56F45B3E9DD64907CA0D19F",
"type": "file"
}
例3
次の例では、ファイルIDが無効なためにエラーが返されます。
GET .../publiclinks/file/D7A271E0FCA45152EB13971E45B3E9DD64907CA0D19F
リクエスト・ヘッダー
なし。
リクエスト本文
なし。
HTTPステータス・コード
HTTP_STATUS = 404
JSONレスポンス
{
"count": "0",
"errorCode": "-16",
"errorKey": "!csUnableToRetrieveSharedLinkInfo!csSecurityValidationFailed!csFldDoesNotExist,D7A271E0FCA45152EB13971E45B3E9DD64907CA0D19F!csUnprivilegedSystemError",
"errorMessage": "Failed to retrieve shared link information. Security validation failed. 'D7A271E0FCA45152EB13971E45B3E9DD64907CA0D19F' does not exist. The error was caused by an internally generated issue. The error has been logged.",
"errorType": "file",
"id": "D7A271E0FCA45152EB13971E45B3E9DD64907CA0D19F",
"title": "Failed to retrieve shared link information. Security validation failed. 'D7A271E0FCA45152EB13971E45B3E9DD64907CA0D19F' does not exist. The error was caused by an internally generated issue. The error has been logged.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}