Item models
Item models
This article contains the definitions of the different models that allow you to manage items and their permission models in a Push source. It also provides coherent model instance examples.
BatchDocumentBody
See also:
Key | Value type |
---|---|
|
Array of |
|
Array of |
Sample BatchUploadDocumentBody
{
"addOrUpdate": [
{
"author": "Alice Smith",
"date": "2017-11-08T12:18:41.666Z",
"documenttype": "Text",
"filename": "mytext.txt",
"language": [
"English"
],
"permanentid": "sample2156permanent165464id",
"sourcetype": "Push",
"title": "My Text",
"data": "This is a sample text written by Alice Smith.",
"documentId": "http://www.example.com/mytext.txt",
"fileExtension": ".txt",
"permissions": [
{
"allowAnonymous": true
}
]
},
{
"documenttype": "Image",
"filename": "myimage.png",
"height": 200,
"permanentid": "my56182image65132permanent5456id",
"sourcetype": "Push",
"width": 200,
"compressedBinaryData": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAp80lEQVR4nOx9C5QU1bnu7tdMz3uG[...]",
"compressionType": "UNCOMPRESSED",
"documentId": "http://www.example.com/mypost/myimage.png",
"fileExtension": ".png",
"parentId": "http://www.example.com/mypost/",
"permissions": [
{
"allowAnonymous": true
}
]
},
{
"author": "Sample Group",
"documenttype": "Video",
"duration": 180.72,
"filename": "myvideo.avi",
"language": [
"English"
],
"permanentid": "my94293video03938permanent93892id",
"sourcetype": "Push",
"title": "My Video",
"compressedBinaryDataFileId": "b5e8767e-8f0d-4a89-9095-1127915c89c7",
"compressionType": "LZMA",
"documentId": "http://www.example.com/myvideo.avi",
"fileExtension": ".avi",
"permissions": [
{
"name": "MyPermissionLevel1",
"permissionSets": [
{
"allowAnonymous": false,
"allowedPermissions": [
{
"identity": "SampleGroup",
"identityType": "Group"
}
],
"deniedPermissions": [
{
"identity": "asmith@example.com",
"identityType": "User",
"securityProvider": "My Security Identity Provider"
}
]
}
]
},
{
"name": "MyPermissionLevel2",
"permissionSets": [
{
"allowAnonymous": false,
"allowedPermissions": [
{
"identity": "SampleGroup2",
"identityType": "Group"
}
],
"deniedPermissions": [
{
"identity": "bjones@example.com",
"identityType": "User"
}
]
}
]
}
]
}
],
"delete": [
{
"documentId": "http://www.example.com/mydeleteditem/",
"deleteChildren": true
}
]
}
DocumentBody
See also:
Key | Value type | Note | See also |
---|---|---|---|
|
Number | String | Boolean | Array<Number | String | Boolean> |
A metadata key can have any name, except one of the |
|
|
String |
Use this property, |
|
|
String |
Use this property, |
|
|
String enum ( |
Only include when not using the |
|
|
String |
Use this property, |
|
|
String |
Mandatory in payload when managing batches of items.
When adding or updating single items, the |
|
|
String |
Value must include preceding dot character ( |
|
|
Long |
Only include in very specific cases when item is part of a batch |
|
|
String |
Only include to establish a parent-child relationship between items. |
|
|
Array< |
Only include if pushing item in a secured Push source. |
Sample DocumentBody - Raw textual item
{
"author": "Alice Smith",
"date": "2017-11-08T12:18:41.666Z",
"documenttype": "Text",
"filename": "mytext.txt",
"language": [
"English"
],
"permanentid": "my93849text03985permanent93849id",
"sourcetype": "Push",
"title": "My Text",
"data": "This is a sample text written by Alice Smith.",
"fileExtension": ".txt"
}
Sample DocumentBody - Child binary item with single permission set
{
"documenttype": "Image",
"filename": "myimage.png",
"height": 200,
"permanentid": "my838290image93940permanent9394id",
"sourcetype": "Push",
"width": 200,
"CompressedBinaryData": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAp80lEQVR4nOx9C5QU1bnu7tdMz3uG[...]",
"fileExtension": ".png",
"parentId": "http://www.example.com/mypost/",
"permissions": [
{
"allowAnonymous": true
}
]
}
Sample DocumentBody - Binary item with many permission levels
{
"author": "Sample Group",
"documenttype": "Video",
"duration": 180.72,
"filename": "myvideo.avi",
"language": [
"English"
],
"permanentid": "my93920video8472permanent94820id",
"sourcetype": "Push",
"title": "My Video",
"compressedBinaryDataFileId": "b5e8767e-8f0d-4a89-9095-1127915c89c7",
"fileExtension": ".avi",
"permissions": [
{
"name": "MyPermissionLevel1",
"permissionSets": [
{
"allowAnonymous": false,
"allowedPermissions": [
{
"identity": "SampleGroup",
"identityType": "Group"
}
],
"deniedPermissions": [
{
"identity": "asmith@example.com",
"identityType": "User",
"securityProvider": "My Security Identity Provider"
}
]
}
]
},
{
"name": "MyPermissionLevel2",
"permissionSets": [
{
"allowAnonymous": false,
"allowedPermissions": [
{
"identity": "SampleGroup2",
"identityType": "Group"
}
],
"deniedPermissions": [
{
"identity": "bjones@example.com",
"identityType": "User"
}
]
}
]
}
]
}
DeletedItem
Key | Value type |
---|---|
|
String |
|
Boolean |
Sample DeletedItem
{
"documentId": "http://www.example.com/mydeleteditem/",
"deleteChildren": true
}
PermissionLevelsModel
See also:
Key | Value type |
---|---|
|
String |
|
Array of |
Sample PermissionLevelsModel
{
"name": "MyPermissionLevel",
"permissionSets": [
{
"allowAnonymous": false,
"allowedPermissions": [
{
"identity": "SampleGroup",
"identityType": "Group"
}
],
"deniedPermissions": [
{
"identity": "asmith@example.com",
"identityType": "User",
"securityProvider": "My Security Identity Provider"
}
]
}
]
}
PermissionSetsModel
See also:
Key | Value type |
---|---|
|
Boolean |
|
Array of |
|
Array of |
Sample PermissionSetsModel - Allow all users
{
"allowAnonymous": true
}
Sample PermissionSetsModel - Allow and deny security identities
{
"allowAnonymous": false,
"allowedPermissions": [
{
"identity": "SampleGroup",
"identityType": "Group"
}
],
"deniedPermissions": [
{
"identity": "asmith@example.com",
"identityType": "User",
"securityProvider": "My Security Identity Provider"
}
]
}
PermissionIdentityModel
Key | Value type |
---|---|
|
String |
|
|
|
String |
Sample PermissionIdentityModel
{
"identity": "asmith@example.com",
"identityType": "User",
"securityProvider": "My Security Identity Provider"
}