LINE CONFERENCE THAILAND 2023

LINE Developers Summary Q2/2024 | รวม Update

LINE CONFERENCE THAILAND 2023

Keynote: Product Roadmap of LINE Thailand Vision

Dive Into The Cutting-edge LINE API Innovations

Chat & Shop Like Never Before: Unleash LINE SHOPPING API

Develop Sales Automation Workflow on LINE

::: feature of line application , on desktop, “import images and send to another account”

The LINE application on desktop (Windows/macOS) supports the feature to import and send images to another account. Here’s how the feature works and key details:


✅ Feature: Import Images and Send to Another Account (Desktop)

🔹 Platform: LINE for Windows / macOS

🔹 Functionality Overview:

  1. Image Import Options:
    • Drag-and-drop images directly into the chat window.
    • Use the “+” (plus) button or clip icon to select images from your file system.
    • Copy (Ctrl+C) and paste (Ctrl+V) images into the chat.
  2. Sending to Another Account:
    • You can send the image to:
      • A friend (1:1 chat)
      • A group chat
      • Yourself (via the “Keep Memo” or “Note to Self” feature)
    • You can also forward an image received in one chat to another account.
  3. Multiple Images:
    • Supports sending multiple images at once.
    • Shows preview thumbnails before sending.
  4. Formats Supported:
    • Common image types like .jpg, .png, .gif, .bmp.
  5. Additional Features:
    • Add text captions before sending.
    • Right-click on the sent image for options like Save, Forward, Keep (LINE’s cloud save).

🛠️ How to Do It:

Method 1:

  • Open a chat → Click “+” → Choose Photos or Videos → Select image file → Click Send

Method 2:

  • Drag the image file from your desktop into the chat window → Press Enter to send

Method 3:

  • Copy an image (Ctrl+C) → Paste (Ctrl+V) into the chat window

ใช้ feature อะไรบ้าง , มุมมองในแง่ developer

หากมองในมุมของ developer (นักพัฒนา) เกี่ยวกับ Feature “Import images and send to another account” ของ LINE Desktop App สามารถวิเคราะห์ได้ว่าเบื้องหลังมีการใช้หลายฟีเจอร์และเทคโนโลยีร่วมกัน ดังนี้:


🧩 Feature Components ที่เกี่ยวข้อง (ในเชิง Developer)

1. File Picker / Drag-and-Drop API

  • ใช้ native OS file picker หรือ HTML5 drag-and-drop APIs (ถ้าใช้ Electron)
  • ตรวจสอบ MIME type เช่น image/jpeg, image/png ฯลฯ
  • Convert เป็น blob หรือ base64 สำหรับส่งผ่าน socket หรือ REST API

2. Image Encoding and Compression

  • Resize / compress ก่อนส่ง เพื่อประหยัด bandwidth
  • อาจใช้ไลบรารี เช่น sharp, imagemagick, mozjpeg (ในฝั่งเซิร์ฟเวอร์)

3. Client-Server Communication (Data Transfer)

  • ส่งไฟล์ผ่าน secure upload endpoint (REST API หรือ WebSocket)
  • ใช้ multipart/form-data หรือ streaming upload
  • แสดง progress bar ขณะอัปโหลด (progress event handler)

4. Message Composition & Metadata

  • แพ็กข้อมูลเป็น JSON เช่น:
{
"messageType": "image",
"mediaUrl": "https://cdn.line.me/xyz.jpg",
"senderId": "user123",
"recipientId": "user456",
"timestamp": "2025-05-23T10:32:00Z"
}

5. Authentication / Session Management

  • ตรวจสอบ token ของผู้ใช้ก่อนส่ง
  • ต้องมี session validation (OAuth2 หรือ JWT)

6. Media Storage and CDN

  • เซิร์ฟเวอร์ต้องมีระบบ เก็บรูปภาพ (object storage เช่น Amazon S3, LINE’s private CDN)
  • เก็บไฟล์แบบ encrypted at rest
  • ให้บริการโหลดผ่าน CDN เพื่อความเร็ว

7. Database Logging

  • บันทึกการส่งข้อความลงฐานข้อมูล เช่น:
    • message_logs
    • media_metadata (ขนาด, format, userId, expiry)

8. Real-Time Messaging System

  • ใช้ WebSocket หรือ MQTT เพื่อส่งข้อความแบบ real-time
  • เมื่อมีผู้รับ online ให้ push notification พร้อม image preview

9. Security & Safety

  • ตรวจสอบว่าไม่ใช่ไฟล์อันตราย (malware scan / file validation)
  • จำกัดขนาดไฟล์ เช่น ≤ 20MB
  • ตรวจสอบ Content-Type และ header integrity

10. Forwarding / Reuse Feature

  • ระบบแคชหรือ reference เดิม (ไม่อัปโหลดซ้ำ)
  • สร้าง message ที่อ้างอิง media id เดิม

📌 สรุปภาพรวม (Tech Stack ที่เกี่ยวข้อง)

ComponentPossible Tech Used
Frontend UIElectron, React/Vue
File UploadHTML5 APIs, Axios / fetch
Image ProcessingSharp, OpenCV, native modules
MessagingWebSocket, gRPC, Kafka
AuthenticationOAuth2, JWT
Storage / CDNAmazon S3, LINE Media CDN
DatabasePostgreSQL / MongoDB / Redis
SecurityClamAV, custom validation

หากคุณต้องการ mockup API design, workflow diagram, หรือ sample code ของระบบส่งภาพนี้ ผมสามารถจัดทำให้เพิ่มเติมได้ครับ

mockup API design

