Ejemplo n.º 1
0
        /// <summary>
        /// List of received SMS Premium
        /// </summary>
        /// <returns>
        /// array
        ///  array "items"
        ///  int "id"
        ///  string "to_number" Premium number
        ///  string "from_number" Sender phone number
        ///  string "date"
        ///  int "limit" Limitation the number of responses
        ///  string "text" Message
        /// </returns>
        public async Task <string> IndexAsync()
        {
            var data     = new Dictionary <string, string>();
            var response = await _srv.CallAsync("premium/index", data);

            return(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Adding new template
        /// </summary>
        /// <param name="name">string name</param>
        /// <param name="text">string text</param>
        /// <returns>
        ///  bool "success"
        ///  int "id"
        /// </returns>
        public async Task <string> AddAsync(string name, string text)
        {
            var data     = new Dictionary <string, string>();
            var response = await _srv.CallAsync("templates/add", data);

            return(response);
        }
Ejemplo n.º 3
0
 /// <summary>
 ///  Sending messages
 /// </summary>
 /// <param name="phone">The phone.</param>
 /// <param name="text">The text.</param>
 /// <param name="sender">The sender.</param>
 /// <param name="data">
 /// String "details" Show details of messages,
 /// String "utf" Change encoding to UTF-8 (Only for FULL SMS),
 /// String "flash",
 /// String "speed" Priority canal only for FULL SMS,
 /// String "test" Test mode,
 /// String "vcard" vCard message,
 /// String "wap_push" WAP Push URL address,
 /// String "date" Set the date of sending,
 /// String "group_id" Sending to the group instead of a phone number,
 /// String "contact_id" Sending to phone from contacts,
 /// String "unique_id" Own identifiers of messages
 /// </param>
 /// <returns>
 ///  Boolean "success"
 ///  int "queued" Number of queued messages
 ///  int "unsent" Number of unsent messages
 ///  array "items"
 ///  String "id"
 ///  String "phone"
 ///  String "status" - queued|unsent
 ///  String "queued" Date of enqueued
 ///  int "parts" Number of parts a message
 ///  int "error_code"
 ///  String "error_message"
 ///  String "text"
 /// </returns>
 public async Task <string> SendSmsAsync(string phone, string text, string sender = null, Dictionary <string, string> data = null)
 {
     data = data ?? new Dictionary <string, string>();
     data.Add("phone", phone);
     data.Add("text", text);
     data.Add("sender", sender);
     return(await _srv.CallAsync("messages/send_sms", data));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creating new Sender name
        /// </summary>
        /// <param name="name">string name</param>
        /// <returns>Boolean "success"</returns>
        public async Task <string> AddSendAsync(string name)
        {
            var data = new Dictionary <string, string>
            {
                { "name", name }
            };
            var response = await _srv.CallAsync("senders/add", data);

            return(response);
        }
        /// <summary>
        /// Creating new subaccount
        /// </summary>
        /// <param name="subaccount_username">string</param>
        /// <param name="subaccount_password">string</param>
        /// <param name="subaccount_id">int</param>
        /// <param name="data">
        ///  string "name",
        ///  string "phone",
        ///  string "email"
        /// </param>
        /// <returns>
        /// type
        // </returns>
        public async Task <string> AddAsync(string subaccount_username, string subaccount_password, string subaccount_id, Dictionary <string, string> data = null)
        {
            data = data ?? new Dictionary <string, string>();
            data.Add("subaccount_username", subaccount_username);
            data.Add("subaccount_password", subaccount_password);
            data.Add("subaccount_id", subaccount_id);
            var response = await _srv.CallAsync("subaccounts/add", data);

            return(response);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Checking phone in to HLR
        /// </summary>
        /// <param name="phone">string phone</param>
        /// <param name="id">string id</param>
        /// <returns>
        /// array
        /// String "phone"
        /// String "status"
        /// int "imsi"
        /// String "network"
        /// bool "ported"
        /// String "network_ported"
        /// </returns>
        public Task <string> CheckAsync(string phone, string id = null)
        {
            var data = new Dictionary <string, string>
            {
                { "phone", phone },
                { "id", id }
            };

            return(_srv.CallAsync("phones/check", data));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Statistics an sending
        /// </summary>
        /// <param name="data">
        ///  String "type" eco|full|voice|mms,
        ///  String "begin" Start date,
        ///  String "end" End date
        /// </param>
        /// <returns>
        ///   array "items",
        ///    int "id",
        ///    String "name",
        ///    int "delivered",
        ///    int "pending",
        ///    int "undelivered",
        ///    int "unsent",
        ///    String "begin",
        ///    String "end",
        ///    String "text",
        ///    String "type" eco|full|voice|mms
        /// </returns>
        public async Task <string> IndexAsync(Dictionary <string, string> data = null)
        {
            data = data ?? new Dictionary <string, string>();
            var response = await _srv.CallAsync("stats/index", data);

            return(response);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Adds the specified group identifier.
 /// </summary>
 /// <param name="group_id">The group identifier.</param>
 /// <param name="phone">The phone.</param>
 /// <param name="data">The data:
 ///       string "email"
 ///       string "first_name"
 ///       string "last_name"
 ///       string "company"
 ///       string "tax_id"
 ///       string "address"
 ///       string "city"
 ///       string "description"
 /// </param>
 /// <returns>
 /// bool "success"
 /// int "id"
 /// </returns>
 public async Task <string> AddAsync(string group_id, string phone, Dictionary <string, string> data = null)
 {
     data = data ?? new Dictionary <string, string>();
     data.Add("phone", phone);
     data.Add("group_id", group_id);
     return(await _srv.CallAsync("contacts/add", data));
 }
Ejemplo n.º 9
0
        /// <summary>Add new group</summary>
        /// <param name="name">string name</param>
        /// <returns>
        ///   array
        ///    bool "success"
        ///    int "id"
        /// </returns>
        public async Task <string> AddAsync(string name)
        {
            var data = new Dictionary <string, string> {
                { "name", name }
            };

            return(await _srv.CallAsync("groups/add", data));
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Adds the specified type.
 /// </summary>
 /// <param name="type">The type</param>
 /// <param name="data">The data</param>
 /// <returns>
 /// Boolean "success"
 /// String "id"
 /// </returns>
 public async Task <string> AddAsync(string type, Dictionary <string, string> data = null)
 {
     data = data ?? new Dictionary <string, string>();
     data.Add("type", type);
     return(await _srv.CallAsync("files/add", data));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Register new account
 /// </summary>
 /// <param name="data">
 /// string "phone"
 /// string "email"
 /// string "first_name"
 /// string "last_name"
 /// string "company"</param>
 /// <returns>bool "success"</returns>
 public async Task <string> AddAsync(Dictionary <string, string> data)
 {
     return(await _srv.CallAsync("account/add", data));
 }
Ejemplo n.º 12
0
        /// <summary>
        /// List of payments
        /// </summary>
        /// <returns>
        ///  int "id"
        ///  string "number"
        ///  string "state" paid|not_paid
        ///  float "paid"
        ///  float "total"
        ///  string "payment_to"
        ///  string "url"
        ///  </returns>
        public async Task <string> IndexAsync()
        {
            var data = new Dictionary <string, string>();

            return(await _srv.CallAsync("payments/index", data));
        }
        /// <summary>
        /// Add phone to the blacklist
        /// </summary>
        /// <param name="phone">The phone.</param>
        /// <returns>
        /// bool "success"
        /// int "id"
        /// </returns>
        public async Task <string> AddAsync(string phone)
        {
            var data = new Dictionary <string, string>();

            return(await _srv.CallAsync("blacklist/add", data));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Preview error
        /// </summary>
        /// <param name="code">int code</param>
        /// <returns>
        /// array
        ///      int "code"
        ///      String "type"
        ///      String "message"
        /// </returns>
        public async Task <string> ViewAsync(string code)
        {
            var data = new Dictionary <string, string>();

            return(await _srv.CallAsync("contacts/" + code, data));
        }