Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Elevate your video Broadcasts with Video viewing complete event

Elevate your video Broadcasts with Video viewing complete event

LINE Developers Thailand

September 22, 2023
Tweet

More Decks by LINE Developers Thailand

Other Decks in Technology

Transcript

  1. Broadcast with Messaging API POST https://api.line.me/v2/bot/message/broadcast { "messages": [ ]

    } { "type": "video", "originalContentUrl": "https://example.com/original.mp4", "previewImageUrl": "https://example.com/preview.jpg", “trackingId": "track-id" } , { "type": "text", "text": “New Feature!! ดูวีดีโอจบ รับคะแนนไปเลย 🎉" }
  2. Webhook - VideoPlayComplete LINE Server { "destination": “xxxxxxxxxx", "events": [

    { "replyToken": “nHuyWiB7y…CTA”, "type": “videoPlayComplete", "mode": "active", "timestamp": 1462629479859, "source": { "type": "user", "userId": "U4af4980629..." }, "videoPlayComplete": { "trackingId": "track-id" } } ] Your Server Webhook Event Viewing Complete 😊
  3. Create Audience Group POST https://api-data.line.me/v2/bot/audienceGroup/upload/byFile Request body { “description": “viewing_video_complete”

    “file": “@audiences.txt;type=text/plain” } Request headers { “Authorization": “Bearer {channel access token}” “Content-Type“: “multipart/form-data” } audiences.txt “audienceGroupId“: “8672903….”
  4. Check Audience Status POST https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} { "audienceGroup": { "audienceGroupId": 1234567890123,

    "type": "UPLOAD", "description": "audienceGroupName_01", "status": "READY", "audienceCount": 1887, "created": 1608617466 } }
  5. Send Message via Narrowcast POST https://api-data.line.me/v2/bot/message/narrowcast { “messages": [ {

    “type": “text” “text”: “ติดตามรายละเอียดเพิ่มเติมไ ด้ ที่...” } ], “recipient“: { “type": “audience” “audienceGroupId”: “5614991076” }, “limit“: { “max": 100 “upToRemainingQuota”: true } }
  6. { "messages": [ { "type": "text", "text": "test message" }

    ], "recipient": { "type": "audience", "audienceGroupId": 5614991076 }, "limit": { "max": 100, "upToRemainingQuota": true } } Viewer Complete { "messages": [ { "type": "text", "text": "test message" } ], "recipient": { "type": "audience", "audienceGroupId": 5614991076 }, "limit": { "max": 100, "upToRemainingQuota": true } } + Only Female "filter": { “demographic": { "type": “operator", “and”: [ { "type": “gender”, "oneOf": [ “female” ] } ] } }, + Only Age between 35 - 40 { "messages": [ { "type": "text", "text": "test message" } ], "recipient": { "type": "audience", "audienceGroupId": 5614991076 }, "filter": { “demographic": { "type": “operator", “and”: [ { "type": “gender”, "oneOf": [ “female” ] }, ] } }, { "type": “age”, "gte": “age_35”, "lt": “age_40” }
  7. Call API video-activity Integrate with Loyalty Webhoo k Viewing Complete

    😊 POST https://api.beloyalty.betaskthai.com/video-activity Request headers { "apiToken": “f8e5d2c4787fddf3….”, } Request body { "lineUserId": “U4af4980629….”, "shopId": “U123fxxxxx….”, "replyToken": “nHuyWiB7y..XCTA”, }