About this resource

Representation of a paged collection of Rule items

Properties

Property Description Type
items One page of this paged collection, which is a subcollection of the complete collection. Collection of Rule items
page The current page of this paged collection. int32
pageSize The current page size of this paged collection. int32
skip The current skip size of this paged collection. int32
take The current take size of this paged collection. int32
totalCount The total count of items in this paged collection, not just on the current page. int64

Relations

Method Name Select-key Resource type Description
GET self Provides a link to this resource.
GET first A link to the first page of this paged collection.
GET prev A link to the previous page of this paged collection.
GET next A link to the next page of this paged collection.
GET last A link to the last page of this paged collection.

Actions

Method Action Description Response codes
POST /rules add Create a rule
201 Request completed successfully. The header parameter 'Location' contains the location of the new rule resource. The response body is a JSON object which contains the property "id" that corresponds to the newly created rule resource id.
400 Bad request (in general)
403 Insufficient permissions

Examples

Creating a rule In order to create a rule, you must specify at least one condition and one action. It is mandatory to specify the target of the rule.
The following rule targets are supported:
  • Classification
  • Collection
  • Record / File
  • SavedView
The following rule triggers are supported:
  • WhenSavedOrDeleted
  • Daily
POST /rules
{
"name": "Rule Name",
"enabled": "true",
"includeDraftRecords": "false",
"target": "Record",
"trigger": "WhenSavedOrDeleted",
"Conditions": {
"AddOrUpdate": [
{
"Reference": "<ref:httpRequest uri=\"https://YourFunction.azurewebsites.net/api/...\" timeout=\"0.1\" retryCount=\"3\" />",
    "ConditionType": "Reference"
    },
  {
    "Reference": "<ref:httpRequest uri=\"https://YourFunction.azurewebsites.net/api/...\" retryCount=\"3\" />",
    "ConditionType": "Reference"
  }
  ]
    },
"actions": {
    "addOrUpdate": [
    {
      "ActionType": "Reference",
      "Reference": "<ref:httpRequest uri=\"https://YourFunction.azurewebsites.net/api/...\" />",
      "ExecutionTime": "Immediately"
    },
    {
      "ActionType": "RefreshFiles"
    },
    {
      "ActionType": "ClassifyRecord",
      "gettingType": "Specified",
      "classificationId": "55b92c87-7b43-4a84-89eb-a81300fae7aa"
    },
    {
      "actionType": "ClassifyRecord",
      "gettingType": "CalculatedByReference",
      "identifierType": "NamePath",
      "reference": "<ref:text out=\"root\" />"
    },
    {
      "actionType": "ClassifyRecord",
      "gettingType": "CalculatedByReference",
      "identifierType": "Identifier",
      "reference": "<ref:text out=\"55b92c87-7b43-4a84-89eb-a81300fae7aa\" />"
    },
    {
      "ActionType": "UnclassifyRecord",
      "gettingType": "Specified",
      "classificationId": "55b92c87-7b43-4a84-89eb-a81300fae7aa"
    },
    {
      "actionType": "UnclassifyRecord",
      "gettingType": "CalculatedByReference",
      "identifierType": "NamePath",
      "reference": "<ref:text out=\"root\" />"
    },
    {
      "actionType": "UnclassifyRecord",
      "gettingType": "CalculatedByReference",
      "identifierType": "Identifier",
      "reference": "<ref:text out=\"55b92c87-7b43-4a84-89eb-a81300fae7aa\" />"
    }
    ]
 }
}

Rule conditions

The following values are available for ConditionType:
  • ClassificationLinked
  • ClassificationUnlinked
  • ClassifiedIn
  • CurrentlyLoggedOnUser
  • FileAdded
  • MovieAddedWithoutMoviePreview
  • ObjectChanged
  • ObjectCreatedOrChanged
  • ObjectCreated
  • ObjectDeleted
  • Reference
  • CompareFieldValue
  • HasFieldValueChanged
  • ContentTypeIs
  • ContentTypeSetTo
  • ContentTypeChanged
  • RecordStatusIs
  • RecordStatusSetTo
  • RecordStatusChanged
