Browse SDKs · WASM
SDKsWASM

Send an uploaded media message

Send a file, image, audio, or video message that already contains a remote resource URL.

Copy

Use sendMessageNotOss() when a file, image, audio, or video has already received a URL from your application's upload service. This avoids entering the SDK's built-in upload flow again.

Parameters

ParameterTypeRequiredDescription
recvIDstringConditionalRecipient's user ID for a one-to-one chat. Pass an empty string for a group chat.
groupIDstringConditionalTarget group ID for a group chat. Pass an empty string for a one-to-one chat.
messageMessageItemYesPending message returned by a URL-based creation API and already containing remote resource information.
offlinePushInfoOfflinePushNoOffline push title, description, and platform configuration.
isOnlineOnlybooleanNoWhether to deliver only to online clients. Online-only messages are not stored in local history.
const { data: sentMessage } = await openimsdk.sendMessageNotOss({
  recvID: receiverUserID,
  groupID: '',
  message: urlMessage,
});

The resource URL, size, type, dimensions, and duration must come from the actual upload result.

When the Promise resolves, data is the server-confirmed MessageItem. Use clientMsgID to find and update the local pending message. For field descriptions, see Message overview.

This method does not upload the resource and must not be used for a message that still contains only a local file.