Skip to content

Commit 8dab7b7

Browse files
mintlify[bot]tcaldwell-x
authored andcommitted
docs: use provided sample payloads for broadcast.start and broadcast.end
1 parent 9f01f7c commit 8dab7b7

1 file changed

Lines changed: 118 additions & 68 deletions

File tree

x-api/activity/event-payloads.mdx

Lines changed: 118 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,113 +2046,163 @@ Fired when the filtered user unblocks another user.
20462046

20472047
### `broadcast.start`
20482048

2049-
Fired when a user starts a live broadcast. Public event — can be subscribed to with either app-only or user-context authentication. The `payload` includes the host `user` and the `broadcast_id`.
2049+
Fired when a user starts a live broadcast. Public event — can be subscribed to with either app-only or user-context authentication. The `payload` includes the host `user`, the `broadcast_id`, the broadcast `title` and `language`, timing fields, a live `thumbnail_url`, and a `broadcast_state` of `Running`.
20502050

20512051
```json title="broadcast.start" expandable lines wrap icon="/icons/xds/icon-brackets.svg"
20522052
{
20532053
"data": {
2054-
"event_uuid": "4093201169289922042",
2054+
"event_uuid": "1234567890123456789",
20552055
"filter": {
2056-
"user_id": "1111111111111111111"
2056+
"user_id": "1234567890123456789"
20572057
},
20582058
"event_type": "broadcast.start",
2059-
"tag": "broadcast-start",
2059+
"tag": "example broadcast starts",
20602060
"payload": {
20612061
"user": {
20622062
"data": {
2063-
"affiliation": {
2064-
"description": "X",
2065-
"badge_url": "https://pbs.twimg.com/profile_images/0000000000000000001/example_normal.jpg",
2066-
"url": "https://twitter.com/X"
2067-
},
2068-
"location": "San Francisco, CA",
2069-
"name": "Example User",
2070-
"profile_image_url": "https://pbs.twimg.com/profile_images/0000000000000000001/example_normal.jpg",
2071-
"created_at": "2023-10-23T13:44:53.000Z",
2063+
"id": "1234567890123456789",
2064+
"name": "Example Broadcaster",
2065+
"username": "example_broadcaster",
2066+
"description": "Example account",
2067+
"url": "https://example.com",
20722068
"protected": false,
20732069
"verified": true,
2074-
"url": "https://t.co/xxxxxxxx",
2070+
"verified_type": "blue",
2071+
"is_identity_verified": false,
2072+
"created_at": "2024-01-01T00:00:00.000Z",
2073+
"profile_image_url": "https://example.com/profile.jpg",
2074+
"profile_banner_url": "https://example.com/banner.jpg",
2075+
"affiliation": {
2076+
"description": "Example Organization",
2077+
"url": "https://example.com/organization",
2078+
"badge_url": "https://example.com/badge.jpg"
2079+
},
20752080
"public_metrics": {
2076-
"followers_count": 5502,
2077-
"followers_count_str": "5502",
2078-
"following_count": 651,
2079-
"following_count_str": "651",
2080-
"tweet_count": 789,
2081-
"tweet_count_str": "789",
2082-
"listed_count": 46,
2083-
"listed_count_str": "46",
2084-
"like_count": 8010,
2085-
"like_count_str": "8010",
2086-
"media_count": 79,
2087-
"media_count_str": "79"
2081+
"followers_count": 1000,
2082+
"followers_count_str": "1000",
2083+
"following_count": 100,
2084+
"following_count_str": "100",
2085+
"tweet_count": 500,
2086+
"tweet_count_str": "500",
2087+
"listed_count": 10,
2088+
"listed_count_str": "10",
2089+
"like_count": 250,
2090+
"like_count_str": "250",
2091+
"media_count": 50,
2092+
"media_count_str": "50"
20882093
},
2089-
"is_identity_verified": true,
2090-
"description": "Building with the X AnotherUser @XDevelopers",
2091-
"verified_type": "blue",
2092-
"profile_banner_url": "https://pbs.twimg.com/profile_banners/1111111111111111111/1600000000",
2093-
"username": "ExampleUser",
2094-
"id": "1111111111111111111"
2094+
"entities": {
2095+
"url": {
2096+
"urls": [
2097+
{
2098+
"start": 0,
2099+
"start_str": "0",
2100+
"end": 23,
2101+
"end_str": "23",
2102+
"url": "https://t.co/example",
2103+
"expanded_url": "https://example.com",
2104+
"display_url": "example.com"
2105+
}
2106+
]
2107+
}
2108+
}
20952109
}
20962110
},
2097-
"broadcast_id": "1mGPaZaAdNqJN",
2098-
"event_type": "broadcast_start"
2111+
"broadcast_id": "1a2b3c4d5e6fG",
2112+
"event_timestamp_ms": 1720000003500,
2113+
"event_timestamp_ms_str": "1720000003500",
2114+
"title": "Example broadcast",
2115+
"broadcast_state": "Running",
2116+
"created_timestamp_ms": 1720000000000,
2117+
"created_timestamp_ms_str": "1720000000000",
2118+
"updated_timestamp_ms": 1720000003200,
2119+
"updated_timestamp_ms_str": "1720000003200",
2120+
"language": "en",
2121+
"thumbnail_url": "https://example.com/broadcasts/1a2b3c4d5e6fG/live-thumbnail.jpg",
2122+
"available_for_replay": false
20992123
}
21002124
}
21012125
}
21022126
```
21032127

