API Method: /api/protection/protect
Protection a video or stream using one of the built-in protection method.
Parameters
Parameter | Description |
---|---|
object_id (required) | Which object should be protected? |
grace_minutes | Optionally, set how long in minutes the previous protection token is allowed to be used for (default: `0`). |
protection_method (required) | Which method should the object be protected with? Valid options are `password`, `geoblocking`, `custom` or `cleeng`. |
countries | A 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. |
password | The password to be used with the `password` protection method |
endpoint | The endpoint to be used with the `custom` protection method |
cleeng_price | The item price to be used with the `cleeng` protection method |
cleeng_title | Optional title of the object along with the `cleeng` protection method |
cleeng_url | Optional URL of the object along with the `cleeng` protection method |
cleeng_tags | Optional 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"
}