public class WxMpDraftServiceImpl extends Object implements WxMpDraftService
| 构造器和说明 |
|---|
WxMpDraftServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
addDraft(String title,
String content,
String thumbMediaId)
新建草稿 - 只有默认必填参数
请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/add?
|
String |
addDraft(WxMpAddDraft addDraft)
新建草稿 - 完整参数
请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/add?
|
Long |
countDraft()
获取草稿数量
开发者可以根据本接口来获取草稿的总数。
|
Boolean |
delDraft(String mediaId)
删除草稿
正常情况下调用成功时,errcode将为0。
|
WxMpDraftInfo |
getDraft(String mediaId)
获取草稿信息
请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/get?
|
WxMpDraftList |
listDraft(int offset,
int count)
获取草稿列表
请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/batchget?
|
WxMpDraftList |
listDraft(int offset,
int count,
int noContent)
获取草稿列表
请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/batchget?
|
Boolean |
updateDraft(WxMpUpdateDraft updateDraftInfo)
修改草稿 - 完整参数
正常情况下调用成功时,errcode将为0。
|
public String addDraft(String title, String content, String thumbMediaId) throws WxErrorException
WxMpDraftService请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/add?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Add_draft.html
addDraft 在接口中 WxMpDraftServicetitle - 标题content - 图文消息的具体内容,支持HTML标签,必须少于2万字符,小于1M,且此处会去除JS,涉及图片url必须来源 "上传图文消息内的图片获取URL"接口获取。外部图片url将被过滤。thumbMediaId - 图文消息的封面图片素材id(必须是永久MediaID)WxErrorException - .public String addDraft(WxMpAddDraft addDraft) throws WxErrorException
WxMpDraftService请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/add?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Add_draft.html
addDraft 在接口中 WxMpDraftServiceaddDraft - 新建草稿信息WxErrorException - .public Boolean updateDraft(WxMpUpdateDraft updateDraftInfo) throws WxErrorException
WxMpDraftService请求地址: POST https://api.weixin.qq.com/cgi-bin/draft/update?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Update_draft.html
updateDraft 在接口中 WxMpDraftServiceupdateDraftInfo - 修改草稿信息WxErrorException - .public WxMpDraftInfo getDraft(String mediaId) throws WxErrorException
WxMpDraftService请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/get?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Get_draft.html
getDraft 在接口中 WxMpDraftServicemediaId - 要获取的草稿的media_idWxErrorException - .public Boolean delDraft(String mediaId) throws WxErrorException
WxMpDraftService请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/delete?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Delete_draft.html
delDraft 在接口中 WxMpDraftServicemediaId - 要删除的草稿的media_idWxErrorException - .public WxMpDraftList listDraft(int offset, int count, int noContent) throws WxErrorException
WxMpDraftService请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/batchget?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Get_draft_list.html
listDraft 在接口中 WxMpDraftServiceoffset - 分页页数,从0开始 从全部素材的该偏移位置开始返回,0表示从第一个素材返回count - 每页数量 返回素材的数量,取值在1到20之间noContent - 1 表示不返回 content 字段,0 表示正常返回,默认为 0WxErrorException - .public WxMpDraftList listDraft(int offset, int count) throws WxErrorException
WxMpDraftService请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/batchget?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Get_draft_list.html
listDraft 在接口中 WxMpDraftServiceoffset - 分页页数,从0开始 从全部素材的该偏移位置开始返回,0表示从第一个素材返回count - 每页数量 返回素材的数量,取值在1到20之间WxErrorExceptionpublic Long countDraft() throws WxErrorException
WxMpDraftService请求地址:POST https://api.weixin.qq.com/cgi-bin/draft/count?access_token=ACCESS_TOKEN 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Count_drafts.html
countDraft 在接口中 WxMpDraftServiceWxErrorException - .Copyright © 2022. All rights reserved.