Skip to main content
View as Markdown

Profile CRUD - Content Management

Profile CRUD​

Create a Profile​

curl -X POST "$KALTURA_SERVICE_URL/service/accessControlProfile/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "accessControlProfile[objectType]=KalturaAccessControlProfile" \
-d "accessControlProfile[name]=Geo Restricted" \
-d "accessControlProfile[description]=Block playback outside US"

Parameters for accessControlProfile[...]:

ParameterRequiredDescription
objectTypeYesAlways KalturaAccessControlProfile
nameYesDisplay name for the profile
descriptionNoHuman-readable description
systemNameNoSystem-level name for programmatic lookup
isDefaultNoSet to 1 to make this the default profile
rulesNoArray of KalturaRule objects (see section 7)

Response: Full KalturaAccessControlProfile object with generated id.

Create a Profile with Rules​

curl -X POST "$KALTURA_SERVICE_URL/service/accessControlProfile/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "accessControlProfile[objectType]=KalturaAccessControlProfile" \
-d "accessControlProfile[name]=US Only Playback" \
-d "accessControlProfile[description]=Block playback outside United States" \
-d "accessControlProfile[rules][0][objectType]=KalturaRule" \
-d "accessControlProfile[rules][0][actions][0][objectType]=KalturaAccessControlBlockAction" \
-d "accessControlProfile[rules][0][conditions][0][objectType]=KalturaCountryCondition" \
-d "accessControlProfile[rules][0][conditions][0][not]=true" \
-d "accessControlProfile[rules][0][conditions][0][values][0][objectType]=KalturaStringValue" \
-d "accessControlProfile[rules][0][conditions][0][values][0][value]=US" \
-d "accessControlProfile[rules][0][contexts][0][objectType]=KalturaAccessControlContextTypeHolder" \
-d "accessControlProfile[rules][0][contexts][0][type]=1" \
-d "accessControlProfile[rules][0][message]=Content not available in your region"

Get a Profile​

curl -X POST "$KALTURA_SERVICE_URL/service/accessControlProfile/action/get" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$ACCESS_CONTROL_ID"

List Profiles​

curl -X POST "$KALTURA_SERVICE_URL/service/accessControlProfile/action/list" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "filter[objectType]=KalturaAccessControlProfileFilter" \
-d "pager[pageSize]=50"

Filter fields (KalturaAccessControlProfileFilter):

FieldDescription
idEqualExact profile ID
idInComma-separated profile IDs
systemNameEqualExact system name match
createdAtGreaterThanOrEqualUnix timestamp lower bound
createdAtLessThanOrEqualUnix timestamp upper bound
orderBy+createdAt or -createdAt

Update a Profile​

curl -X POST "$KALTURA_SERVICE_URL/service/accessControlProfile/action/update" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$ACCESS_CONTROL_ID" \
-d "accessControlProfile[objectType]=KalturaAccessControlProfile" \
-d "accessControlProfile[description]=Updated restrictions"

Delete a Profile​

curl -X POST "$KALTURA_SERVICE_URL/service/accessControlProfile/action/delete" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "id=$ACCESS_CONTROL_ID"

Entries assigned to the deleted profile revert to the partner's default access control.