发送群消息
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chatid | String | 可选 | chatxxx | 群会话id | |||||||||||||||||||||||||||||||||||||||||||||||||
action_card | ActionCard | 可选 | actionCard消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
oa | Oa | 可选 | OA消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
voice | Voice | 可选 | 语音消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
file | File | 可选 | 文件消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
image | Image | 可选 | 图片消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
link | Link | 可选 | 链接消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
text | Text | 可选 | 文本消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
msgtype | String | 可选 | text | 消息类型 | |||||||||||||||||||||||||||||||||||||||||||||||||
markdown | Markdown | 可选 | markdown消息 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
msg | Msg | 可选 | 消息格式 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
errcode | Number | 0 | errcode |
errmsg | String | ok | errmsg |
messageId | String | 111 | messageId |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | OapiChatSendRequest req = new OapiChatSendRequest(); req.setChatid( "chatxxx" ); ActionCard obj1 = new ActionCard(); obj1.setTitle( "透出到会话列表和通知的文案" ); obj1.setMarkdown( "消息内容" ); obj1.setSingleTitle( "111" ); obj1.setSingleUrl( "url" ); obj1.setBtnOrientation( "1" ); List<BtnJson> list3 = new ArrayList<BtnJson>(); BtnJson obj4 = new BtnJson(); list3.add(obj4); obj4.setTitle( "111" ); obj4.setActionUrl( "url" ); obj1.setBtnJsonList(list3); obj1.setAgentid( "111" ); obj1.setHideAvatar( true ); req.setActionCard(obj1); Oa obj5 = new Oa(); obj5.setMessageUrl( "消息链接" ); obj5.setPcMessageUrl( "pc端消息链接" ); Head obj6 = new Head(); obj6.setText( "消息头部标题" ); obj6.setBgcolor( "FFBBBBBB" ); obj5.setHead(obj6); Body obj7 = new Body(); obj7.setTitle( "消息体的标题" ); obj7.setContent( "消息体的内容" ); obj7.setImage( "mediaId" ); obj7.setFileCount( "1" ); obj7.setAuthor( "自定义的作者名字" ); Rich obj8 = new Rich(); obj8.setNum( "1" ); obj8.setUnit( "1" ); obj7.setRich(obj8); List<Form> list10 = new ArrayList<Form>(); Form obj11 = new Form(); list10.add(obj11); obj11.setKey( "key" ); obj11.setValue( "value" ); obj7.setForm(list10); obj5.setBody(obj7); req.setOa(obj5); Voice obj12 = new Voice(); obj12.setMediaId( "mediaId" ); obj12.setDuration(100L); req.setVoice(obj12); File obj13 = new File(); obj13.setMediaId( "mediaId" ); req.setFile(obj13); Image obj14 = new Image(); obj14.setMediaId( "mediaId" ); req.setImage(obj14); Link obj15 = new Link(); obj15.setTitle( "消息标题" ); obj15.setText( "消息文本" ); obj15.setPicUrl( "picUrl" ); obj15.setMessageUrl( "messageUrl" ); req.setLink(obj15); Text obj16 = new Text(); obj16.setContent( "文本消息内容" ); req.setText(obj16); req.setMsgtype( "text" ); Markdown obj17 = new Markdown(); obj17.setTitle( "首屏会话透出的展示内容" ); obj17.setText( "markdown格式的消息" ); req.setMarkdown(obj17); Msg obj18 = new Msg(); Text obj19 = new Text(); obj19.setContent( "txt" ); obj18.setText(obj19); obj18.setMsgtype( "text" ); Link obj20 = new Link(); obj20.setMessageUrl( "messageUrl" ); obj20.setPicUrl( "picUrl" ); obj20.setText( "消息文本" ); obj20.setTitle( "消息标题" ); obj18.setLink(obj20); Image obj21 = new Image(); obj21.setMediaId( "@mediaId" ); obj18.setImage(obj21); File obj22 = new File(); obj22.setMediaId( "@mediaId" ); obj18.setFile(obj22); Voice obj23 = new Voice(); obj23.setMediaId( "@mediaId" ); obj23.setDuration(100L); obj18.setVoice(obj23); Oa obj24 = new Oa(); Head obj25 = new Head(); obj25.setBgcolor( "bgcolor" ); obj25.setText( "text" ); obj24.setHead(obj25); obj24.setMessageUrl( "message_url" ); obj24.setPcMessageUrl( "pc_message_url" ); Body obj26 = new Body(); List<Form> list28 = new ArrayList<Form>(); Form obj29 = new Form(); list28.add(obj29); obj29.setValue( "value" ); obj29.setKey( "key" ); obj26.setForm(list28); Rich obj30 = new Rich(); obj30.setUnit( "unit" ); obj30.setNum( "num" ); obj26.setRich(obj30); obj26.setAuthor( "author" ); obj26.setFileCount( "file_count" ); obj26.setImage( "image" ); obj26.setContent( "content" ); obj26.setTitle( "title" ); obj24.setBody(obj26); obj18.setOa(obj24); ActionCard obj31 = new ActionCard(); obj31.setAgentid( "agentid" ); List<BtnJsonList> list33 = new ArrayList<BtnJsonList>(); BtnJsonList obj34 = new BtnJsonList(); list33.add(obj34); obj34.setActionUrl( "action_url" ); obj34.setTitle( "title" ); obj31.setBtnJsonList(list33); obj31.setBtnOrientation( "0" ); obj31.setSingleUrl( "single_url" ); obj31.setSingleTitle( "single_title" ); obj31.setMarkdown( "markdown" ); obj31.setTitle( "title" ); obj31.setHideAvatar( true ); obj18.setActionCard(obj31); Markdown obj35 = new Markdown(); obj35.setText( "text" ); obj35.setTitle( "title" ); obj18.setMarkdown(obj35); req.setMsg(obj18); OapiChatSendResponse rsp = client.execute(req, access_token); System.out.println(rsp.getBody()); |