shareObjectToChat method

Future<DynamiteResponse<ChatShareObjectToChatResponseApplicationJson, ChatChatShareObjectToChatHeaders>> shareObjectToChat({
  1. required String objectType,
  2. required String objectId,
  3. required String token,
  4. String? metaData,
  5. String? actorDisplayName,
  6. String? referenceId,
  7. ChatShareObjectToChatApiVersion? apiVersion,
  8. bool? oCSAPIRequest,
})

Sends a rich-object to the given room.

The author and timestamp are automatically set to the current user/guest and time.

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:

  • objectType Type of the object.
  • objectId ID of the object.
  • metaData Additional metadata. Defaults to ''.
  • actorDisplayName Guest name. Defaults to ''.
  • referenceId Reference ID. Defaults to ''.
  • apiVersion Defaults to v1.
  • token
  • oCSAPIRequest Required to be true for the API request to pass. Defaults to true.

Status codes:

  • 201: Object shared successfully
  • 400: Sharing object is not possible
  • 404: Actor not found
  • 413: Message too long

See:

Implementation

Future<DynamiteResponse<ChatShareObjectToChatResponseApplicationJson, ChatChatShareObjectToChatHeaders>>
    shareObjectToChat({
  required String objectType,
  required String objectId,
  required String token,
  String? metaData,
  String? actorDisplayName,
  String? referenceId,
  ChatShareObjectToChatApiVersion? apiVersion,
  bool? oCSAPIRequest,
}) async {
  final rawResponse = shareObjectToChatRaw(
    objectType: objectType,
    objectId: objectId,
    token: token,
    metaData: metaData,
    actorDisplayName: actorDisplayName,
    referenceId: referenceId,
    apiVersion: apiVersion,
    oCSAPIRequest: oCSAPIRequest,
  );

  return rawResponse.future;
}