แน่นอนครับ! ด้านล่างนี้คือ Mockup API Design สำหรับฟีเจอร์ “Import images and send to another account” (ใน LINE Desktop Application) มุมมองของ developer โดยแบ่งเป็น Frontend-Backend API interaction, มีทั้ง upload, send message, และ metadata handling:


🧩 Mockup API Design: Image Upload & Messaging

1. 📤 POST /api/upload/image
Upload รูปภาพไปยัง CDN หรือ object storage
Request
yaml

POST /api/upload/image
Headers:
  Authorization: Bearer <JWT>
  Content-Type: multipart/form-data

Body (multipart):
  file: <image-file>

Response:
json

{
  "imageUrl": "https://cdn.example.com/media/abc123.jpg",
  "mediaId": "abc123",
  "width": 1080,
  "height": 720,
  "mimeType": "image/jpeg",
  "size": 1563224
}

2. 📩 POST /api/message/send

ส่งข้อความ (พร้อมรูปภาพ) ไปยังผู้รับ

Request: json

POST /api/message/send
Headers:
  Authorization: Bearer <JWT>
Content-Type: application/json

Body:
{
  "senderId": "user_001",
  "recipientId": "user_002",
  "messageType": "image",
  "mediaId": "abc123",
  "text": "Check this image!",
  "timestamp": "2025-05-23T10:45:00Z"
}

Response:json

{
  "messageId": "msg_789",
  "status": "sent",
  "timestamp": "2025-05-23T10:45:01Z"
}

3. 📥 GET /api/message/{messageId}

เรียกดูข้อความ (พร้อมข้อมูลภาพ)

Response:

json
{
"messageId": "msg_789",
"senderId": "user_001",
"recipientId": "user_002",
"messageType": "image",
"media": {
"mediaId": "abc123",
"imageUrl": "https://cdn.example.com/media/abc123.jpg",
"width": 1080,
"height": 720
},
"text": "Check this image!",
"timestamp": "2025-05-23T10:45:00Z"
}

4. 🗂 POST /api/media/forward

ฟีเจอร์ Forward media ไปยังอีกแชท โดยไม่อัปโหลดใหม่

Request:

json
{
"originalMediaId": "abc123",
"newRecipientId": "user_009"
}

Response:

json
{
"messageId": "msg_999",
"status": "forwarded"
}

🔒 Security & Validation Checklist

  • ✅ JWT auth for all endpoints
  • ✅ Virus scan / MIME-type validation on image upload
  • ✅ File size & resolution limit
  • ✅ Media expiry policy (e.g. 30 days)

หากต้องการ:

  • Swagger/OpenAPI spec
  • Mongo/PostgreSQL schema
  • Realtime (WebSocket) version
    ผมสามารถทำให้ต่อได้ครับ แค่บอกว่าอยากเจาะลึกจุดไหนเพิ่มเติม.

อธิบาย ขั้นตอน post , post , get , post อยู่ในเนื้อหาอะไร

ขั้นตอนที่คุณถามมาว่า POST, POST, GET, POST — หากอ้างอิงจาก mockup API design ที่ผมให้ไว้ด้านบน หมายถึง workflow ของฟีเจอร์ “Import image and send to another account” ดังนี้:


📌 ขั้นตอนการทำงาน (API Workflow Summary)

✅ 1. POST /api/upload/image

เนื้อหา:
ผู้ใช้เลือกหรือ drag & drop รูปภาพในแอป LINE → แอปทำการอัปโหลดรูปภาพไปยัง backend
วัตถุประสงค์:
เก็บไฟล์ภาพในเซิร์ฟเวอร์ (CDN / object storage) และรับ mediaId / imageUrl

✅ 2. POST /api/message/send

เนื้อหา:
หลังจาก upload รูปแล้ว → frontend ใช้ mediaId ที่ได้ เพื่อส่งข้อความไปยังผู้รับ
วัตถุประสงค์:
สร้างข้อความประเภท image message ที่มี metadata ของภาพ (เช่น mediaId, ข้อความประกอบ)

✅ 3. GET /api/message/{messageId}

เนื้อหา:
ใช้เพื่อดึงข้อมูลของข้อความ เช่น preview ภาพ, sender, recipient, timestamp
วัตถุประสงค์:
สำหรับการแสดงผลในแชท หรือโหลดย้อนหลัง (history)

✅ 4. POST /api/media/forward

เนื้อหา:
ผู้ใช้ forward ภาพเดิมไปยังอีกคนหนึ่งโดยไม่ต้องอัปโหลดใหม่
วัตถุประสงค์:
ใช้ mediaId เดิม ส่งข้อความใหม่ถึงผู้รับใหม่ (ประหยัด bandwidth และ storage)


🔄 สรุปเป็น Flow Diagram:

pgsqlCopyEditUser selects image
     ↓
[POST /upload/image] → mediaId, imageUrl
     ↓
[POST /message/send] → messageId
     ↓
[GET /message/{messageId}] → show image in chat
     ↓
[POST /media/forward] (optional) → forward to new user

📂 เนื้อหาทาง Technical ที่เกี่ยวข้อง:

ขั้นตอนประเภทเนื้อหา/เรื่องหมวดในซอฟต์แวร์
POST /upload/imageFile Upload, Input ValidationBackend, Storage
POST /message/sendMessaging API, JSON structureRealtime Messaging
GET /message/{id}Data Retrieval, REST designAPI Display / UI
POST /media/forwardMedia Reuse, No Re-uploadOptimization / Efficiency

ถ้าคุณต้องการเชื่อมโยงไปสู่หัวข้อเช่น RESTful API design, Microservice pattern, Media Messaging Protocol หรือ GraphQL version, ผมสามารถแนะนำหรือขยายให้ได้ครับ.

Swagger/OpenAPI spec , Mongo/PostgreSQL schema , Realtime (WebSocket) version คือ