示例#1
0
        /// <summary>
        /// Gets sms messages.
        /// </summary>
        /// <param name="filter">The rest api query string result filter.</param>
        /// <returns>Task</returns>
        public async Task <Response.SMS> getSms(string filter = "")
        {
            HttpResponseMessage response = await Request("sms", null, filter);

            Response.SMS sms = new Response.SMS();

            if ((int)response.StatusCode == 200)
            {
                sms = await response.Content.ReadAsAsync <Response.SMS>();
            }

            sms.statuscode    = (int)response.StatusCode;
            sms.statusmessage = response.ReasonPhrase;
            return(sms);
        }
示例#2
0
        /// <summary>
        /// Sends an sms message.
        /// </summary>
        /// <returns>Task</returns>
        public async Task <Response.SMS> sendSms(Object payload)
        {
            HttpResponseMessage response = await Request("sms", payload);

            Response.SMS sms = new Response.SMS();

            if ((int)response.StatusCode == 200)
            {
                sms = await response.Content.ReadAsAsync <Response.SMS>();
            }

            sms.statuscode    = (int)response.StatusCode;
            sms.statusmessage = response.ReasonPhrase;
            return(sms);
        }