ファイル割当てメタデータ・コレクションの取得
/documents/api/1.2/files/{fileId}/metadataFields
リクエスト
- application/json
- application/xml
- fileId: string
ファイルのグローバル一意識別子(GUID)。
- directAssigned(optional): string
直接割り当てられたコレクションのみを取得するか(
1
)、または継承されたすべてのコレクションも含めるか(0
)を指定します。
- accessToken(optional): string
現在のユーザーに親フォルダまたはこのファイルにアクセスすることを許可するApplinkアクセス・トークン。 このパラメータは、
appLinkID
が使用されている場合は必須です。 これはaccessTokenまたはAccessTokenとして使用できます。 - appLinkID(optional): string
現在のユーザーに親フォルダまたはこのファイルにアクセスすることを許可するApplink ID。 パラメータ
appLinkID
が使用されるときはいつでも、パラメータaccessToken
も提供されなければなりません。 appLinkIDまたはAppLinkIDとして使用できます。
レスポンス
- application/json
- application/xml
200レスポンス
リクエストが処理されました。
object
- errorCode(optional): number
エラー・コードがゼロ(0)の場合は、エラーなしです
- idList(optional): string
元ファイルのグローバル一意識別子(GUID)
- metadataFields(optional): array metadataFields
- type(optional): string
アイテム・タイプ
file
。
object
- isEnabled(optional): string
コレクションの有効化(
1
)または無効化(0
)のステータス。 - isInherited(optional): string
コレクション継承(
1
)または直接割り当て(0
)のステータス。 - items(optional): array items
フィールド定義のリスト。
- type(optional): string
アイテム・タイプ
collection
。
array
- Array of: object CollectionFieldDefinition
メタデータ・フィールド定義。
object
- fieldDescription(optional): string
フィールドの説明。
- fieldName(optional): string
フィールド名。
- fieldType(optional): string
フィールド・タイプ。
- isEnabled(optional): string
フィールドの有効(1)または無効(0)ステータス。
- type(optional): string
アイテム・タイプ
field
。
{
"idList":"D3C1C1F319CFE6B102095C5DT0000000000100000001",
"type":"file",
"errorCode":"0",
"metadataFields":{
"CollectionA":{
"isEnabled":1,
"isInherited":1,
"type":"collection",
"items":[
{
"type":"field",
"fieldName":"A1",
"fieldType":"string",
"isEnabled":1
},
{
"type":"field",
"fieldName":"A2",
"fieldType":"string",
"isEnabled":0
}
]
},
"CollectionB":{
"isEnabled":1,
"isInherited":0,
"type":"collection",
"items":[
{
"type":"field",
"fieldName":"B1",
"fieldType":"string",
"isEnabled":0
},
{
"type":"field",
"fieldName":"B2",
"fieldType":"string",
"isEnabled":1
}
]
}
}
}
400レスポンス
リクエスト・パラメータが正しい形式ではありません。
404レスポンス
ファイルIDが見つかりません。
例
次の例では、指定したファイルに関連付けられたメタデータ・コレクション・フィールドが返されます。 この例では、ファイルおよび親フォルダの両方にメタデータ・コレクションが関連付けられています。 レスポンスには、フォルダ・コレクション( CollectionA
)の後にファイル・コレクション( CollectionB
)がリストされます。 メタデータ・コレクションごとに、レスポンスですべてのフィールドの定義が返されます。 また、ステータス・フィールドの値isEnabled
は、コレクションまたはフィールドが有効化されているか(1
)、または無効化されているか(0
)を示します。 フィールドisInherited
は、CollectionA
が親フォルダから継承されている(1
)ことを示し、フィールドには、CollectionB
がこのファイルに直接割り当てられているため、継承されていない(0
)ことも示されています。
GET .../files/D006C2CDD62654ABDCE0B8104EE870070A1AA68C3354/metadataFields
リクエスト・ヘッダー
なし。
リクエスト本文
なし。
HTTPステータス・コード
HTTP_STATUS = 200
JSONレスポンス
{ "errorCode": "0", "idList": "D006C2CDD62654ABDCE0B8104EE870070A1AA68C3354", "metadataFields": { "CollectionA": { "isEnabled": "1", "isInherited": "1", "type": "collection", "items": [ { "type": "field", "fieldName": "A1", "fieldType": "string", "isEnabled": "1" }, { "type": "field", "fieldName": "A2", "fieldType": "string", "isEnabled": "0" } ] }, "CollectionB": { "isEnabled": "1", "isInherited": "0", "type": "collection", "items": [ { "type": "field", "fieldName": "B1", "fieldType": "string", "isEnabled": "0" }, { "type": "field", "fieldName": "B2", "fieldType": "string", "isEnabled": "1" } ] } }, "type": "file" }
例2
次の例では、指定したファイルに関連付けられたメタデータ・コレクション・フィールドが返されます。 この例では、ファイルおよび親フォルダの両方にメタデータ・コレクションが関連付けられています。 レスポンスには、フォルダ・コレクション( CollectionA
)の後にファイル・コレクション( CollectionB
)と、このユーザーが作成し、フォルダにも割り当てた個人コレクション( Personal.CollectionA
)がリストされます。 メタデータ・コレクションごとに、レスポンスですべてのフィールドの定義が返されます。 また、ステータス・フィールドの値isEnabled
は、コレクションまたはフィールドが有効化されているか(1
)、または無効化されているか(0
)を示します。 フィールドisInherited
は、CollectionA
およびPersonal.CollectionA
が親フォルダから継承されていること(1
)を示し、このファイルに直接割り当てられているため、このフィールドにはCollectionB
が継承されていないことも示しています(0
)。
GET .../files/D006C2CDD62654ABDCE0B8104EE870070A1AA68C3354/metadataFields
リクエスト・ヘッダー
なし。
リクエスト本文
なし。
HTTPステータス・コード
HTTP_STATUS = 200
JSONレスポンス
{ "errorCode": "0", "idList": "D006C2CDD62654ABDCE0B8104EE870070A1AA68C3354", "metadataFields": { "CollectionA": { "isEnabled": "1", "isInherited": "1", "type": "collection", "items": [ { "type": "field", "fieldName": "A1", "fieldType": "string", "isEnabled": "1" }, { "type": "field", "fieldName": "A2", "fieldType": "string", "isEnabled": "0" } ] }, "CollectionB": { "isEnabled": "1", "isInherited": "0", "type": "collection", "items": [ { "type": "field", "fieldName": "B1", "fieldType": "string", "isEnabled": "0" }, { "type": "field", "fieldName": "B2", "fieldType": "string", "isEnabled": "1" } ] }, "Personal.CollectionA": { "isEnabled": "1", "isInherited": "1", "type": "collection", "items": [ { "type": "field", "fieldName": "A1", "fieldType": "string", "isEnabled": "1" }, { "type": "field", "fieldName": "A2", "fieldType": "string", "isEnabled": "0" } ] } }, "type": "file" }
例3
次の例では、指定したファイルに関連付けられたメタデータ・コレクション・フィールドが返されます。 このファイルは現在のユーザーが所有していない、または共有していないフォルダ構造の下にあるため、この例ではapplink IDを使用しています。 applink IDとアクセス・トークンはリクエスト・ヘッダーに送信されます。
GET .../files/DED694950C14AFF280419F9AB5D17B95F47087F4E518/metadataFields
リクエスト・ヘッダー
appLinkID: LF5Bxj4TPo_p4n4qWn0tbKTicR2cTUJKv7X_ng9E7ry93rRuDokPqS1d6-wKwhb_wtcGYFDsI_cNMxeKQ-HR-FXQhiVoGRTYM_MPZY8qpICfYU94mmnMjM_cvsRhKMzc0NJgvwEJfqqDwPsAVrhc8cmg== accessToken: 352FpiMmW66PeYI1Gh5b83I9CXRwZhLfYAu4TXdqpzD8uNKUBMZVVJ3ZvivUW8kQ
リクエスト本文
なし。
HTTPステータス・コード
HTTP_STATUS = 200
JSONレスポンス
{ "errorCode": "0", "idList": "DED694950C14AFF280419F9AB5D17B95F47087F4E518", "metadataFields": { "ApplinkCollection": { "isEnabled": "1", "isInherited": "1", "type": "collection", "items": [ { "type": "field", "fieldName": "appField1", "fieldType": "string", "isEnabled": "1" }, { "type": "field", "fieldName": "appField2", "fieldType": "string", "isEnabled": "1" } ] } }, "type": "file" }