getMessageContext method

Future<DynamiteResponse<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders>> getMessageContext({
  1. required String token,
  2. required int messageId,
  3. int? limit,
  4. ChatGetMessageContextApiVersion? apiVersion,
  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:

  • limit Number of chat messages to receive in both directions (50 by default, 100 at most, might return 201 messages). Defaults to 50.
  • apiVersion Defaults to "v1".
  • token
  • messageId The focused message which should be in the "middle" of the returned context.
  • 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,
  int? limit,
  ChatGetMessageContextApiVersion? apiVersion,
  bool? oCSAPIRequest,
}) async {
  final _request = $getMessageContext_Request(
    token: token,
    messageId: messageId,
    limit: limit,
    apiVersion: apiVersion,
    oCSAPIRequest: oCSAPIRequest,
  );
  final _response = await _rootClient.httpClient.send(_request);

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