Skip to content

发送链接朋友圈消息

发布带链接卡片的朋友圈。

调用限制

微信需在线三天后使用本接口,否则微信团队会提示不可使用副设备发送。

接口地址: POST /snsSendUrl

前置条件

  • 微信实例已登录,并已获得可用的 wId
  • 当前微信实例在线时间满足微信侧朋友圈发布要求。
  • urlthumbUrl 需要公网可访问。
  • 如需限制可见范围,应提前确认好友微信 ID 或标签 ID。

请求参数

参数名必选类型说明
wIdstring登录实例标识
contentstring文本内容
titlestring标题
descriptionstring描述
urlstring跳转链接
thumbUrlstring缩略图 URL
groupUserstring可见用户微信 ID,多个用英文逗号分隔
blackListstring不可见用户微信 ID,多个用英文逗号分隔
groupUserLabelIdsstring可见标签 ID,多个用英文逗号分隔
blackListLabelIdsstring不可见标签 ID,多个用英文逗号分隔

请求示例

json
{
  "wId": "25dea7a4-ddea-40c6-87ad-3e982e998921",
  "content": "客户案例更新",
  "title": "Eyun 客户服务案例",
  "description": "了解微信私域运营的自动化实践",
  "url": "https://mp.weixin.qq.com/s/cxJ7pLvkRwBV_NUfQxNEjA",
  "thumbUrl": "http://dmjvip.oss-cn-shenzhen.aliyuncs.com/download/dailyimg/20200618155919206.jpg"
}

响应参数

参数名类型说明
codestring1000 成功,1001 失败
messagestring反馈信息
data.statusint发送状态
data.object.idstring朋友圈 ID
data.object.userNamestring发送者微信 ID
data.object.createTimelong发布时间戳
data.object.objectDescstring朋友圈内容 XML

成功响应

json
{
 "message": "成功",
 "code": "1000",
 "data": {
 "status": 1,
 "object": {
 "id": "13367129656153944194",
 "userName": "wxid_gia1nwcgpobz22",
 "createTime": 1593486029,
 "objectDesc": "iLen: 2129\nbuffer: \"<TimelineObject><id><![CDATA[13367129656153944194]]></id><username><![CDATA[wxid_gia1nwcgpobz22]]></username><createTime><![CDATA[1593486029]]></createTime><contentDescShowType>0</contentDescShowType><contentDescScene>0</contentDescScene><private><![CDATA[0]]></private><contentDesc><![CDATA[\\346\\265\\213\\350\\257\\225\\345\\223\\210\\345\\223\\210\\345\\223\\210\\345\\223\\210]]></contentDesc><contentattr><![CDATA[0]]></contentattr><sourceUserName></sourceUserName><sourceNickName></sourceNickName><statisticsData></statisticsData><weappInfo><appUserName></appUserName><pagePath></pagePath><version><![CDATA[0]]></version><debugMode><![CDATA[0]]></debugMode><shareActionId></shareActionId><isGame><![CDATA[0]]></isGame><messageExtraData></messageExtraData><subType><![CDATA[0]]></subType></weappInfo><canvasInfoXml></canvasInfoXml><ContentObject><contentStyle><![CDATA[3]]></contentStyle><contentSubStyle><![CDATA[0]]></contentSubStyle><title><![CDATA[jr\\345\\212\\240\\347\\233\\237\\346\\271\\226\\344\\272\\272]]></title><description><![CDATA[ddd]]></description><contentUrl><![CDATA[https://mp.weixin.qq.com/s/cxJ7pLvkRwBV_NUfQxNEjA]]></contentUrl><mediaList><media><id><![CDATA[13367129656558694540]]></id><type><![CDATA[2]]></type><title></title><description></description><private><![CDATA[0]]></private><url type=\\'\\\\&quot;1\\\\&quot;\\'><![CDATA[http://dmjvip.oss-cn-shenzhen.aliyuncs.com/download/dailyimg/20200618155919206.jpg]]></url><thumb type=\\'\\\\&quot;1\\\\&quot;\\'><![CDATA[http://dmjvip.oss-cn-shenzhen.aliyuncs.com/download/dailyimg/20200618155919206.jpg]]></thumb><videoDuration><![CDATA[0.0]]></videoDuration><size height=\\'\\\\&quot;113.0\\\\&quot;\\' width=\\'\\\\&quot;150.0\\\\&quot;\\' totalSize=\\'\\\\&quot;24051.0\\\\&quot;\\'></size></media></mediaList></ContentObject><actionInfo><appMsg><mediaTagName></mediaTagName><messageExt></messageExt><messageAction></messageAction></appMsg></actionInfo><statExtStr></statExtStr><appInfo><id></id></appInfo><location poiClassifyId=\\\"\\\" poiName=\\\"\\\" poiAddress=\\\"\\\" poiClassifyType=\\\"0\\\" city=\\\"\\\"></location><publicUserName></publicUserName><streamvideo><streamvideourl></streamvideourl><streamvideothumburl></streamvideothumburl><streamvideoweburl></streamvideoweburl></streamvideo><showFlag></showFlag></TimelineObject>\"\n"
 }
 }
}

错误响应

json
{
 "message": "失败",
 "code": "1001",
 "data": null
}

使用建议

  • 链接朋友圈适合文章、活动页和落地页分享;普通短文建议使用文字朋友圈。
  • thumbUrl 建议使用稳定 CDN,避免朋友圈卡片封面展示失败。
  • 发布前建议先验证链接标题、描述、封面在微信端的展示效果。