Bear in mind that when using Daily as trigger only the ContentTypeIs, ClassifiedIn and CompareFieldValue conditions are supported.

ClassificationLinked

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when a record has just been classified in the specified classification.
AttributeDescription
ClassificationId id of the classification, to where record has just been classified
DirectLinkOnly Whether the rule should only be triggered if the record is linked directly in the specified classification (and not only in one of its child classifications)
Example:
{
  "ConditionType": "ClassificationLinked",
  "directLinkOnly": true,
  "ClassificationId": "30b92c87-7b43-4a84-89eb-a81300fae78d"
}

ClassificationUnlinked

Only supported on records and combined with the WhenSavedOrDeleted trigger. Trigger when a record has just been unlinked from the specified classification.
AttributeDescription
ClassificationId id of the classification, from which record has just been unlinked
DirectLinkOnly Whether the rule should only be triggered if the record is unlinked from the specified classification directly (and not from one of its child classifications)
Example:
{
  "ConditionType": "ClassificationUnlinked",
  "directLinkOnly": false,
  "ClassificationId": "55b92c87-7b43-4a84-89eb-a81300fae7aa"
}

ClassifiedIn

Available only for records. Trigger when the target record is already classified in the specified classification.
AttributeDescription
ClassificationId id of the classification, to where record is already have been classified
DirectLinkOnly Whether the condition only applies when the record is classified directly in the classification or also in one of its descendants
Example:
{
  "ConditionType": "ClassifiedIn",
  "directLinkOnly": true,
  "ClassificationId": "14b92c87-7b43-4a84-89eb-a81300fae799"
}

CurrentlyLoggedOnUser

Only supported with the WhenSavedOrDeleted trigger. Trigger when the user triggering the rule matches the specified user.
AttributeDescription
UserId id of a user, that triggers the rule
IsUser Whether the user triggering the rule matches the specified user or not
Example:
{
  "ConditionType": "CurrentlyLoggedOnUser",
  "IsUser": true,
  "UserId": "14b92c87-7b43-4a84-89eb-a81300fae799"
}

FileAdded

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when a file has been added to a record.
Example:
{
  "ConditionType": "FileAdded"
}

MovieAddedWithoutMoviePreview

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when a file has been added to a record of the specified file format, and no preview has been created yet for that file.
AttributeDescription
MoviePreviewExtension Extension of a movie without preview
Example:
{
  "ConditionType": "MovieAddedWithoutMoviePreview",
  "MoviePreviewExtension": "MP4",
}

ObjectChanged

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when an object of the target type has been modified in any way. For a record this could be a change in classifications, Field values, a File that has been added or removed, etc...
Example:
{
   "ConditionType": "ObjectChanged"
}

ObjectCreatedOrChanged

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when an object of the target type has been created or modified.
Example:
{
    "ConditionType": "ObjectCreatedOrChanged"
}

ObjectCreated

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when an object of the target type has been created.
Example:
{
"ConditionType": "ObjectCreated"
}

ObjectDeleted

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when an object of the target type has been deleted.
Example:
{
  "ConditionType": "ObjectDeleted"
}

Reference

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when the specified reference returns True.
AttributeDescription
Reference Reference to be executed
Example:
{
  "ConditionType": "Reference",
  "Reference": "<ref:httpRequest uri=\"https://YourFunction.azurewebsites.net/api/...\" />"
}

CompareFieldValue

Triggers when the field value comparison in the expression returns True
AttributeDescription
ManualConditionType Possible values: State, Change.
Expression A field comparison expression, e.g. Status='Approved' or 'ExpirationDate > Now + 30'
Example:
{
  "ConditionType": "CompareFieldValue",
  "Expression": "field_name = 'somevalue'",
  "ManualConditionType": "Change"
}

