[−][src]Function proj17_iot_server::endpoints::videos_endpoints::register_view
pub fn register_view(
display_id: i32,
video_id: i32,
order_id: String,
body: Json<VideoBody>
) -> Result<JsonValue, BadRequest<JsonValue>>
Registers a video view, granted the display_id, video_id, order_id, all exist. If all arguments are valid, a new played_advertisement row will be created in the database, and credits removed from the order_id. 1 credit will be withdrawn for each 8 seconds played.
Responds with:
- 200: if the tracker and receiver exist.
- 404: if either the receiver or tracker does not exist
This is an API endpoint mapped to
- /views/<display_id>/<video_id>/<order_id> [POST]
Arguments
url parameters:
display_id- the id of the display that played the videovideo_id- the id of the played videoorder_id- the id of the order that ordered the video
Post body (json):
{ length_sec: <integer_length_of_played_video> }