public class Message extends Object
| 限定符和类型 | 方法和说明 | ||
|---|---|---|---|
CreateMessageResp |
create(CreateMessageReq req)
发送消息,给指定用户或者会话发送消息,支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。
|
||
CreateMessageResp |
create(CreateMessageReq req,
RequestOptions reqOptions)
发送消息,给指定用户或者会话发送消息,支持文本、富文本、可交互的[消息卡片](https://open.feishu.cn/document/ukTMukTMukTM/uczM3QjL3MzN04yNzcDN)、群名片、个人名片、图片、视频、音频、文件、表情包。
|
||
DeleteMessageResp |
delete(DeleteMessageReq req)
撤回消息,机器人撤回机器人自己发送的消息或群主撤回群内消息。
|
||
DeleteMessageResp |
delete(DeleteMessageReq req,
RequestOptions reqOptions)
撤回消息,机器人撤回机器人自己发送的消息或群主撤回群内消息。
|
||
ForwardMessageResp |
forward(ForwardMessageReq req)
| ||
GetMessageResp |
get(GetMessageReq req,
RequestOptions reqOptions)
获取指定消息的内容,通过 message_id 查询消息内容。
|
||
ListMessageResp |
list(ListMessageReq req)
获取会话历史消息,获取会话(包括单聊、群组)的历史消息(聊天记录)。
|
||
ListMessageResp |
list(ListMessageReq req,
RequestOptions reqOptions)
获取会话历史消息,获取会话(包括单聊、群组)的历史消息(聊天记录)。
|
||
MergeForwardMessageResp |
mergeForward(MergeForwardMessageReq req)
,合并转发多条消息
官网API文档链接:
MergeForwardMessageRespmergeForward(MergeForwardMessageReq req,
RequestOptions reqOptions)
| ||
PatchMessageResp |
patch(PatchMessageReq req,
RequestOptions reqOptions)
更新应用发送的消息,更新应用已发送的消息卡片内容。
|
||
ReadUsersMessageResp |
readUsers(ReadUsersMessageReq req)
查询消息已读信息,查询消息的已读信息。
|
||
ReadUsersMessageResp |
readUsers(ReadUsersMessageReq req,
RequestOptions reqOptions)
查询消息已读信息,查询消息的已读信息。
|
||
ReplyMessageResp |
reply(ReplyMessageReq req)
回复消息,回复指定消息,支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。
|
||
ReplyMessageResp |
reply(ReplyMessageReq req,
RequestOptions reqOptions)
回复消息,回复指定消息,支持文本、富文本、卡片、群名片、个人名片、图片、视频、文件等多种消息类型。
|
||
UpdateMessageResp |
update(UpdateMessageReq req)
,编辑已发送的消息内容,当前仅支持编辑文本和富文本消息。
|
||
UpdateMessageResp |
update(UpdateMessageReq req,
RequestOptions reqOptions)
,编辑已发送的消息内容,当前仅支持编辑文本和富文本消息。
|
||
UrgentAppMessageResp |
urgentApp(UrgentAppMessageReq req)
发送应用内加急,对指定消息进行应用内加急。
|
||
UrgentAppMessageResp |
urgentApp(UrgentAppMessageReq req,
RequestOptions reqOptions)
发送应用内加急,对指定消息进行应用内加急。
|
||
UrgentPhoneMessageResp |
urgentPhone(UrgentPhoneMessageReq req)
发送电话加急,对指定消息进行应用内加急与电话加急。
|
||
UrgentPhoneMessageResp |
urgentPhone(UrgentPhoneMessageReq req,
RequestOptions reqOptions)
发送电话加急,对指定消息进行应用内加急与电话加急。
|
||
UrgentSmsMessageResp |
urgentSms(UrgentSmsMessageReq req)
发送短信加急,对指定消息进行应用内加急与短信加急。
|
||
UrgentSmsMessageResp |
urgentSms(UrgentSmsMessageReq req,
RequestOptions reqOptions)
发送短信加急,对指定消息进行应用内加急与短信加急。
|
public Message(Config config)
public CreateMessageResp create(CreateMessageReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 给用户发送消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息,需要机器人在群组中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create ;
Exceptionpublic CreateMessageResp create(CreateMessageReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 给用户发送消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 给群组发送消息,需要机器人在群组中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create ;
Exceptionpublic DeleteMessageResp delete(DeleteMessageReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ,撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内,自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息,则机器人必须是该群的群主、管理员 或者 创建者,且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete ;
Exceptionpublic DeleteMessageResp delete(DeleteMessageReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ,撤回消息时机器人仍需要在会话内;- 机器人可以撤回单聊和群组内,自己发送 且 发送时间不超过1天(24小时)的消息;- 若机器人要撤回群内他人发送的消息,则机器人必须是该群的群主、管理员 或者 创建者,且消息发送时间不超过1年;- 无法撤回通过「[批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM)」接口发送的消息 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/delete ;
Exceptionpublic ForwardMessageResp forward(ForwardMessageReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 ;
Exceptionpublic ForwardMessageResp forward(ForwardMessageReq req) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 ;
Exceptionpublic GetMessageResp get(GetMessageReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 机器人必须在群组中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get ;
Exceptionpublic GetMessageResp get(GetMessageReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 机器人必须在群组中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/get ;
Exceptionpublic ListMessageResp list(ListMessageReq req, RequestOptions reqOptions) throws Exception
接口级别权限默认只能获取单聊(p2p)消息,如果需要获取群组(group)消息,应用还必须拥有 **==获取群组中所有消息==** 权限 ;
- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取消息时,机器人必须在群组中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list ;
Exceptionpublic ListMessageResp list(ListMessageReq req) throws Exception
接口级别权限默认只能获取单聊(p2p)消息,如果需要获取群组(group)消息,应用还必须拥有 **==获取群组中所有消息==** 权限 ;
- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 获取消息时,机器人必须在群组中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/list ;
Exceptionpublic MergeForwardMessageResp mergeForward(MergeForwardMessageReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic MergeForwardMessageResp mergeForward(MergeForwardMessageReq req) throws Exception
Exceptionpublic PatchMessageResp patch(PatchMessageReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息,该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息,需在卡片的config属性中,显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB;卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS** ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch ;
Exceptionpublic PatchMessageResp patch(PatchMessageReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 若以user_access_token更新消息,该操作用户必须是卡片消息的发送者;- 仅支持对所有人更新**未撤回**的[「共享卡片」](ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN)消息,需在卡片的config属性中,显式声明 =="update_multi":true==。 ;- **不支持更新批量消息**;- 文本消息请求体最大不能超过150KB;卡片及富文本消息请求体最大不能超过30KB;- 仅支持修改14天内发送的消息;- 单条消息更新频控为**5QPS** ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/patch ;
Exceptionpublic ReadUsersMessageResp readUsers(ReadUsersMessageReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能查询机器人自己发送,且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users ;
Exceptionpublic ReadUsersMessageResp readUsers(ReadUsersMessageReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能查询机器人自己发送,且发送时间不超过7天的消息;- 查询消息已读信息时机器人仍需要在会话内;- 本接口不支持查询批量消息 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/read_users ;
Exceptionpublic ReplyMessageResp reply(ReplyMessageReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 回复私聊消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息,需要机器人在群中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply ;
Exceptionpublic ReplyMessageResp reply(ReplyMessageReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 回复私聊消息,需要机器人对用户有[可用性](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability);- 回复群组消息,需要机器人在群中 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/reply ;
Exceptionpublic UpdateMessageResp update(UpdateMessageReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 ;
Exceptionpublic UpdateMessageResp update(UpdateMessageReq req) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=im&resource=message&version=v1 ;
Exceptionpublic UrgentAppMessageResp urgentApp(UrgentAppMessageReq req, RequestOptions reqOptions) throws Exception
特别说明:;- 默认接口限流为50 QPS,请谨慎调用 ;
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app ;
Exceptionpublic UrgentAppMessageResp urgentApp(UrgentAppMessageReq req) throws Exception
特别说明:;- 默认接口限流为50 QPS,请谨慎调用 ;
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 不支持加急批量消息;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_app ;
Exceptionpublic UrgentPhoneMessageResp urgentPhone(UrgentPhoneMessageReq req, RequestOptions reqOptions) throws Exception
特别说明:;- 通过接口产生的电话加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ;
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急(用户未读的加急上限为200条) ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone ;
Exceptionpublic UrgentPhoneMessageResp urgentPhone(UrgentPhoneMessageReq req) throws Exception
特别说明:;- 通过接口产生的电话加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ;
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人需要在加急消息所在的群组中;- 需要用户阅读已加急的消息才可以继续加急(用户未读的加急上限为200条) ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_phone ;
Exceptionpublic UrgentSmsMessageResp urgentSms(UrgentSmsMessageReq req, RequestOptions reqOptions) throws Exception
特别说明:;- 通过接口产生的短信加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ;
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms ;
Exceptionpublic UrgentSmsMessageResp urgentSms(UrgentSmsMessageReq req) throws Exception
特别说明:;- 通过接口产生的短信加急将消耗企业的加急额度,请慎重调用;- 通过[租户管理后台](https://admin.feishu.cn/)-费用中心-短信/电话加急 可以查看当前额度;- 默认接口限流为50 QPS,请谨慎调用 ;
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability) ;- 只能加急机器人自己发送的消息;- 加急时机器人仍需要在加急消息所在的群组中;- 调用本接口需要用户已阅读加急的消息才可以继续加急(用户未读的加急上限为200条) ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/urgent_sms ;
ExceptionCopyright © 2024. All rights reserved.