Skip to main content

Viewer Based Analytics

You can pass the userId in otp to have viewer based analytics. This parameter will be used to provide user-specific information such as

  • Identifying password sharing based on access duration
  • Folder-wise tracking of video usage
  • Tracking source of attempted piracy
  • Understanding watch patterns better for your videos

Selecting an identifier​

The userId can be the original primary key from your existing database. Its length must not exceed 36 characters and can only contain alphanumeric and allowed characters( - hyphens and _ underscores). We recommend using something that you can easily retrieve from your database. You should not use identifiable information such as email or phone number.

The following extra information will be added to the POST object send to the OTP generation API.

{
"userId":"XXXXXX",
}

Sample Code​

The sample videoID is 1234567890 and the API Secret Key is a1b2c3d4e5. The user id for OTP is set to test id in the sample code.

The sample code only passes the OTP user id as parameter.

curl -X POST \
https://dev.vdocipher.com/api/videos/1234567890/otp \
-H 'Accept: application/json' \
-H 'Authorization: Apisecret a1b2c3d4e5' \
-H 'Content-Type: application/json' \
-d '{
"ttl":300,
"userId":"a12v-b34s-cef3"
}'