getMessageContext method

Future<DynamiteResponse<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders>> getMessageContext({
  1. required String token,
  2. required int messageId,
  3. ChatGetMessageContextApiVersion? apiVersion,
  4. int? limit,
  5. bool? oCSAPIRequest,
})

Get the context of a message.

Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers. Throws a DynamiteApiException if the API call does not return an expected status code.

Parameters:

  • apiVersion Defaults to "v1".
  • token
  • messageId The focused message which should be in the "middle" of the returned context.
  • limit Number of chat messages to receive in both directions (50 by default, 100 at most, might return 201 messages). Defaults to 50.
  • oCSAPIRequest Required to be true for the API request to pass. Defaults to true.

Status codes:

  • 200: Message context returned
  • 304: No messages

See:

Implementation

Future<_i1.DynamiteResponse<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders>>
    getMessageContext({
  required String token,
  required int messageId,
  ChatGetMessageContextApiVersion? apiVersion,
  int? limit,
  bool? oCSAPIRequest,
}) async {
  final _request = $getMessageContext_Request(
    token: token,
    messageId: messageId,
    apiVersion: apiVersion,
    limit: limit,
    oCSAPIRequest: oCSAPIRequest,
  );
  final _streamedResponse = await _rootClient.httpClient.send(_request);
  final _response = await _i3.Response.fromStream(_streamedResponse);

  final _serializer = $getMessageContext_Serializer();
  return _i1.ResponseConverter<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders>(
    _serializer,
  ).convert(_response);
}