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
addOrUpdate Array of DocumentBody
delete Array of DeletedItem

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
<metadata>* Number | String | Boolean | Array<Number | String | Boolean> A metadata key can have any name, except one of the DocumentBody property names listed below. About Push Source Item Metadata
compressedBinaryData String Use this property, compressedBinaryDataFileId, or data to push item data. Using the compressedBinaryData Property
compressedBinaryDataFileId String Use this property, compressedBinaryData, or data to push item data. Using the compressedBinaryDataFileId Property
compressionType String enum (Deflate/"DEFLATE" | GZip/"GZIP" | LZMA/"LZMA" | Uncompressed/"UNCOMPRESSED" | ZLib/"ZLIB") Only include when not using the data property to push item data. Values are case-sensitive (must be properly capitalized when pushing a single item, or all in uppercase when pushing a batch of items). Pushing Item Data
data String Use this property, compressedBinaryData, or compressedBinaryDataFileId to push item data. Using the data Property
documentId String Mandatory in payload when managing batches of items. When adding or updating single items, the documentId is specified in the query string instead. Manage batches of items in a Push source
fileExtension String Value must include preceding dot character (.). Pushing Item Data
orderingId Long Only include in very specific cases when item is part of a batch About the orderingId Parameter
parentId String Only include to establish a parent-child relationship between items. About the parentId Property
permissions Array<PermissionSetsModel | PermissionLevelsModel> Only include if pushing item in a secured Push source. Simple Permission Model Definition Examples / Complex Permission Model Definition Example

Sample DocumentBody - Pushing a raw textual item along with some standard metadata

{
  "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 - Pushing a binary item that’s a child of another item, along with a 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 - Pushing a binary item along 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
documentId String
deleteChildren Boolean

Sample DeletedItem

{
  "documentId": "http://www.example.com/mydeleteditem/",
  "deleteChildren": true
}

PermissionLevelsModel

See also:

Key Value type
name String
permissionSets Array of PermissionSetsModel
{
  "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
allowAnonymous Boolean
allowedPermissions Array of PermissionIdentityModel
deniedPermissions Array of PermissionIdentityModel

Sample PermissionSetsModel - Allowing all users

{
  "allowAnonymous": true
}

Sample PermissionSetsModel - Allowing and denying specific 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
identity String
identityType User|Group|VirtualGroup|Unknown
securityProvider String

Sample PermissionIdentityModel

{
  "identity": "asmith@example.com",
  "identityType": "User",
  "securityProvider": "My Security Identity Provider"
}