TwentyThree Developer APIAPI Method: /api/protection/protect

API Method: /api/protection/protect

Last updated on May 25, 2014.

Protection a video or stream using one of the built-in protection method.

Parameters

ParameterDescription
object_id (required)Which object should be protected?
protection_method (required)Which method should the object be protected with? Valid options are `password`, `geoblocking`, `custom` or `cleeng`.
countriesA space-delimited list of country codes to be white-listed for geo-blocking. If this list is omitted with the `geoblocking` protection method, the site's standard list of countries will be used instead.
passwordThe password to be used with the `password` protection method
endpointThe endpoint to be used with the `custom` protection method
cleeng_priceThe item price to be used with the `cleeng` protection method
cleeng_titleOptional title of the object along with the `cleeng` protection method
cleeng_urlOptional URL of the object along with the `cleeng` protection method
cleeng_tagsOptional tags of the object along with the `cleeng` protection method

Permission level

The minimum required permission level is:

write

Example XML Response

<response status="ok" permission_level="write" message="The object was protected" cached="0">
  <object_id>1234567</object_id>
  <object_type>photo</object_type>
  <protection_method>password</protection_method>
  <protection_data>password mypassword</protection_data>
  <protected_token>abcdfe123456789</protected_token>
  <password>mypassword</password>
</response>

Example JSON Response

{ "status": "ok", "message":"The object was protected", "permission_level":"write", "cached":"0", "protection":{ "object_id": "1234567", "object_type": "photo", "protection_method": "password",
"protection_data": "password mypassword", "protected_token": "abcdfe123456789", "password": "mypassword" }, "p": "1", "size": "1", "site": {...}, "endpoint": "/api/protection/protect" }