Class YCloudMessageService
java.lang.Object
com.bytedesk.social.whatsapp.ycloud.YCloudMessageService
WhatsApp Webhook服务
 
 https://docs.ycloud.com/reference/whatsapp_message-send-directly
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classWhatsApp消息详情响应(用于获取消息详情)static classWhatsApp消息响应
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final IMessageSendServiceprivate final com.fasterxml.jackson.databind.ObjectMapperprivate final org.springframework.web.client.RestTemplateprivate static final Stringprivate final SpringAIServiceRegistryprivate final ThreadRestServiceprivate final UidUtilsprivate final VisitorRestService
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate VisitorRequestbuildVisitorRequest(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, WhatsAppEntity whatsAppEntity) 根据WhatsApp消息构建访客请求对象voidechoMessage(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, String apiKey, String sender) Echo测试功能 - 将接收到的消息原样发送回去异步发送WhatsApp音频消息enqueueAudioMessage(String from, String to, String audioUrl, String caption, String filename, String apiKey) 异步发送WhatsApp音频消息enqueueAudioMessage(String from, String to, String audioUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp音频消息enqueueContactsMessage(String from, String to, com.fasterxml.jackson.databind.JsonNode contacts, String apiKey) 异步发送WhatsApp联系人消息enqueueContactsMessage(String from, String to, com.fasterxml.jackson.databind.JsonNode contacts, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp联系人消息异步发送WhatsApp文档消息enqueueDocumentMessage(String from, String to, String documentUrl, String caption, String filename, String apiKey) 异步发送WhatsApp文档消息enqueueDocumentMessage(String from, String to, String documentUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp文档消息异步发送WhatsApp图片消息enqueueImageMessage(String from, String to, String imageUrl, String caption, String filename, String apiKey) 异步发送WhatsApp图片消息enqueueImageMessage(String from, String to, String imageUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp图片消息enqueueInteractiveButtonMessage(String from, String to, String body, String[] buttons, String apiKey) 异步发送WhatsApp交互式按钮消息enqueueInteractiveButtonMessage(String from, String to, String body, String[] buttons, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp交互式按钮消息enqueueLocationMessage(String from, String to, double latitude, double longitude, String apiKey) 异步发送WhatsApp位置消息enqueueLocationMessage(String from, String to, double latitude, double longitude, String name, String address, String apiKey) 异步发送WhatsApp位置消息enqueueLocationMessage(String from, String to, double latitude, double longitude, String name, String address, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp位置消息异步发送WhatsApp反应消息enqueueReactionMessage(String from, String to, String messageId, String emoji, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp反应消息异步发送WhatsApp贴纸消息enqueueStickerMessage(String from, String to, String stickerUrl, String caption, String filename, String apiKey) 异步发送WhatsApp贴纸消息enqueueStickerMessage(String from, String to, String stickerUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp贴纸消息enqueueTextMessage(String from, String to, String text, String apiKey) 异步发送WhatsApp文本消息异步发送WhatsApp文本消息enqueueTextMessage(String from, String to, String text, String apiKey, Boolean previewUrl, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp文本消息异步发送WhatsApp视频消息enqueueVideoMessage(String from, String to, String videoUrl, String caption, String filename, String apiKey) 异步发送WhatsApp视频消息enqueueVideoMessage(String from, String to, String videoUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp视频消息enqueueWhatsappMessage(String messageJson, String apiKey) 异步发送WhatsApp消息(入队)enqueueWhatsappMessage(String messageJson, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp消息(入队)getMessage(String messageId, String apiKey) 获取WhatsApp消息详情private voidhandleRobotResponse(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, ThreadProtobuf thread, WhatsAppEntity whatsAppEntity, MessageProtobuf messageProtobuf) 处理机器人回复voidhandleWhatsappInboundMessage(YCloudWhatsappInboundReceived event, WhatsAppEntity whatsAppEntity) 处理WhatsApp入站消息void处理WhatsApp消息状态更新processMessages(String rawPayload) 处理webhook事件发送WhatsApp音频消息sendAudioMessage(String from, String to, String audioUrl, String caption, String filename, String apiKey) 发送WhatsApp音频消息(向后兼容方法)sendAudioMessageInternal(String from, String to, String audioUrl, String caption, String filename, String apiKey, String externalId) 发送音频消息(内部方法)sendContactsMessage(String from, String to, com.fasterxml.jackson.databind.JsonNode contacts, String apiKey) 发送WhatsApp联系人消息发送WhatsApp文档消息sendDocumentMessage(String from, String to, String documentUrl, String caption, String filename, String apiKey) 发送WhatsApp文档消息(向后兼容方法)sendDocumentMessageInternal(String from, String to, String documentUrl, String caption, String filename, String apiKey, String externalId) 发送文档消息(内部方法)发送WhatsApp图片消息sendImageMessage(String from, String to, String imageUrl, String caption, String filename, String apiKey) 发送WhatsApp图片消息(向后兼容方法)sendImageMessageInternal(String from, String to, String imageUrl, String caption, String filename, String apiKey, String externalId) 发送图片消息(内部方法)发送WhatsApp交互式按钮消息(向后兼容方法)sendInteractiveButtonMessageInternal(String from, String to, String content, String apiKey, String externalId) 发送交互式按钮消息(内部方法)sendLinkMessageInternal(String from, String to, String linkContent, String apiKey, String externalId) 发送链接消息(内部方法)sendLocationMessage(String from, String to, double latitude, double longitude, String apiKey) 发送WhatsApp位置消息sendLocationMessage(String from, String to, double latitude, double longitude, String name, String address, String apiKey) 发送WhatsApp位置消息sendLocationMessageInternal(String from, String to, String locationContent, String apiKey, String externalId) 发送位置消息(内部方法)sendMessage(String from, String to, MessageTypeEnum messageType, String content, String caption, String filename, String apiKey, String externalId) 统一的消息发送方法发送WhatsApp反应消息发送WhatsApp贴纸消息sendStickerMessage(String from, String to, String stickerUrl, String caption, String filename, String apiKey) 发送WhatsApp贴纸消息sendStickerMessageInternal(String from, String to, String stickerUrl, String caption, String filename, String apiKey, String externalId) 发送贴纸消息(内部方法)sendTextMessage(String from, String to, String text, String apiKey) 发送WhatsApp文本消息发送WhatsApp文本消息(向后兼容方法)发送文本消息(内部方法)private voidsendToCustomerService(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, VisitorResponse visitor, ThreadProtobuf thread, WhatsAppEntity whatsAppEntity) 发送消息到客服系统发送WhatsApp视频消息sendVideoMessage(String from, String to, String videoUrl, String caption, String filename, String apiKey) 发送WhatsApp视频消息(向后兼容方法)sendVideoMessageInternal(String from, String to, String videoUrl, String caption, String filename, String apiKey, String externalId) 发送视频消息(内部方法)private voidsendWelcomeMessage(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, ThreadProtobuf thread, WhatsAppEntity whatsAppEntity, String welcomeContent) 发送欢迎消息sendWhatsappMessage(String messageJson, String apiKey) 发送WhatsApp消息sendWhatsappMessage(String messageJson, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 发送WhatsApp消息
- 
Field Details- 
objectMapperprivate final com.fasterxml.jackson.databind.ObjectMapper objectMapper
- 
restTemplateprivate final org.springframework.web.client.RestTemplate restTemplate
- 
SEND_MESSAGE_URL- See Also:
 
- 
ENQUEUE_MESSAGE_URL- See Also:
 
- 
messageSendService
- 
threadRestService
- 
visitorRestService
- 
springAIServiceRegistry
- 
uidUtils
 
- 
- 
Constructor Details- 
YCloudMessageServicepublic YCloudMessageService()
 
- 
- 
Method Details- 
sendMessagepublic YCloudMessageService.WhatsappMessageResponse sendMessage(String from, String to, MessageTypeEnum messageType, String content, String caption, String filename, String apiKey, String externalId) 统一的消息发送方法- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- messageType- 消息类型
- content- 消息内容(URL、文本等)
- caption- 媒体说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- externalId- 外部ID(可选)
- Returns:
- 发送结果
 
- 
sendTextMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendTextMessageInternal(String from, String to, String text, String apiKey, String externalId) 发送文本消息(内部方法)
- 
sendImageMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendImageMessageInternal(String from, String to, String imageUrl, String caption, String filename, String apiKey, String externalId) 发送图片消息(内部方法)
- 
sendVideoMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendVideoMessageInternal(String from, String to, String videoUrl, String caption, String filename, String apiKey, String externalId) 发送视频消息(内部方法)
- 
sendAudioMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendAudioMessageInternal(String from, String to, String audioUrl, String caption, String filename, String apiKey, String externalId) 发送音频消息(内部方法)
- 
sendDocumentMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendDocumentMessageInternal(String from, String to, String documentUrl, String caption, String filename, String apiKey, String externalId) 发送文档消息(内部方法)
- 
sendLocationMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendLocationMessageInternal(String from, String to, String locationContent, String apiKey, String externalId) 发送位置消息(内部方法)
- 
sendLinkMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendLinkMessageInternal(String from, String to, String linkContent, String apiKey, String externalId) 发送链接消息(内部方法)
- 
sendInteractiveButtonMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendInteractiveButtonMessageInternal(String from, String to, String content, String apiKey, String externalId) 发送交互式按钮消息(内部方法)
- 
sendStickerMessageInternalprivate YCloudMessageService.WhatsappMessageResponse sendStickerMessageInternal(String from, String to, String stickerUrl, String caption, String filename, String apiKey, String externalId) 发送贴纸消息(内部方法)
- 
processMessages处理webhook事件- Parameters:
- rawPayload- webhook原始负载
- Returns:
- 处理后的事件对象
 
- 
handleWhatsappInboundMessagepublic void handleWhatsappInboundMessage(YCloudWhatsappInboundReceived event, WhatsAppEntity whatsAppEntity) 处理WhatsApp入站消息- Parameters:
- event- WhatsApp入站消息事件
- whatsAppEntity- WhatsApp实体对象
 
- 
buildVisitorRequestprivate VisitorRequest buildVisitorRequest(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, WhatsAppEntity whatsAppEntity) 根据WhatsApp消息构建访客请求对象- Parameters:
- inboundMessage- WhatsApp入站消息
- whatsAppEntity- WhatsApp实体对象
- Returns:
- 访客请求对象
 
- 
sendWelcomeMessageprivate void sendWelcomeMessage(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, ThreadProtobuf thread, WhatsAppEntity whatsAppEntity, String welcomeContent) 发送欢迎消息
- 
handleRobotResponseprivate void handleRobotResponse(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, ThreadProtobuf thread, WhatsAppEntity whatsAppEntity, MessageProtobuf messageProtobuf) 处理机器人回复
- 
sendToCustomerServiceprivate void sendToCustomerService(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, VisitorResponse visitor, ThreadProtobuf thread, WhatsAppEntity whatsAppEntity) 发送消息到客服系统
- 
echoMessagepublic void echoMessage(YCloudWhatsappInboundReceived.WhatsappInboundMessage inboundMessage, String apiKey, String sender) Echo测试功能 - 将接收到的消息原样发送回去- Parameters:
- inboundMessage- 收到的入站消息
- apiKey- API密钥
- sender- 发送者电话号码
 
- 
handleWhatsappMessageUpdated处理WhatsApp消息状态更新- Parameters:
- event- WhatsApp消息更新事件
 
- 
sendWhatsappMessagepublic YCloudMessageService.WhatsappMessageResponse sendWhatsappMessage(String messageJson, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 发送WhatsApp消息- Parameters:
- messageJson- 消息JSON字符串
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
sendWhatsappMessagepublic YCloudMessageService.WhatsappMessageResponse sendWhatsappMessage(String messageJson, String apiKey) 发送WhatsApp消息- Parameters:
- messageJson- 消息JSON字符串
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueWhatsappMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueWhatsappMessage(String messageJson, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp消息(入队)- Parameters:
- messageJson- 消息JSON字符串
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueWhatsappMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueWhatsappMessage(String messageJson, String apiKey) 异步发送WhatsApp消息(入队)- Parameters:
- messageJson- 消息JSON字符串
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendTextMessagepublic YCloudMessageService.WhatsappMessageResponse sendTextMessage(String from, String to, String text, String apiKey, Boolean previewUrl) 发送WhatsApp文本消息(向后兼容方法)- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- text- 文本内容
- apiKey- API密钥
- previewUrl- 是否显示URL预览(可选)
- Returns:
- 发送结果
 
- 
sendTextMessagepublic YCloudMessageService.WhatsappMessageResponse sendTextMessage(String from, String to, String text, String apiKey) 发送WhatsApp文本消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- text- 文本内容
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueTextMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueTextMessage(String from, String to, String text, String apiKey, Boolean previewUrl, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp文本消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- text- 文本内容
- apiKey- API密钥
- previewUrl- 是否显示URL预览(可选)
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueTextMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueTextMessage(String from, String to, String text, String apiKey, Boolean previewUrl) 异步发送WhatsApp文本消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- text- 文本内容
- apiKey- API密钥
- previewUrl- 是否显示URL预览(可选)
- Returns:
- 发送结果
 
- 
enqueueTextMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueTextMessage(String from, String to, String text, String apiKey) 异步发送WhatsApp文本消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- text- 文本内容
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendImageMessagepublic YCloudMessageService.WhatsappMessageResponse sendImageMessage(String from, String to, String imageUrl, String caption, String filename, String apiKey) 发送WhatsApp图片消息(向后兼容方法)- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- imageUrl- 图片URL
- caption- 图片说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendImageMessagepublic YCloudMessageService.WhatsappMessageResponse sendImageMessage(String from, String to, String imageUrl, String caption, String apiKey) 发送WhatsApp图片消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- imageUrl- 图片URL
- caption- 图片说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueImageMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueImageMessage(String from, String to, String imageUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp图片消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- imageUrl- 图片URL
- caption- 图片说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueImageMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueImageMessage(String from, String to, String imageUrl, String caption, String filename, String apiKey) 异步发送WhatsApp图片消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- imageUrl- 图片URL
- caption- 图片说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueImageMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueImageMessage(String from, String to, String imageUrl, String caption, String apiKey) 异步发送WhatsApp图片消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- imageUrl- 图片URL
- caption- 图片说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendVideoMessagepublic YCloudMessageService.WhatsappMessageResponse sendVideoMessage(String from, String to, String videoUrl, String caption, String filename, String apiKey) 发送WhatsApp视频消息(向后兼容方法)- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- videoUrl- 视频URL
- caption- 视频说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendVideoMessagepublic YCloudMessageService.WhatsappMessageResponse sendVideoMessage(String from, String to, String videoUrl, String caption, String apiKey) 发送WhatsApp视频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- videoUrl- 视频URL
- caption- 视频说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueVideoMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueVideoMessage(String from, String to, String videoUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp视频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- videoUrl- 视频URL
- caption- 视频说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueVideoMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueVideoMessage(String from, String to, String videoUrl, String caption, String filename, String apiKey) 异步发送WhatsApp视频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- videoUrl- 视频URL
- caption- 视频说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueVideoMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueVideoMessage(String from, String to, String videoUrl, String caption, String apiKey) 异步发送WhatsApp视频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- videoUrl- 视频URL
- caption- 视频说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendAudioMessagepublic YCloudMessageService.WhatsappMessageResponse sendAudioMessage(String from, String to, String audioUrl, String caption, String filename, String apiKey) 发送WhatsApp音频消息(向后兼容方法)- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- audioUrl- 音频URL
- caption- 音频说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendAudioMessagepublic YCloudMessageService.WhatsappMessageResponse sendAudioMessage(String from, String to, String audioUrl, String caption, String apiKey) 发送WhatsApp音频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- audioUrl- 音频URL
- caption- 音频说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueAudioMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueAudioMessage(String from, String to, String audioUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp音频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- audioUrl- 音频URL
- caption- 音频说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueAudioMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueAudioMessage(String from, String to, String audioUrl, String caption, String filename, String apiKey) 异步发送WhatsApp音频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- audioUrl- 音频URL
- caption- 音频说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueAudioMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueAudioMessage(String from, String to, String audioUrl, String caption, String apiKey) 异步发送WhatsApp音频消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- audioUrl- 音频URL
- caption- 音频说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendDocumentMessagepublic YCloudMessageService.WhatsappMessageResponse sendDocumentMessage(String from, String to, String documentUrl, String caption, String filename, String apiKey) 发送WhatsApp文档消息(向后兼容方法)- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- documentUrl- 文档URL
- caption- 文档说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendDocumentMessagepublic YCloudMessageService.WhatsappMessageResponse sendDocumentMessage(String from, String to, String documentUrl, String caption, String apiKey) 发送WhatsApp文档消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- documentUrl- 文档URL
- caption- 文档说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueDocumentMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueDocumentMessage(String from, String to, String documentUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp文档消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- documentUrl- 文档URL
- caption- 文档说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueDocumentMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueDocumentMessage(String from, String to, String documentUrl, String caption, String filename, String apiKey) 异步发送WhatsApp文档消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- documentUrl- 文档URL
- caption- 文档说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueDocumentMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueDocumentMessage(String from, String to, String documentUrl, String caption, String apiKey) 异步发送WhatsApp文档消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- documentUrl- 文档URL
- caption- 文档说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendStickerMessagepublic YCloudMessageService.WhatsappMessageResponse sendStickerMessage(String from, String to, String stickerUrl, String caption, String filename, String apiKey) 发送WhatsApp贴纸消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- stickerUrl- 贴纸URL
- caption- 贴纸说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendStickerMessagepublic YCloudMessageService.WhatsappMessageResponse sendStickerMessage(String from, String to, String stickerUrl, String caption, String apiKey) 发送WhatsApp贴纸消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- stickerUrl- 贴纸URL
- caption- 贴纸说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueStickerMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueStickerMessage(String from, String to, String stickerUrl, String caption, String filename, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp贴纸消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- stickerUrl- 贴纸URL
- caption- 贴纸说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueStickerMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueStickerMessage(String from, String to, String stickerUrl, String caption, String filename, String apiKey) 异步发送WhatsApp贴纸消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- stickerUrl- 贴纸URL
- caption- 贴纸说明(可选)
- filename- 文件名(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueStickerMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueStickerMessage(String from, String to, String stickerUrl, String caption, String apiKey) 异步发送WhatsApp贴纸消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- stickerUrl- 贴纸URL
- caption- 贴纸说明(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendLocationMessagepublic YCloudMessageService.WhatsappMessageResponse sendLocationMessage(String from, String to, double latitude, double longitude, String name, String address, String apiKey) 发送WhatsApp位置消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- latitude- 纬度
- longitude- 经度
- name- 位置名称(可选)
- address- 地址(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendLocationMessagepublic YCloudMessageService.WhatsappMessageResponse sendLocationMessage(String from, String to, double latitude, double longitude, String apiKey) 发送WhatsApp位置消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- latitude- 纬度
- longitude- 经度
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueLocationMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueLocationMessage(String from, String to, double latitude, double longitude, String name, String address, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp位置消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- latitude- 纬度
- longitude- 经度
- name- 位置名称(可选)
- address- 地址(可选)
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueLocationMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueLocationMessage(String from, String to, double latitude, double longitude, String name, String address, String apiKey) 异步发送WhatsApp位置消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- latitude- 纬度
- longitude- 经度
- name- 位置名称(可选)
- address- 地址(可选)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueLocationMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueLocationMessage(String from, String to, double latitude, double longitude, String apiKey) 异步发送WhatsApp位置消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- latitude- 纬度
- longitude- 经度
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendInteractiveButtonMessagepublic YCloudMessageService.WhatsappMessageResponse sendInteractiveButtonMessage(String from, String to, String body, String[] buttons, String apiKey) 发送WhatsApp交互式按钮消息(向后兼容方法)- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- body- 消息正文
- buttons- 按钮数组(最多3个)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueInteractiveButtonMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueInteractiveButtonMessage(String from, String to, String body, String[] buttons, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp交互式按钮消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- body- 消息正文
- buttons- 按钮数组(最多3个)
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueInteractiveButtonMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueInteractiveButtonMessage(String from, String to, String body, String[] buttons, String apiKey) 异步发送WhatsApp交互式按钮消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- body- 消息正文
- buttons- 按钮数组(最多3个)
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendReactionMessagepublic YCloudMessageService.WhatsappMessageResponse sendReactionMessage(String from, String to, String messageId, String emoji, String apiKey) 发送WhatsApp反应消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- messageId- 要回复的消息ID
- emoji- 表情符号
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueReactionMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueReactionMessage(String from, String to, String messageId, String emoji, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp反应消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- messageId- 要回复的消息ID
- emoji- 表情符号
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueReactionMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueReactionMessage(String from, String to, String messageId, String emoji, String apiKey) 异步发送WhatsApp反应消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- messageId- 要回复的消息ID
- emoji- 表情符号
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
sendContactsMessagepublic YCloudMessageService.WhatsappMessageResponse sendContactsMessage(String from, String to, com.fasterxml.jackson.databind.JsonNode contacts, String apiKey) 发送WhatsApp联系人消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- contacts- 联系人数组
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
enqueueContactsMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueContactsMessage(String from, String to, com.fasterxml.jackson.databind.JsonNode contacts, String apiKey, String externalId, Boolean filterUnsubscribed, Boolean filterBlocked) 异步发送WhatsApp联系人消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- contacts- 联系人数组
- apiKey- API密钥
- externalId- 外部ID(可选)
- filterUnsubscribed- 是否过滤已退订用户(可选)
- filterBlocked- 是否过滤已屏蔽用户(可选)
- Returns:
- 发送结果
 
- 
enqueueContactsMessagepublic YCloudMessageService.WhatsappMessageResponse enqueueContactsMessage(String from, String to, com.fasterxml.jackson.databind.JsonNode contacts, String apiKey) 异步发送WhatsApp联系人消息- Parameters:
- from- 发送者电话号码(E.164格式)
- to- 接收者电话号码(E.164格式)
- contacts- 联系人数组
- apiKey- API密钥
- Returns:
- 发送结果
 
- 
getMessagepublic YCloudMessageService.WhatsappMessageDetailResponse getMessage(String messageId, String apiKey) 获取WhatsApp消息详情- Parameters:
- messageId- 消息ID
- apiKey- API密钥
- Returns:
- 消息详情
 
 
-