Media Upload Management
1. Request S3 Upload URL
μ¬μ©μκ° μ λ‘λν νμΌμ μν S3 μλͺ λ URLμ μμ²νλ REST APIμ λλ€.
Method:
POST
/media/upload-url
Headers
Content-Type
application/json
Authorization
{ access token }
App-Id
{ app id }
Body
fileName
string
μ
λ‘λν νμΌ μ΄λ¦ (μ: image123.jpg
)
fileType
string
νμΌ νμ (μ: image/jpeg
)
Response
200
json { "uploadUrl": "https://your-s3-bucket.s3.amazonaws.com/uploads/image123.jpg?AWSAccessKeyId=...", "fileUrl": "https://cdn.example.com/uploads/image123.jpg" }
400
json { "error": "Invalid request" }
2. Notify Uploaded Media
νμΌ μ λ‘λ ν ν΄λΌμ΄μΈνΈκ° μλ²λ‘ μ λ‘λ μλ£λ₯Ό μ립λλ€. μ΄λ²€νΈλ μ±ν λ©μμ§ μ μ‘μΌλ‘ μ΄μ΄μ§λλ€.
Event
Event Name:
notify_uploaded_media
Headers
App-Id
{ app id }
μ± μλ³μ
Authorization
{ access token }
μ¬μ©μ μΈμ¦ ν ν°
Payload
channelId
string
λ©μμ§κ° μ μ‘λ μ±λ ID
userId
string
λ©μμ§λ₯Ό λ³΄λΈ μ¬μ©μ ID
fileUrl
string
S3 λλ CloudFront URL
fileType
string
νμΌ νμ (image/jpeg
, video/mp4
)
caption
string
νμΌμ λν μ€λͺ (μ ν)
Response
3. Broadcast Media Message
λ€λ₯Έ μ¬μ©μμκ² μ λ‘λλ νμΌ μ 보λ₯Ό ν¬ν¨ν λ©μμ§λ₯Ό μ€μκ°μΌλ‘ λΈλ‘λμΊμ€νΈν©λλ€.
Event
Event Name:
received_message
Headers
App-Id
{ app id }
μ± μλ³μ
Authorization
{ access token }
μ¬μ©μ μΈμ¦ ν ν°
Payload
messageId
string
λ©μμ§ ID
senderId
string
λ©μμ§ λ³΄λΈ μ¬μ©μ ID
receiverId
string
λ©μμ§ λ°λ μ¬μ©μ ID
fileUrl
string
S3 λλ CloudFront URL
fileType
string
νμΌ νμ (image/jpeg
, video/mp4
)
caption
string
νμΌ μ€λͺ
(ν
μ€νΈ λ©μμ§μΌ κ²½μ° null
)
timestamp
string
λ©μμ§ μ μ‘ μκ°
Response
Last updated