class DialMyCalls::CallsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# 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_by_id(call_id, opts = {}) click to toggle source

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_by_id_with_http_info(call_id, opts = {}) click to toggle source

Cancel Call Cancel an outgoing call. &lt;br&gt;&lt;br&gt; Returns the following if a valid identifier was provided, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X DELETE $API_KEY@api.dialmycalls.com/2.0/service/call/$CALL_ID &#x60;&#x60;&#x60; @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_call_parameters, opts = {}) click to toggle source

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_with_http_info(create_call_parameters, opts = {}) click to toggle source

Create Call Create an outgoing call broadcast. &lt;br&gt;&lt;br&gt; Returns a call service object on success, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X POST -d "{\&quot;name\&quot;: \&quot;Test\&quot;, \&quot;callerid_id\&quot;: \&quot;8bc6748e-d8a0-11e4-8b2d-00163e603cea\&quot;, \&quot;recording_id\&quot;: \&quot;079ff28a-1b75-11e5-88eb-00163e603cea\&quot;, \&quot;send_immediately\&quot;: true, \&quot;use_amd\&quot;: true, \&quot;contacts\&quot;: [{\&quot;phone\&quot;:\&quot;1116551235\&quot;},{\&quot;phone\&quot;:\&quot;1116551234\&quot;}]}&quot; $API_KEY@api.dialmycalls.com/2.0/service/call &#x60;&#x60;&#x60; @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_by_id(call_id, opts = {}) click to toggle source

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_by_id_with_http_info(call_id, opts = {}) click to toggle source

Get Call Retrieve a call. &lt;br&gt;&lt;br&gt; Returns a call service object if a valid identifier was provided, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X GET $API_KEY@api.dialmycalls.com/2.0/service/call/$CALL_ID &#x60;&#x60;&#x60; @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_by_call_id(call_id, opts = {}) click to toggle source

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&#x3D;201-300&quot;) 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_by_call_id_with_http_info(call_id, opts = {}) click to toggle source

Get Call Recipients Retrieve a list of a call&#39;s recipients. &lt;br&gt;&lt;br&gt; Returns a list of call recipient objects if a valid identifier was provided, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X GET $API_KEY@api.dialmycalls.com/2.0/service/call/$CALL_ID/recipients &#x60;&#x60;&#x60; @param call_id CallId @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records&#x3D;201-300&quot;) 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
get_calls(opts = {}) click to toggle source

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&#x3D;201-300&quot;) 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
get_calls_with_http_info(opts = {}) click to toggle source

List Calls Retrieve a list of calls. &lt;br&gt;&lt;br&gt; Returns a list of call service objects. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X GET $API_KEY@api.dialmycalls.com/2.0/service/calls &#x60;&#x60;&#x60; @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records&#x3D;201-300&quot;) 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