HasFieldValueChanged

Only supported on records and combined with the WhenSavedOrDeleted trigger. Triggers when value of the specified field changed.
AttributeDescription
FieldDefinitionId Id of the field whose value is watched.
Example:
{
  "ConditionType": "HasFieldValueChanged",
  "FieldDefinitionId": "377fe7374d2b4a64ae2aa88000c6fbd4"
}

ContentTypeIs

Available only for records. Trigger when the target record is already a specified content type.
AttributeDescription
ContentType Name of the content type which the record must be
DirectLinkOnly Whether the condition only applies when the record is exactly of content type or including descendants.
Example:
{
"ConditionType": "ContentTypeIs",
"directLinkOnly": true,
"ContentType": "Video"
}

ContentTypeSetTo

Only supported on records and combined with the WhenSavedOrDeleted trigger. Trigger when the target record is set to a specified content type.
AttributeDescription
ContentType Name of the content type which the record must be
DirectLinkOnly Whether the condition only applies when the record is exactly of content type or including descendants.
Example:
{
"ConditionType": "ContentTypeSetTo",
"directLinkOnly": true,
"ContentType": "Video"
}

ContentTypeChanged

Only supported on records and combined with the WhenSavedOrDeleted trigger. Trigger when the target record changes content type.
Example:
{
"ConditionType": "ContentTypeChanged"
}

RecordStatusIs

Available only for records. Trigger when the target record has the specified status.
AttributeDescription
Status Status which the record must have
Example:
{
"ConditionType": "RecordStatusIs",
"Status": "Draft"
}

RecordStatusSetTo

Only supported on records and combined with the WhenSavedOrDeleted trigger. Trigger when the target record is set to a specified status.
AttributeDescription
Status Status which the record must have
Example:
{
"ConditionType": "RecordStatusSetTo",
"Status": "Draft"
}

RecordStatusChanged

Only supported on records and combined with the WhenSavedOrDeleted trigger. Trigger when the target record status changes.
Example:
{
"ConditionType": "RecordStatusChanged"
}

MasterPreviewExists

Only supported on records and combined with the WhenSavedOrDeleted trigger. Trigger when the target record has a master preview.
Example:
{
"ConditionType": "MasterPreviewExists"
}

MasterPreviewChanged

Only supported on records and combined with the WhenSavedOrDeleted trigger. Trigger when the target record master preview changes.
Example:
{
"ConditionType": "MasterPreviewChanged"
}

Rule actions

The following values are available for ExecutionTime:
  • Delayed
  • Immediately
If ExecutionTime explicitly not specified, default value is set:
delayed
The following values are available for ActionType:
  • RefreshFiles
  • Reference
  • ApplyWatermarkOnMasterFile
  • ClassifyRecord
  • ScheduleResaveOfRecord
  • UnclassifyRecord
  • SetFieldValue
  • SendEmail
  • CreatePresetCrops
  • AprimoAI
  • CreateReviewFile
  • CreateRenditions
  • ChangeContentType
  • ChangeRecordStatus
  • CreatePublicLinks
  • DeletePublicLinks

RefreshFiles

Recreates the preview(s) for the triggering files.
Example:
{
  "ActionType": "RefreshFiles"
}

Reference

Executes the specified reference.
AttributeDescription
Reference Reference to be executed
Example:
{
  "ActionType": "Reference",
  "Reference": "<ref:httpRequest uri=\"https://YourFunction.azurewebsites.net/api/...\" />"
}

ApplyWatermarkOnMasterFile

Applies a watermark image on the master file
AttributeDescription
WatermarkType Specify how the watermark to apply is selected:
  • UseSetting: uses the watermark in the user setting .watermarkName
  • UseSpecified: uses the watermark whose Id is given in the WatermarkId attribute
