per-video bandwidth consumption
Date: 2018-09-08
Your vdocipher dashboard only shows your bandwidth consumption on a daily basis. To allow to create multi-tenant applications on your vdocipher account and also to ensure transparency, we provide per-video bandwidth consumption data. This data is currently only available via this API and not via a GUI on the dashboard.
We account for the bandwidth consumption from our CDN logs. The CDN logs (similar to Apache or nginx logs) provide detailed consumption pattern including the time, IP, URL and data transferred. This helps us provide a more reliable bandwidth consumption estimate which also accounts only partial for partial downloads and independent of the video player or device used. We do not use any client-side scripts to account for bandwidth.
The bandwidth estimate is also done only on equal-or-less-than basis. We try to only account for bandwidth which we could reliably measure and account for. In case of discrepancy or loss of log data, we ensure that the accounted value is either less than or equal to the actual consumption and never greater than.
The bandwidth calculation is done on a daily basis. All records are in UTC. The accounting for the UTC day is done on the following day 04:30 UTC. This measurement can take upto 1 hour and therefore we recommend using this API after 05:30 UTC if you are using for the just previous day.
Important: All our APIs (exception of meta data API and otp generation API), are not built for web scale. This means that they should not be used as the backend of your own website to serve direct HTTP requests. Instead, you should setup a server-side cron job to sync data with your DB at appropriate intervals. In this API, this should be run once every day between 06:00 and-10:00 UTC to sync all data for the previous day.
- Base URL:
https://dev.vdocipher.com
- Path:
/api/account/video-usage
- Method:
POST
- Content-type:
application/json
- Headers[authorization]:
Apisecret ______________________
- Post Data:
{ "date": "2018-09-07"}
Read on authorization for more details on the authorization header in the above request
Error response:
- status: NOT equal to 200
- content-type: application/json
- structure:
{ "message": "string description of error"}
Success Response
- status: 200
- content-type: text/csv
- structure:
video, bandwidthbd291afc082dd14391c3a4a112827918,123123c6651e597c783780f0cc026129c09025,4352345c5281b3a355b44dfe39db0b97aa21f6d,567453505b0fca34738a5d334ae9aeabe9a1dc,4565345
The output CSV will contain the bandwidth consumption in kilobytes.
Sample CURL statement
curl -X POST https://dev.vdocipher.com/api/account/video-usage -H 'authorization: Apisecret _____________________' -d '{"date": "2018-09-05"}' -H 'content-type: application/json' > bandwidth_2018-09-05.csv