21042128
### `broadcast.end`
21052129

2106-
Fired when a user ends a live broadcast. Public event — can be subscribed to with either app-only or user-context authentication. Same shape as `broadcast.start` with an inner `event_type` of `broadcast_end`.
2130+
Fired when a user ends a live broadcast. Public event — can be subscribed to with either app-only or user-context authentication. The `payload` includes the host `user`, the `broadcast_id`, timing fields, and a `broadcast_state` of `Ended` (with `duration_ms` and a replay `thumbnail_url` on the ended broadcast).
21072131

21082132
```json title="broadcast.end" expandable lines wrap icon="/icons/xds/icon-brackets.svg"
21092133
{
21102134
"data": {
2111-
"event_uuid": "-498317022904955632",
2135+
"event_uuid": "2234567890123456789",
21122136
"filter": {
2113-
"user_id": "1111111111111111111"
2137+
"user_id": "1234567890123456789"
21142138
},
21152139
"event_type": "broadcast.end",
2116-
"tag": "broadcast-end",
2140+
"tag": "example broadcast ends",
21172141
"payload": {
21182142
"user": {
21192143
"data": {
2120-
"affiliation": {
2121-
"description": "X",
2122-
"badge_url": "https://pbs.twimg.com/profile_images/0000000000000000001/example_normal.jpg",
2123-
"url": "https://twitter.com/X"
2124-
},
2125-
"location": "San Francisco, CA",
2126-
"name": "Example User",
2127-
"profile_image_url": "https://pbs.twimg.com/profile_images/0000000000000000001/example_normal.jpg",
2128-
"created_at": "2023-10-23T13:44:53.000Z",
2144+
"id": "1234567890123456789",
2145+
"name": "Example Broadcaster",
2146+
"username": "example_broadcaster",
2147+
"description": "Example account",
2148+
"url": "https://example.com",
21292149
"protected": false,
21302150
"verified": true,
2131-
"url": "https://t.co/xxxxxxxx",
2151+
"verified_type": "blue",
2152+
"is_identity_verified": false,
2153+
"created_at": "2024-01-01T00:00:00.000Z",
2154+
"profile_image_url": "https://example.com/profile.jpg",
2155+
"profile_banner_url": "https://example.com/banner.jpg",
2156+
"affiliation": {
2157+
"description": "Example Organization",
2158+
"url": "https://example.com/organization",
2159+
"badge_url": "https://example.com/badge.jpg"
2160+
},
21322161
"public_metrics": {
2133-
"followers_count": 5502,
2134-
"followers_count_str": "5502",
2135-
"following_count": 651,
2136-
"following_count_str": "651",
2137-
"tweet_count": 789,
2138-
"tweet_count_str": "789",
2139-
"listed_count": 46,
2140-
"listed_count_str": "46",
2141-
"like_count": 8010,
2142-
"like_count_str": "8010",
2143-
"media_count": 79,
2144-
"media_count_str": "79"
2162+
"followers_count": 1000,
2163+
"followers_count_str": "1000",
2164+
"following_count": 100,
2165+
"following_count_str": "100",
2166+
"tweet_count": 500,
2167+
"tweet_count_str": "500",
2168+
"listed_count": 10,
2169+
"listed_count_str": "10",
2170+
"like_count": 250,
2171+
"like_count_str": "250",
2172+
"media_count": 50,
2173+
"media_count_str": "50"
21452174
},
2146-
"is_identity_verified": true,
2147-
"description": "Building with the X AnotherUser @XDevelopers",
2148-
"verified_type": "blue",
2149-
"profile_banner_url": "https://pbs.twimg.com/profile_banners/1111111111111111111/1600000000",
2150-
"username": "ExampleUser",
2151-
"id": "1111111111111111111"
2175+
"entities": {
2176+
"url": {
2177+
"urls": [
2178+
{
2179+
"start": 0,
2180+
"start_str": "0",
2181+
"end": 23,
2182+
"end_str": "23",
2183+
"url": "https://t.co/example",
2184+
"expanded_url": "https://example.com",
2185+
"display_url": "example.com"
2186+
}
2187+
]
2188+
}
2189+
}
21522190
}
21532191
},
2154-
"broadcast_id": "1mGPaZaAdNqJN",
2155-
"event_type": "broadcast_end"
2192+
"broadcast_id": "1a2b3c4d5e6fG",
2193+
"event_timestamp_ms": 1720000007400,
2194+
"event_timestamp_ms_str": "1720000007400",
2195+
"title": "Example broadcast",
2196+
"broadcast_state": "Ended",
2197+
"created_timestamp_ms": 1720000000000,
2198+
"created_timestamp_ms_str": "1720000000000",
2199+
"updated_timestamp_ms": 1720000007000,
2200+
"updated_timestamp_ms_str": "1720000007000",
2201+
"duration_ms": 3800,
2202+
"duration_ms_str": "3800",
2203+
"language": "en",
2204+
"thumbnail_url": "https://example.com/broadcasts/1a2b3c4d5e6fG/replay-thumbnail.jpg",
2205+
"available_for_replay": true
21562206
}
21572207
}
21582208
}

0 commit comments

Comments
 (0)