هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.
Reporting Livestreaming Events
Function
Reports livestreaming events.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/smart-live-rooms/{room_id}/smart-live-jobs/{job_id}/live-event-report
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
room_id |
Yes |
String |
Script ID. |
job_id |
Yes |
String |
Task ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
auth_key |
No |
String |
Authentication key. Authentication key generated using HMACSHA256. |
expires_time |
No |
Long |
Expiration time of the authentication key. Number of milliseconds elapsed since January 1, 1970 (midnight in UTC/GMT). |
refresh_url |
No |
Boolean |
Whether to refresh the URL. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. You can obtain the token by calling the IAM API used to obtain a user token. Value of X-Subject-Token in the response header. |
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
X-Sdk-Date |
No |
String |
Time when the request is sent. This parameter is mandatory for AK/SK authentication. The format is YYYYMMDD'T'HHMMSS'Z'. |
X-Project-Id |
No |
String |
Project ID. This parameter is mandatory for AK/SK authentication. |
X-App-UserId |
No |
String |
Third-party user ID, which does not allow Chinese characters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
total |
Yes |
Integer |
Number of events. |
events |
No |
Array of LiveEvent objects |
Event content. |
review_config |
No |
ReviewConfig object |
Content review configuration. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
timestamp |
Yes |
Long |
Event timestamp. Number of milliseconds since 1970-01-01 00:00:00. |
type |
No |
Integer |
Event type. 1: On-screen comment information 2: User joining a room 3: Liking 4: Sending gifts 5: Subscription/Following 6: Number of viewers in a room |
content |
No |
String |
Event content. [/topic/body/section/table/tgroup/tbody/row/entry/p/br {""}) (br]The content varies according to the event type. The definition is as follows:
Definition of content:
Definition of user:
Example: { "timestamp": 1694481224245, "type": 1, "content": "{\"user\":{\"userId\":\"2027271526\",\"name\":\"***\",\"level\":17,\"badge\":\"\",\"badgeLevel\":0},\"content\":\"***\"}" }
Definition of content:
Example: { "timestamp": 1694481227655, "type": 2, "content": "{\"user\":{\"userId\":\"2978899271\",\"name\":\"***\",\"level\":1,\"badge\":\"\",\"badgeLevel\":0}}" }
Definition of content:
Example: { "timestamp": 1694481227655, "type": 2, "content": "{\"user\":{\"userId\":\"2978899271\",\"name\":\"***\",\"level\":1,\"badge\":\"\",\"badgeLevel\":0}}" }
Definition of content:
Definition of gift:
Example: { "timestamp": 1690531652862, "type": 4, "content": "{\"gift\":{\"giftName\":\"Star\",\"giftNum\":10,\"totalValue\":10,\"giftValue\":3},\"user\":{\"userId\":\"douyin_95882940927\",\"name\":\"Romantic lover\",\"level\":2,\"badge\":\"\",\"badgeLevel\":0}}" }
Not in use.
Definition of content:
Example: { "timestamp": 1694481236886, "type": 6, "content": "{\"numberOfViewers\":5466}" } |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-Request-Id |
String |
Request ID. |
Parameter |
Type |
Description |
---|---|---|
live_event_report_url |
String |
URL for uploading the updated livestreaming event. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Example Requests
POST https://{endpoint}/v1/70b76xxxxxx34253880af501cdxxxxxx/smart-live-rooms/24bad716-87b1-45e5-8912-6102f7693265/smart-live-jobs/26f06524-4f75-4b3a-a853-b649a21aaf66/live-event-report { "total" : 1, "events" : [ { "timestamp" : 1690819199000, "type" : 1, "content" : "xxxxx" } ] }
Example Responses
Status code: 200
Succeeded.
{ "live_event_report_url" : "https://{endpoint}/v1/70b76xxxxxx34253880af501cdxxxxxx/smart-live-rooms/24bad716-87b1-45e5-8912-6102f7693265/smart-live-jobs/26f06524-4f75-4b3a-a853-b649a21aaf66/live-event-report" }
Status code: 400
{ "error_code" : "MSS.00000003", "error_msg" : "Invalid parameter" }
Status code: 401
{ "error_code" : "MSS.00000001", "error_msg" : "Unauthorized" }
Status code: 500
{ "error_code" : "MSS.00000004", "error_msg" : "Internal Error" }
Status Codes
Status Code |
Description |
---|---|
200 |
Succeeded. |
400 |
Parameters error, including the error code and its description. |
401 |
Authentication is not performed or fails. |
500 |
Internal service error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot