Senparc.Weixin.Work.AdvancedAPIs.KFApi.SendVoice C# (CSharp) Method

SendVoice() public static method

发送语音信息
public static SendVoice ( string accessToken, KF_User_Type senderType, string senderId, KF_User_Type receiverType, string receiverId, string mediaId, int timeOut = Config.TIME_OUT ) : QyJsonResult
accessToken string 调用接口凭证
senderType KF_User_Type 发送人类型
senderId string 发送人标志
receiverType KF_User_Type 接收人类型
receiverId string 接收人标志
mediaId string 语音的mediaId
timeOut int 代理请求超时时间(毫秒)
return Senparc.Weixin.Entities.QyJsonResult
        public static QyJsonResult SendVoice(string accessToken, KF_User_Type senderType, string senderId, KF_User_Type receiverType,
            string receiverId, string mediaId, int timeOut = Config.TIME_OUT)
        {
            var data = new
            {
                sender = new
                {
                    type = senderType.ToString(),
                    id = senderId
                },
                receiver = new
                {
                    type = receiverType.ToString(),
                    id = receiverId
                },
                msgtype = "voice",
                voice = new
                {
                    media_id = mediaId
                }
            };
            return CommonJsonSend.Send<QyJsonResult>(accessToken, URL_FORMAT, data, CommonJsonSendType.POST, timeOut);
        }