Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Add many phones to address book
 /// </summary>
 /// <param name="addressbookId">Address book to add phone to</param>
 /// <param name="phone">Phone object to add</param>
 /// <param name="phones">Additional phone object to add</param>
 /// <returns></returns>
 public bool CreatePhonesInAddressbook(int addressbookId, Phone phone, params Phone[] phones)
 {
     return(Run("addPhoneToAddressBook")
            .WithParameter("idAddressBook", addressbookId)
            .WithParameter("data", AtomParkUtils.PhonesToJson(phone, phones))
            .Execute()
            .To <SuccessResultImpl>(CheckForError)
            .result.successful);
 }
Ejemplo n.º 3
0
 private static JToken ConvertAtomParkArrayedResult(JToken input)
 {
     return(AtomParkUtils.ConvertArrayedResult(input, CheckForError));
 }
Ejemplo n.º 4
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);
 }