WatermarkId The Id of the watermark to use, in case UseSpecified was chosen as WatermarkType
Example:
{
    "ActionType": "ApplyWatermarkOnMasterFile",
    "WatermarkType": "UseSpecified",
    "WatermarkId": "788aa96b-8767-49c1-a049-a84900d5c53d"
}

ClassifyRecord

Link target with the classification.
AttributeDescription
gettingType Controls how the classification is specified: either with a specific Id (Specified) or as a result of a reference (CalculatedByReference).
identifierType Specify what is given as identification for the classification, in case GettingType is set to "CalculatedByReference". Possible values are Identifier or NamePath.
classificationId Specify the Id of the classification, in case GettingType is set to "Specified".
reference A reference that results in a classification Id or name path, depending on the value of IdentifierType.
Example:
{
  "ActionType": "ClassifyRecord",
  "gettingType": "Specified",
  "classificationId": "55b92c87-7b43-4a84-89eb-a81300fae7aa"
},
{
  "actionType": "ClassifyRecord",
  "gettingType": "CalculatedByReference",
  "identifierType": "NamePath",
  "reference": "<ref:text out=\"root\" />"
},
{
  "actionType": "ClassifyRecord",
  "gettingType": "CalculatedByReference",
  "identifierType": "Identifier",
  "reference": "<ref:text out=\"55b92c87-7b43-4a84-89eb-a81300fae7aa\" />"
}

ScheduleResaveOfRecord

Available only for records. Schedule resave of the record to Date specified in field.
AttributeDescription
FieldDefinitionId Id of the datetime field containing the resave date. Only Date and DateTime field types supported.
Example:
{
  "ActionType": "ScheduleResaveOfRecord",
  "fieldDefinitionId": "fc6c7480766041a39d94a882010bfa22"
}

UnclassifyRecord

Unlink the record from the specified classifications
AttributeDescription
gettingType Controls how the classification is specified: either with a specific Id (Specified) or as a result of a reference (CalculatedByReference).
identifierType Specify what is given as identification for the classification, in case GettingType is set to "CalculatedByReference". Possible values are Identifier or NamePath.
classificationIds Specify Ids of the classifications, in case GettingType is set to "Specified".
unlinkTarget Specify the target of the rule action: either 'classification' to unlink from the specified classifications themselves, or 'classificationsDescendants' to unlink from the descendants of the specified classifications.
reference A reference that results in a classification Id or name path, depending on the value of IdentifierType.
Example:
{
  "ActionType": "UnclassifyRecord",
  "gettingType": "Specified",
  "classificationIds": [
    "55b92c87-7b43-4a84-89eb-a81300fae7aa",
    "61b91c51-6522-4284-43eb-a2130a4ae77c",
    ]
 },
 {
   "actionType": "UnclassifyRecord",
   "gettingType": "CalculatedByReference",
   "identifierType": "NamePath",
   "reference": "<ref:text out=\"root\" />"
 },
 {
   "actionType": "UnclassifyRecord",
   "gettingType": "CalculatedByReference",
   "identifierType": "Identifier",
   "reference": "<ref:text out=\"55b92c87-7b43-4a84-89eb-a81300fae7aa\" />"
 }

SetFieldValue

Sets the value of the specified field to the result of the reference.
AttributeDescription
FieldDefinitionId The Id of the field whose value must be set.
Reference The reference whose result will be used as field value.
Example:
{
  "ActionType": "SetFieldValue",
  "FieldDefinitionId": "377fe7374d2b4a64ae2aa88000c6fbd4",
  "Reference": "<ref:httpRequest uri=\"https://YourFunction.azurewebsites.net/api/...\" />"
}

SendEmail

Sends the specified email.
AttributeDescription
TargetType Email target type selected by user either Reference or SubscribersList.
Reference (Optional) Email template that can be customized if added in the body. Otherwise, the default mail template stored in .emailOrderUserRecipientsTemplate setting will be used.
SubscribersList (Optional) Email template that can be customized if added in the body. Otherwise, the default mail template stored in the .emailOrderSubscribersListRecipientsTemplate setting will be used.

