lookupEventsWith abstract method
- required String participantId,
- List<
DMEventType> ? eventTypes, - int? maxResults,
- String? paginationToken,
- List<
DMEventExpansion> ? expansions, - List<
TweetField> ? tweetFields, - List<
UserField> ? userFields, - List<
MediaField> ? mediaFields, - List<
DMEventField> ? dmEventFields, - Paging<
List< ? paging,DMEventData> , DMEventMeta>
Returns a list of Direct Messages (DM) events within a 1-1 conversation
with the user specified in the participantId
path parameter.
Messages are returned in reverse chronological order.
Parameters
-
participantId
: The participant id of the user that the authenticating user is having a 1-1 conversation with. -
eventTypes
: The type of Direct Message event to return. If not included, all types are returned. -
maxResults
: The maximum number of results to be returned in a page. Must be between 1 and 100. The default is 100. -
paginationToken
: Contains either thenext_token
orprevious_token
value. -
expansions
: Expansions enable you to request additional data objects that relate to the returned Direct Message conversation events. The IDs that represents the expanded data objects will be included directly in the event data object, and the expanded object metadata will be returned within the includes response object. -
tweetFields
: This fields parameter enables you to select which specific Tweet fields will be delivered in each returned Direct Message 'MessageCreate' event object that contains a Tweet reference. While the Tweet ID will be in the event object, you will find this ID and all additional Tweet fields in theincludes
data object. -
userFields
: This fields parameter enables you to select which specific user fields will be delivered for Direct Message conversation events that reference a sender or participant ID. While the user ID will be located in the event object, you will find this ID and all additional user fields in the includes data object. -
mediaFields
: This fields parameter enables you to select which specific media fields will be delivered in Direct MessageMessageCreate
events. While the media ID will be located in the event object, you will find this ID and all additional media fields in the includes data object. The event object will only include media fields if the Direct Message contains media and if you've also included theexpansions=attachments.media_keys
query parameter in your request. -
dmEventFields
: Extra fields to include in the event payload.id
, andevent_type
are returned by default. The text value isn't included forParticipantsJoin
andParticipantsLeave
events. -
paging
: If this callback function is specified, paging is performed continuously until certain conditions are met. This paging function is bi-directional, both forward and backward, and allows for safe paging. The response and other metadata obtained when paging is performed is passed to the callback function asPagingEvent
object. So you can get the result of paging fromPagingEvent
object. Also, the direction and continuity of paging can be controlled by returningPaginationControl
object in thepaging
callback function. Please usePaginationControl.forward()
to continue paging and move forward, or usePaginationControl.backward()
to move backward. And be sure to returnPaginationControl.stop()
to terminate paging on arbitrary conditions, otherwise paging continues until the next page runs out.
Endpoint Url
Authentication Methods
- OAuth 2.0 Authorization Code with PKCE
- OAuth 1.0a
Required Scopes
- tweet.read
- users.read
- dm.read
Rate Limits
- User rate limit (User context): 300 requests per 15-minute window per each authenticated user.
Reference
Implementation
Future<TwitterResponse<List<DMEventData>, DMEventMeta>> lookupEventsWith({
required String participantId,
List<DMEventType>? eventTypes,
int? maxResults,
String? paginationToken,
List<DMEventExpansion>? expansions,
List<TweetField>? tweetFields,
List<UserField>? userFields,
List<MediaField>? mediaFields,
List<DMEventField>? dmEventFields,
Paging<List<DMEventData>, DMEventMeta>? paging,
});