listDirectMessageConversationsWithHttpInfo method
List 1:1 and group DM conversations.
Returns DM-type conversations only (type: im | mpim). Channel-type conversations are surfaced via /v1/channels.
Note: This method returns the HTTP Response.
Parameters:
-
List<String> accountIds: Repeatable. Restrict to these connected-account row ids. Mutually orthogonal to
providers— when both are set the intersection is used. -
List<String> providers: Repeatable. Restrict to these provider ids (
gmail,outlook). -
String xWorkspaceID: Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
-
int limit:
-
String cursor:
-
bool includeArchived:
Implementation
Future<Response> listDirectMessageConversationsWithHttpInfo({ List<String>? accountIds, List<String>? providers, String? xWorkspaceID, int? limit, String? cursor, bool? includeArchived, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/direct-messages';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (accountIds != null) {
queryParams.addAll(_queryParams('multi', 'accountIds', accountIds));
}
if (providers != null) {
queryParams.addAll(_queryParams('multi', 'providers', providers));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
if (cursor != null) {
queryParams.addAll(_queryParams('', 'cursor', cursor));
}
if (includeArchived != null) {
queryParams.addAll(_queryParams('', 'includeArchived', includeArchived));
}
if (xWorkspaceID != null) {
headerParams[r'X-Workspace-ID'] = parameterToString(xWorkspaceID);
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}