예제 #1
0
        /// <summary>
        /// Send a SMS message.
        /// </summary>
        /// <param name="request">The SMS message request</param>
        /// <param name="creds">(Optional) Overridden credentials for only this request</param>
        /// <exception cref="VonageSmsResponseException">Thrown when the status of a message is non-zero or response is empty</exception>
        /// <returns></returns>
        public async Task <SendSmsResponse> SendAnSmsAsync(SendSmsRequest request, Credentials creds = null)
        {
            var result = await ApiRequest.DoPostRequestUrlContentFromObjectAsync <SendSmsResponse>(
                ApiRequest.GetBaseUri(ApiRequest.UriType.Rest, "/sms/json"),
                request,
                creds ?? Credentials
                );

            ValidSmsResponse(result);
            return(result);
        }
예제 #2
0
 public SendSmsResponse SendAnSms(SendSmsRequest request, Credentials creds = null)
 {
     return(SendAnSmsAsync(request, creds).GetAwaiter().GetResult());
 }