class DialMyCalls::CallsApi
Attributes
Public Class Methods
# File lib/dialmycalls_client/api/calls_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Cancel Call Cancel an outgoing call.
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/call/$CALL_ID “` @param call_id CallId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/calls_api.rb, line 39 def cancel_call_by_id(call_id, opts = {}) data, _status_code, _headers = cancel_call_by_id_with_http_info(call_id, opts) return data end
Cancel Call Cancel an outgoing call. <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/call/$CALL_ID ``` @param call_id CallId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/calls_api.rb, line 49 def cancel_call_by_id_with_http_info(call_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi.cancel_call_by_id ..." end # verify the required parameter 'call_id' is set fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.cancel_call_by_id" if call_id.nil? # resource path local_var_path = "/service/call/{CallId}".sub('{format}','json').sub('{' + 'CallId' + '}', call_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: CallsApi#cancel_call_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create Call Create an outgoing call broadcast.
Returns a call service object on success, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"name\": \"Test\", \"callerid_id\": \"8bc6748e-d8a0-11e4-8b2d-00163e603cea\", \"recording_id\": \"079ff28a-1b75-11e5-88eb-00163e603cea\", \"send_immediately\": true, \"use_amd\": true, \"contacts\": [{\"phone\":\"1116551235\"},{\"phone\":\"1116551234\"}]}" $API_KEY@api.dialmycalls.com/2.0/service/call “` @param create_call_parameters Request body @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/calls_api.rb, line 96 def create_call(create_call_parameters, opts = {}) data, _status_code, _headers = create_call_with_http_info(create_call_parameters, opts) return data end
Create Call Create an outgoing call broadcast. <br><br> Returns a call service object on success, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X POST -d "{\"name\": \"Test\", \"callerid_id\": \"8bc6748e-d8a0-11e4-8b2d-00163e603cea\", \"recording_id\": \"079ff28a-1b75-11e5-88eb-00163e603cea\", \"send_immediately\": true, \"use_amd\": true, \"contacts\": [{\"phone\":\"1116551235\"},{\"phone\":\"1116551234\"}]}" $API_KEY@api.dialmycalls.com/2.0/service/call ``` @param create_call_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/calls_api.rb, line 106 def create_call_with_http_info(create_call_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi.create_call ..." end # verify the required parameter 'create_call_parameters' is set fail ArgumentError, "Missing the required parameter 'create_call_parameters' when calling CallsApi.create_call" if create_call_parameters.nil? # resource path local_var_path = "/service/call".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_call_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: CallsApi#create_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Call Retrieve a call.
Returns a call 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/call/$CALL_ID “` @param call_id CallId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/calls_api.rb, line 153 def get_call_by_id(call_id, opts = {}) data, _status_code, _headers = get_call_by_id_with_http_info(call_id, opts) return data end
Get Call Retrieve a call. <br><br> Returns a call 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/call/$CALL_ID ``` @param call_id CallId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/calls_api.rb, line 163 def get_call_by_id_with_http_info(call_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi.get_call_by_id ..." end # verify the required parameter 'call_id' is set fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.get_call_by_id" if call_id.nil? # resource path local_var_path = "/service/call/{CallId}".sub('{format}','json').sub('{' + 'CallId' + '}', call_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: CallsApi#get_call_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Call Recipients Retrieve a list of a call's recipients.
Returns a list of call 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/call/$CALL_ID/recipients “` @param call_id CallId @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/calls_api.rb, line 211 def get_call_recipients_by_call_id(call_id, opts = {}) data, _status_code, _headers = get_call_recipients_by_call_id_with_http_info(call_id, opts) return data end
Get Call Recipients Retrieve a list of a call's recipients. <br><br> Returns a list of call 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/call/$CALL_ID/recipients ``` @param call_id CallId @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/calls_api.rb, line 222 def get_call_recipients_by_call_id_with_http_info(call_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi.get_call_recipients_by_call_id ..." end # verify the required parameter 'call_id' is set fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.get_call_recipients_by_call_id" if call_id.nil? # resource path local_var_path = "/service/call/{CallId}/recipients".sub('{format}','json').sub('{' + 'CallId' + '}', call_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: CallsApi#get_call_recipients_by_call_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Calls Retrieve a list of calls.
Returns a list of call service objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/calls “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of calls requested @return [Object]
# File lib/dialmycalls_client/api/calls_api.rb, line 270 def get_calls(opts = {}) data, _status_code, _headers = get_calls_with_http_info(opts) return data end
List Calls Retrieve a list of calls. <br><br> Returns a list of call service objects. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/service/calls ``` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of calls requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/calls_api.rb, line 280 def get_calls_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi.get_calls ..." end # resource path local_var_path = "/service/calls".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: CallsApi#get_calls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end