C# Class Senparc.Weixin.QY.AdvancedAPIs.MediaApi

多媒体文件接口
Mostrar archivo Open project: JeffreySu/WeiXinMPSDK

Public Methods

Method Description
AddMaterial ( string accessToken, UploadMediaFileType type, int agentId, string media, int timeOut = Config.TIME_OUT ) : UploadForeverResultJson

上传其他类型永久素材

AddMaterialAsync ( string accessToken, UploadMediaFileType type, int agentId, string media, int timeOut = Config.TIME_OUT ) : Task

【异步方法】上传其他类型永久素材

AddMpNews ( string accessToken, int agentId, int timeOut = Config.TIME_OUT ) : UploadForeverResultJson

上传永久图文素材

AddMpNewsAsync ( string accessToken, int agentId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】上传永久图文素材

BatchGetMaterial ( string accessToken, UploadMediaFileType type, int agentId, int offset, int count, int timeOut = Config.TIME_OUT ) : BatchGetMaterialResult

获取素材列表

BatchGetMaterialAsync ( string accessToken, UploadMediaFileType type, int agentId, int offset, int count, int timeOut = Config.TIME_OUT ) : Task

【异步方法】获取素材列表

DeleteForeverMaterial ( string accessToken, int agentId, string mediaId ) : QyJsonResult

删除永久素材

DeleteForeverMaterialAsync ( string accessToken, int agentId, string mediaId ) : Task

【异步方法】删除永久素材

Get ( string accessToken, string mediaId, string dir ) : string

获取临时媒体文件并保存到指定目录中

Get ( string accessToken, string mediaId, Stream stream ) : void

获取临时媒体文件

GetAsync ( string accessToken, string mediaId, Stream stream ) : System.Threading.Tasks.Task

【异步方法】获取临时媒体文件

GetCount ( string accessToken, int agentId ) : GetCountResult

获取素材总数

GetCountAsync ( string accessToken, int agentId ) : Task

【异步方法】获取素材总数

GetForeverMaterial ( string accessToken, int agentId, string mediaId, Stream stream ) : void

获取临时媒体文件

GetForeverMaterialAsync ( string accessToken, int agentId, string mediaId, Stream stream ) : System.Threading.Tasks.Task

【异步方法】获取临时媒体文件

GetForeverMpNews ( string accessToken, int agentId, string mediaId ) : GetForeverMpNewsResult

获取永久图文素材

GetForeverMpNewsAsync ( string accessToken, int agentId, string mediaId ) : Task

【异步方法】获取永久图文素材

UpdateMpNews ( string accessToken, string mediaId, int agentId, int timeOut = Config.TIME_OUT ) : UploadForeverResultJson

修改永久图文素材

UpdateMpNewsAsync ( string accessToken, string mediaId, int agentId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】修改永久图文素材

Upload ( string accessToken, UploadMediaFileType type, string media, int timeOut = Config.TIME_OUT ) : UploadTemporaryResultJson

上传临时媒体文件

UploadAsync ( string accessToken, UploadMediaFileType type, string media, int timeOut = Config.TIME_OUT ) : Task

【异步方法】上传临时媒体文件

UploadimgMedia ( string accessToken, string media, int timeOut = Config.TIME_OUT ) : UploadimgMediaResult

上传图文消息内的图片

UploadimgMediaAsync ( string accessToken, string media, int timeOut = Config.TIME_OUT ) : Task

【异步方法】上传图文消息内的图片

Method Details

AddMaterial() public static method

上传其他类型永久素材
public static AddMaterial ( string accessToken, UploadMediaFileType type, int agentId, string media, int timeOut = Config.TIME_OUT ) : UploadForeverResultJson
accessToken string
type UploadMediaFileType
agentId int
media string
timeOut int
return Senparc.Weixin.QY.AdvancedAPIs.Media.UploadForeverResultJson

AddMaterialAsync() public static method

【异步方法】上传其他类型永久素材
public static AddMaterialAsync ( string accessToken, UploadMediaFileType type, int agentId, string media, int timeOut = Config.TIME_OUT ) : Task
accessToken string
type UploadMediaFileType
agentId int
media string
timeOut int
return Task

AddMpNews() public static method

上传永久图文素材
public static AddMpNews ( string accessToken, int agentId, int timeOut = Config.TIME_OUT ) : UploadForeverResultJson
accessToken string
agentId int
timeOut int
return Senparc.Weixin.QY.AdvancedAPIs.Media.UploadForeverResultJson

AddMpNewsAsync() public static method

【异步方法】上传永久图文素材
public static AddMpNewsAsync ( string accessToken, int agentId, int timeOut = Config.TIME_OUT ) : Task
accessToken string
agentId int
timeOut int
return Task

BatchGetMaterial() public static method

获取素材列表
public static BatchGetMaterial ( string accessToken, UploadMediaFileType type, int agentId, int offset, int count, int timeOut = Config.TIME_OUT ) : BatchGetMaterialResult
accessToken string
type UploadMediaFileType
agentId int
offset int
count int
timeOut int
return Senparc.Weixin.QY.AdvancedAPIs.Media.BatchGetMaterialResult

BatchGetMaterialAsync() public static method

【异步方法】获取素材列表
public static BatchGetMaterialAsync ( string accessToken, UploadMediaFileType type, int agentId, int offset, int count, int timeOut = Config.TIME_OUT ) : Task
accessToken string
type UploadMediaFileType
agentId int
offset int
count int
timeOut int
return Task

DeleteForeverMaterial() public static method

删除永久素材
public static DeleteForeverMaterial ( string accessToken, int agentId, string mediaId ) : QyJsonResult
accessToken string
agentId int
mediaId string
return Senparc.Weixin.Entities.QyJsonResult

DeleteForeverMaterialAsync() public static method

【异步方法】删除永久素材
public static DeleteForeverMaterialAsync ( string accessToken, int agentId, string mediaId ) : Task
accessToken string
agentId int
mediaId string
return Task

Get() public static method

获取临时媒体文件并保存到指定目录中
public static Get ( string accessToken, string mediaId, string dir ) : string
accessToken string
mediaId string
dir string 保存目录
return string

Get() public static method

获取临时媒体文件
public static Get ( string accessToken, string mediaId, Stream stream ) : void
accessToken string
mediaId string
stream System.IO.Stream
return void

GetAsync() public static method

【异步方法】获取临时媒体文件
public static GetAsync ( string accessToken, string mediaId, Stream stream ) : System.Threading.Tasks.Task
accessToken string
mediaId string
stream System.IO.Stream
return System.Threading.Tasks.Task

GetCount() public static method

获取素材总数
public static GetCount ( string accessToken, int agentId ) : GetCountResult
accessToken string
agentId int
return Senparc.Weixin.QY.AdvancedAPIs.Media.GetCountResult

GetCountAsync() public static method

【异步方法】获取素材总数
public static GetCountAsync ( string accessToken, int agentId ) : Task
accessToken string
agentId int
return Task

GetForeverMaterial() public static method

获取临时媒体文件
public static GetForeverMaterial ( string accessToken, int agentId, string mediaId, Stream stream ) : void
accessToken string
agentId int
mediaId string
stream System.IO.Stream
return void

GetForeverMaterialAsync() public static method

【异步方法】获取临时媒体文件
public static GetForeverMaterialAsync ( string accessToken, int agentId, string mediaId, Stream stream ) : System.Threading.Tasks.Task
accessToken string
agentId int
mediaId string
stream System.IO.Stream
return System.Threading.Tasks.Task

GetForeverMpNews() public static method

获取永久图文素材
public static GetForeverMpNews ( string accessToken, int agentId, string mediaId ) : GetForeverMpNewsResult
accessToken string
agentId int
mediaId string
return Senparc.Weixin.QY.AdvancedAPIs.Media.GetForeverMpNewsResult

GetForeverMpNewsAsync() public static method

【异步方法】获取永久图文素材
public static GetForeverMpNewsAsync ( string accessToken, int agentId, string mediaId ) : Task
accessToken string
agentId int
mediaId string
return Task

UpdateMpNews() public static method

修改永久图文素材
public static UpdateMpNews ( string accessToken, string mediaId, int agentId, int timeOut = Config.TIME_OUT ) : UploadForeverResultJson
accessToken string
mediaId string
agentId int
timeOut int
return Senparc.Weixin.QY.AdvancedAPIs.Media.UploadForeverResultJson

UpdateMpNewsAsync() public static method

【异步方法】修改永久图文素材
public static UpdateMpNewsAsync ( string accessToken, string mediaId, int agentId, int timeOut = Config.TIME_OUT ) : Task
accessToken string
mediaId string
agentId int
timeOut int
return Task

Upload() public static method

上传临时媒体文件
public static Upload ( string accessToken, UploadMediaFileType type, string media, int timeOut = Config.TIME_OUT ) : UploadTemporaryResultJson
accessToken string 调用接口凭证
type UploadMediaFileType 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)
media string form-data中媒体文件标识,有filename、filelength、content-type等信息
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.QY.AdvancedAPIs.Media.UploadTemporaryResultJson

UploadAsync() public static method

【异步方法】上传临时媒体文件
public static UploadAsync ( string accessToken, UploadMediaFileType type, string media, int timeOut = Config.TIME_OUT ) : Task
accessToken string 调用接口凭证
type UploadMediaFileType 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)
media string form-data中媒体文件标识,有filename、filelength、content-type等信息
timeOut int 代理请求超时时间(毫秒)
return Task

UploadimgMedia() public static method

上传图文消息内的图片
public static UploadimgMedia ( string accessToken, string media, int timeOut = Config.TIME_OUT ) : UploadimgMediaResult
accessToken string
media string
timeOut int
return Senparc.Weixin.QY.AdvancedAPIs.Media.UploadimgMediaResult

UploadimgMediaAsync() public static method

【异步方法】上传图文消息内的图片
public static UploadimgMediaAsync ( string accessToken, string media, int timeOut = Config.TIME_OUT ) : Task
accessToken string
media string
timeOut int
return Task