以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求助:这样的消息如何发  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=134796)

--  作者:尘埃落定
--  发布时间:2019/5/6 17:05:00
--  求助:这样的消息如何发
图片点击可在新窗口打开查看
请问发送这样的消息代码如何写?帮助里找不到,多谢多谢。

--  作者:有点甜
--  发布时间:2019/5/6 17:19:00
--  

微信里面的?图文信息

 

http://wechat.foxtable.com:9009/WebHelp/scr/we0146.htm

 

 


--  作者:尘埃落定
--  发布时间:2019/5/6 17:29:00
--  
老师,我是新手,帮助看不明白。我的意思是类似这样的代码如何写出上面的效果:

Dim ur As String = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={0}"
Dim
hc As new HttpClient(Cexp(ur,Functions.Execute("GetQYAccessToken")))
Dim
jo As New JObject
Dim
ja As New JArray
jo
("touser") = "laoliu|zhangsan"
jo
("msgtype") = "news"
jo
("agentid") = 9
For
i As Integer = 1 To 1 \'可以一次发送最多8个图文消息,这里只发送了1
    Dim ao As New JObject()
    ao("title") =
"
特朗普提名保守派大法官" \'标题
    ao("description") =
"
特朗普在白宫提名尼尔·戈萨奇为美国最高法院大法官" \'描述
    ao("url") = "http://news.ifeng.com/a/20170201/50640529_0.shtml"
\'
连接
    ao("picurl") = "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1632653074,1222564348&fm=80&w=179&h=119&img.JPEG"
\'
图片
    ja.Add(ao)

Next

jo
("news") =  New JObject()
jo
("news")("articles") = ja
hc
.Content = jo.ToString()
jo
= JObject.Parse(hc.GetData)
If
jo("errcode") = "0" Then
    MessageBox.show("消息发送成功!")

Else

    MessageBox.show(jo.ToString)

End
If

--  作者:有点甜
--  发布时间:2019/5/6 17:40:00
--  

<ToUserName><![CDATA[gh_c78d6e907523]]></ToUserName>
<FromUserName><![CDATA[o_0W1wG4xCDJTpdqlTfjSdVjlznQ]]></FromUserName>
<CreateTime>1484032820</CreateTime>
<MsgType><![CDATA[link]]></MsgType>
<Title><![CDATA[订单已审核(测试单)]]></Title>
<Description><![CDATA[尊敬的用户,您的订单已通过审核,订单号OU201701070009,详情请点击查看]]></Description>
<Url><![CDATA[https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdd6b4532165dsfsdf1e&redirect_uri=http%3a%2f%2fwechat.foxtable.com%2fordertest%2fOrderDetail.htm%3fid%3dOU201701070009&response_type=code&scope=snsapi_base&state=wxdd6b4532165dsfsdf1e#wechat_redirect]]></Url>
<MsgId>6373872428501563030</MsgId>


 

比如,如下代码,其余的属性,也照抄,即可

 

jo("msgtype") = "link"

[此贴子已经被作者于2019/5/6 17:40:02编辑过]

--  作者:尘埃落定
--  发布时间:2019/5/6 17:48:00
--  
图片点击可在新窗口打开查看
老师,好像不行啊,弹出了这个错误窗口

--  作者:有点甜
--  发布时间:2019/5/6 18:10:00
--  

贴出你所写完整代码。


--  作者:尘埃落定
--  发布时间:2019/5/6 18:12:00
--  
Dim ur As String = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={0}"
Dim hc As new HttpClient(Cexp(ur,Functions.Execute("GetQYAccessToken")))
Dim jo As New JObject
Dim ja As New JArray
jo("touser") = "yanjun"
jo("msgtype") = "link"
jo("agentid") = 1000002
For i As Integer = 1 To 1 \'可以一次发送最多8个图文消息,这里只发送了1个
    Dim ao As New JObject()
    ao("title") = "特朗普提名保守派大法官" \'标题
    ao("description") = "特朗普在白宫提名尼尔·戈萨奇为美国最高法院大法官" \'描述
    ao("url") = "http://news.ifeng.com/a/20170201/50640529_0.shtml" \'连接
    ao("picurl") = "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1632653074,1222564348&fm=80&w=179&h=119&img.JPEG" \'图片
    ja.Add(ao)
Next
jo("link") =  New JObject()
jo("link")("articles") = ja
hc.Content = jo.ToString()
jo = JObject.Parse(hc.GetData)
If jo("errcode") = "0" Then
    MessageBox.show("消息发送成功!")
Else
    MessageBox.show(jo.ToString)
End If




把“link“改成”news“就可以正常发送。

--  作者:有点甜
--  发布时间:2019/5/6 18:37:00
--  

看了一下,没有link类型的消息,只有如下类型

 

https://work.weixin.qq.com/api/doc#90000/90135/90248

 


--  作者:尘埃落定
--  发布时间:2019/5/6 21:20:00
--  
那该咋实现呢?FoxTable公众号中的订单测试是如何实现的呢?

--  作者:有点蓝
--  发布时间:2019/5/6 22:26:00
--  
link消息公众号才有,企业微信没有的。发送news消息也会是一样的效果吧