Example:
{
  "ActionType": "SendEmail",
  "TargetType": "Reference",
  "Reference" : "<mail>
                   <recipients>
                     <ref:user out='email'/>
                   </recipients>
                   <cc>
                     <ref:setting name='.technicalContactEmail'/>
                   </cc>
                   <subject>
                     <ref:text out='Subject of the email'/>
                   </subject>
                   <body>
                     <ref:object>
                       <ref:text out='A part of the message '/>
                       <ref:record out='id'/>
                       <ref:text out=' another part of the massage.'/>
                     </ref:object>
                   </body>
                 </mail>"
}
{
  "ActionType": "SendEmail",
  "TargetType": "SubscribersList",
  "SubscribersList" : "<mail>
                          <recipients>
                            <ref:subscribers out='email'/>
                          </recipients>
                          <cc>
                            <ref:setting name='.technicalContactEmail'/>
                          </cc>
                          <subject>
                            <ref:text out='Subject of the email'/>
                          </subject>
                          <body>
                            <ref:object>
                              <ref:text out='The content item '/>
                              <ref:record out='title' store='@title'/>
                              <ref:application out='damUrl' store='@damUrl'/>
                              <ref:record out='id' store='@id'/>
                              <ref:replace in='@id' oldValue='-' newValue='' store='@id'/>
                              <a href='@damUrl/contentitems/@id'>
                              <ref:text out='@title'/>
                              </a>
                              <ref:text out=' you're subscribed to has expired. Please avoid using it for ongoing projects or tasks as it may contain outdated information. '/>
                              <br/>
                              <div> You're subscribed to content items you create or download, or if you follow them. </div>
                              <br/>
                              <div>***This is an automatically generated email, please do not reply to this message. ***</div>
                            </ref:object>
                          </body>
                      </mail>"
}

CreatePresetCrops

Recreates preset cropped images.
Example:
{
"ActionType": "CreatePresetCrops"
}

AprimoAI

Runs the Aprimo AI features.
AttributeDescription
Options Controls which Aprimo AI options to run. Supported options are: SmartTags, CustomSmartTags, Faces, Text and Transcripts.

Example:
{
"actionType": "AprimoAI",
"options": "SmartTags"
}

CreateRenditions

(Re)creates renditions on a master file.
AttributeDescription
Options Controls which presets to use for creating the renditions.

Example:
{
"actionType": "CreateRenditions",
"renditionPresets": "["Rendition1","Rendition2"]"
}

ChangeContentType

Change the content type of the target record.
AttributeDescription
ContentType The name of the content type to be changed to.
Example:
{
"ActionType": "ChangeContentType",
"ContentType": "Video"
}

ChangeRecordStatus

Change the status of the target record.
AttributeDescription
Status The status to be changed to. Supported values are: Draft, Released and Archived.
Example:
{
"ActionType": "ChangeRecordStatus",
"Status": "Released"
}

CreatePublicLinks

(Re)creates public links on a master file for the selected renditions and/or crops.
AttributeDescription
Options Controls which presets to use for creating the renditions.

Example:
{
"actionType": "CreatePublicLinks",
"presets": "[{
"presetName": null,
"presetType": "OriginalFile"
},
{
"presetName": "Low-res",
"presetType": "Rendition"
},
{
"presetName": "HD 720p",
"presetType": "Crop"
}]"
}

DeletePublicLinks

Delete public links on a master file for the selected renditions and/or crops.
AttributeDescription
Options Controls which presets to use for deleting the renditions.

Example:
{
"actionType": "DeletePublicLinks",
"presets": "[{
"presetName": null,
"presetType": "All"
},{
"presetName": null,
"presetType": "OriginalFile"
},
{
"presetName": "Low-res",
"presetType": "Rendition"
},
{
"presetName": "HD 720p",
"presetType": "Crop"
}]"
}