예제 #1
0
 /// <summary>
 /// Calculate price for sending sms to the custom list of phones
 /// </summary>
 /// <param name="message">Message information object</param>
 /// <param name="phone">First custom phone</param>
 /// <param name="phones">Optional custom phones</param>
 /// <returns>Price information</returns>
 public ISendPrice SendSmsBatchEstimate(MessageInfo message, Phone phone, params Phone[] phones)
 {
     return
         (message.FillCommand(Run("checkCampaignPriceGroup").WithParameter("phones", AtomParkUtils.PhonesToJson(phone, phones)))
          .Execute()
          .To <ResponseImpl <ISendPrice, SendPriceImpl> >(CheckForError)
          .result);
 }
예제 #2
0
 /// <summary>
 /// Send sms to the custom list of phones
 /// </summary>
 /// <param name="message">Message information object</param>
 /// <param name="phone">First custom phone</param>
 /// <param name="phones">Optional custom phones</param>
 /// <returns>New campaign information with id and price</returns>
 public ISendResult SendSmsBatch(MessageInfo message, Phone phone, params Phone[] phones)
 {
     return
         (message.FillCommand(Run("sendsmsgroup").WithParameter("phones", AtomParkUtils.PhonesToJson(phone, phones)))
          .Execute()
          .To <ResponseImpl <ISendResult, SendResultImpl> >(CheckForError)
          .result);
 }
예제 #3
0
 /// <summary>
 /// Calculate price for sending sms to the list of phones from address book
 /// </summary>
 /// <param name="addressbookId">Id for the address book to send to</param>
 /// <param name="message">Message information object</param>
 /// <returns>Price information</returns>
 public ISendResult SendSmsBatchEstimate(int addressbookId, MessageInfo message)
 {
     return
         (message.FillCommand(Run("checkCampaignPrice").WithParameter("list_id", addressbookId))
          .Execute()
          .To <ResponseImpl <ISendResult, SendResultImpl> >(CheckForError)
          .result);
 }
예제 #4
0
 /// <summary>
 /// Create a campaign only with one sms to send
 /// </summary>
 /// <param name="phoneNumber">Number for sms receiver</param>
 /// <param name="message">Message information object</param>
 /// <returns>New campaign information with id and price</returns>
 public ISendResult SendSms(string phoneNumber, MessageInfo message)
 {
     return
         (message.FillCommand(Run("sendSMS").WithParameter("phone", phoneNumber))
          .Execute()
          .To <ResponseImpl <ISendResult, SendResultImpl> >(CheckForError)
          .result);
 }
예제 #5
0
 /// <summary>
 /// Send sms to the list of phones from address book
 /// </summary>
 /// <param name="addressbookId">Id for the address book to send to</param>
 /// <param name="message">Message information object</param>
 /// <param name="watchdogPhoneNumber">Phone number to control the campaign send-out</param>
 /// <param name="portionSize">The count of sms to send at a time. Use this parameter if you would like to send sms by portions</param>
 /// <param name="portionInterval">Interval between portions in seconds</param>
 /// <returns>New campaign information with id and price</returns>
 public ISendResult SendSmsBatch(int addressbookId, MessageInfo message, string watchdogPhoneNumber = null,
                                 uint portionSize = 0, uint portionInterval = 0)
 {
     return
         (message.FillCommand(Run("createCampaign")
                              .WithParameter("list_id", addressbookId)
                              .WithParameter("batch", portionSize)
                              .WithParameter("batchinterval", portionInterval)
                              .WithParameterIfNotNull("control_phone", watchdogPhoneNumber))
          .Execute()
          .To <ResponseImpl <ISendResult, SendResultImpl> >(CheckForError)
          .result);
 }