Beispiel #1
0
        // POST https://api.line.me/v2/bot/message/push
        // to a user, group, or room a
        public string PushMessage(string targetID, Message[] msgs, string channelAccessToken)
        {
            Models.PushMessage.Request body = new Models.PushMessage.Request();
            body.To = targetID;

            if (!is1To5(msgs))
            {
                throw new Exception("wrong length");
            }

            body.Messages = msgs;

            string data = JsonConvert.SerializeObject(body);

            return(WebRequestHelper.PostLineApi(LINE_URL + "/message/push", data, channelAccessToken));
        }
Beispiel #2
0
        // POST https://api.line.me/v2/bot/message/multicast
        // to multiple users
        public string MulticastMessage(string[] userIDs, Message[] msgs, string channelAccessToken)
        {
            Models.MulticastMessage.Request body = new Models.MulticastMessage.Request();
            body.To = userIDs;

            if (!is1To5(msgs))
            {
                throw new Exception("wrong length");
            }

            body.Messages = msgs;


            string data = JsonConvert.SerializeObject(body);

            return(WebRequestHelper.PostLineApi(LINE_URL + "/message/multicast", data, channelAccessToken));
        }