class DialMyCalls::TextsApi
Attributes
Public Class Methods
# File lib/dialmycalls_client/api/texts_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Cancel Text Cancel an outgoing text.
Returns the following if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X DELETE $API_KEY@api.dialmycalls.com/2.0/service/text/$TEXT_ID “` @param text_id TextId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 39 def cancel_text_by_id(text_id, opts = {}) data, _status_code, _headers = cancel_text_by_id_with_http_info(text_id, opts) return data end
Cancel Text Cancel an outgoing text. <br><br> Returns the following if a valid identifier was provided, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X DELETE $API_KEY@api.dialmycalls.com/2.0/service/text/$TEXT_ID ``` @param text_id TextId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 49 def cancel_text_by_id_with_http_info(text_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.cancel_text_by_id ..." end # verify the required parameter 'text_id' is set fail ArgumentError, "Missing the required parameter 'text_id' when calling TextsApi.cancel_text_by_id" if text_id.nil? # resource path local_var_path = "/service/text/{TextId}".sub('{format}','json').sub('{' + 'TextId' + '}', text_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#cancel_text_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create Text Create an outgoing text broadcast.
Returns a service object on success, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"keyword_id\": \"dfe49537-a0a8-4f4a-98a1-e03df388af11\", \"send_immediately\": true,\"messages\": [\"Testing testing\"], \"contacts\": [{\"phone\":\"1116551235\"},{\"phone\":\"1116551234\"}]}" $API_KEY@api.dialmycalls.com/2.0/service/text “` @param create_text_parameters Request body @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 96 def create_text(create_text_parameters, opts = {}) data, _status_code, _headers = create_text_with_http_info(create_text_parameters, opts) return data end
Create Text Create an outgoing text broadcast. <br><br> Returns a service object on success, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X POST -d "{\"keyword_id\": \"dfe49537-a0a8-4f4a-98a1-e03df388af11\", \"send_immediately\": true,\"messages\": [\"Testing testing\"], \"contacts\": [{\"phone\":\"1116551235\"},{\"phone\":\"1116551234\"}]}" $API_KEY@api.dialmycalls.com/2.0/service/text ``` @param create_text_parameters Request body @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 106 def create_text_with_http_info(create_text_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.create_text ..." end # verify the required parameter 'create_text_parameters' is set fail ArgumentError, "Missing the required parameter 'create_text_parameters' when calling TextsApi.create_text" if create_text_parameters.nil? # resource path local_var_path = "/service/text".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_text_parameters) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#create_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete Incoming Text Delete a incoming text.
Returns the following if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X DELETE $API_KEY@api.dialmycalls.com/2.0/incoming/text/$TEXT_ID “` @param text_id TextId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 153 def delete_incoming_text_by_id(text_id, opts = {}) data, _status_code, _headers = delete_incoming_text_by_id_with_http_info(text_id, opts) return data end
Delete Incoming Text Delete a incoming text. <br><br> Returns the following if a valid identifier was provided, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X DELETE $API_KEY@api.dialmycalls.com/2.0/incoming/text/$TEXT_ID ``` @param text_id TextId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 163 def delete_incoming_text_by_id_with_http_info(text_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.delete_incoming_text_by_id ..." end # verify the required parameter 'text_id' is set fail ArgumentError, "Missing the required parameter 'text_id' when calling TextsApi.delete_incoming_text_by_id" if text_id.nil? # resource path local_var_path = "/incoming/text/{TextId}".sub('{format}','json').sub('{' + 'TextId' + '}', text_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#delete_incoming_text_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Incoming Text Retrieve a text.
Returns a Incoming Text object if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/incoming/text/$TEXT_ID “` @param text_id TextId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 210 def get_incoming_text_by_id(text_id, opts = {}) data, _status_code, _headers = get_incoming_text_by_id_with_http_info(text_id, opts) return data end
Get Incoming Text Retrieve a text. <br><br> Returns a Incoming Text object if a valid identifier was provided, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/incoming/text/$TEXT_ID ``` @param text_id TextId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 220 def get_incoming_text_by_id_with_http_info(text_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.get_incoming_text_by_id ..." end # verify the required parameter 'text_id' is set fail ArgumentError, "Missing the required parameter 'text_id' when calling TextsApi.get_incoming_text_by_id" if text_id.nil? # resource path local_var_path = "/incoming/text/{TextId}".sub('{format}','json').sub('{' + 'TextId' + '}', text_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#get_incoming_text_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Incoming Texts Retrieve a list of texts.
Returns a list of Incoming Text objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/incoming/texts “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of texts requested @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 267 def get_incoming_texts(opts = {}) data, _status_code, _headers = get_incoming_texts_with_http_info(opts) return data end
List Incoming Texts Retrieve a list of texts. <br><br> Returns a list of Incoming Text objects. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/incoming/texts ``` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of texts requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 277 def get_incoming_texts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.get_incoming_texts ..." end # resource path local_var_path = "/incoming/texts".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) header_params[:'Range'] = opts[:'range'] if !opts[:'range'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#get_incoming_texts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Shortcodes Retrieve a list of shortcodes.
Returns a list of shortcode objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/shortcodes “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of shortcodes requested @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 323 def get_short_codes(opts = {}) data, _status_code, _headers = get_short_codes_with_http_info(opts) return data end
List Shortcodes Retrieve a list of shortcodes. <br><br> Returns a list of shortcode objects. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/shortcodes ``` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of shortcodes requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 333 def get_short_codes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.get_short_codes ..." end # resource path local_var_path = "/shortcodes".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) header_params[:'Range'] = opts[:'range'] if !opts[:'range'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#get_short_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Text Retrieve a text.
Returns a service object if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/text/$TEXT_ID “` @param text_id TextId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 379 def get_text_by_id(text_id, opts = {}) data, _status_code, _headers = get_text_by_id_with_http_info(text_id, opts) return data end
Get Text Retrieve a text. <br><br> Returns a service object if a valid identifier was provided, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/text/$TEXT_ID ``` @param text_id TextId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 389 def get_text_by_id_with_http_info(text_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.get_text_by_id ..." end # verify the required parameter 'text_id' is set fail ArgumentError, "Missing the required parameter 'text_id' when calling TextsApi.get_text_by_id" if text_id.nil? # resource path local_var_path = "/service/text/{TextId}".sub('{format}','json').sub('{' + 'TextId' + '}', text_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#get_text_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Text Recipients Retrieve a list of a text's recipients.
Returns a list of text recipient objects if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/text/$TEXT_ID/recipients “` @param text_id TextId @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of recipients requested @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 437 def get_text_recipients_by_text_id(text_id, opts = {}) data, _status_code, _headers = get_text_recipients_by_text_id_with_http_info(text_id, opts) return data end
Get Text Recipients Retrieve a list of a text's recipients. <br><br> Returns a list of text recipient objects if a valid identifier was provided, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/text/$TEXT_ID/recipients ``` @param text_id TextId @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of recipients requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 448 def get_text_recipients_by_text_id_with_http_info(text_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.get_text_recipients_by_text_id ..." end # verify the required parameter 'text_id' is set fail ArgumentError, "Missing the required parameter 'text_id' when calling TextsApi.get_text_recipients_by_text_id" if text_id.nil? # resource path local_var_path = "/service/text/{TextId}/recipients".sub('{format}','json').sub('{' + 'TextId' + '}', text_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) header_params[:'Range'] = opts[:'range'] if !opts[:'range'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#get_text_recipients_by_text_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Texts Retrieve a list of texts.
Returns a list of service objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/texts “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of texts requested @return [Object]
# File lib/dialmycalls_client/api/texts_api.rb, line 496 def get_texts(opts = {}) data, _status_code, _headers = get_texts_with_http_info(opts) return data end
List Texts Retrieve a list of texts. <br><br> Returns a list of service objects. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/texts ``` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of texts requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/texts_api.rb, line 506 def get_texts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: TextsApi.get_texts ..." end # resource path local_var_path = "/service/texts".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json', 'application/xml'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'application/xml'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) header_params[:'Range'] = opts[:'range'] if !opts[:'range'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: TextsApi#get_texts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end