class DialMyCalls::ContactsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/dialmycalls_client/api/contacts_api.rb, line 30
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_contact(create_contact_parameters, opts = {}) click to toggle source

Add Contact Add a contact to your contact list.
Returns a contact object on success, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"phone\": \"5555555555\"}" $API_KEY@api.dialmycalls.com/2.0/contact “` @param create_contact_parameters Request body @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/contacts_api.rb, line 39
def create_contact(create_contact_parameters, opts = {})
  data, _status_code, _headers = create_contact_with_http_info(create_contact_parameters, opts)
  return data
end
create_contact_with_http_info(create_contact_parameters, opts = {}) click to toggle source

Add Contact Add a contact to your contact list. &lt;br&gt;&lt;br&gt; Returns a contact 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;phone\&quot;: \&quot;5555555555\&quot;}&quot; $API_KEY@api.dialmycalls.com/2.0/contact &#x60;&#x60;&#x60; @param create_contact_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/contacts_api.rb, line 49
def create_contact_with_http_info(create_contact_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ContactsApi.create_contact ..."
  end
  # verify the required parameter 'create_contact_parameters' is set
  fail ArgumentError, "Missing the required parameter 'create_contact_parameters' when calling ContactsApi.create_contact" if create_contact_parameters.nil?
  # resource path
  local_var_path = "/contact".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_contact_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: ContactsApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_contact_by_id(contact_id, opts = {}) click to toggle source

Delete Contact Delete a contact from your contact list.
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/contact/$CONTACT_ID “` @param contact_id ContactId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/contacts_api.rb, line 96
def delete_contact_by_id(contact_id, opts = {})
  data, _status_code, _headers = delete_contact_by_id_with_http_info(contact_id, opts)
  return data
end
delete_contact_by_id_with_http_info(contact_id, opts = {}) click to toggle source

Delete Contact Delete a contact from your contact list. &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/contact/$CONTACT_ID &#x60;&#x60;&#x60; @param contact_id ContactId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/contacts_api.rb, line 106
def delete_contact_by_id_with_http_info(contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ContactsApi.delete_contact_by_id ..."
  end
  # verify the required parameter 'contact_id' is set
  fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsApi.delete_contact_by_id" if contact_id.nil?
  # resource path
  local_var_path = "/contact/{ContactId}".sub('{format}','json').sub('{' + 'ContactId' + '}', contact_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: ContactsApi#delete_contact_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_contact_by_id(contact_id, opts = {}) click to toggle source

Get Contact Retrieve a contact to your contact list.
Returns a contact 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/contact/$CONTACT_ID “` @param contact_id ContactId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/contacts_api.rb, line 153
def get_contact_by_id(contact_id, opts = {})
  data, _status_code, _headers = get_contact_by_id_with_http_info(contact_id, opts)
  return data
end
get_contact_by_id_with_http_info(contact_id, opts = {}) click to toggle source

Get Contact Retrieve a contact to your contact list. &lt;br&gt;&lt;br&gt; Returns a contact 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/contact/$CONTACT_ID &#x60;&#x60;&#x60; @param contact_id ContactId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/contacts_api.rb, line 163
def get_contact_by_id_with_http_info(contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ContactsApi.get_contact_by_id ..."
  end
  # verify the required parameter 'contact_id' is set
  fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsApi.get_contact_by_id" if contact_id.nil?
  # resource path
  local_var_path = "/contact/{ContactId}".sub('{format}','json').sub('{' + 'ContactId' + '}', contact_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: ContactsApi#get_contact_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_contacts(opts = {}) click to toggle source

List Contacts Retrieve a list of contacts.
Returns a list of contact objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/contacts “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records&#x3D;201-300&quot;) of contacts requested @return [Object]

# File lib/dialmycalls_client/api/contacts_api.rb, line 210
def get_contacts(opts = {})
  data, _status_code, _headers = get_contacts_with_http_info(opts)
  return data
end
get_contacts_by_group_id(group_id, opts = {}) click to toggle source

List Contacts in Group Retrieve a list of contacts in a contact group.
Returns a list of contact objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/contacts/$GROUP_ID “` @param group_id GroupId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/contacts_api.rb, line 266
def get_contacts_by_group_id(group_id, opts = {})
  data, _status_code, _headers = get_contacts_by_group_id_with_http_info(group_id, opts)
  return data
end
get_contacts_by_group_id_with_http_info(group_id, opts = {}) click to toggle source

List Contacts in Group Retrieve a list of contacts in a contact group. &lt;br&gt;&lt;br&gt; Returns a list of contact 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/contacts/$GROUP_ID &#x60;&#x60;&#x60; @param group_id GroupId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/contacts_api.rb, line 276
def get_contacts_by_group_id_with_http_info(group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ContactsApi.get_contacts_by_group_id ..."
  end
  # verify the required parameter 'group_id' is set
  fail ArgumentError, "Missing the required parameter 'group_id' when calling ContactsApi.get_contacts_by_group_id" if group_id.nil?
  # resource path
  local_var_path = "/contacts/{GroupId}".sub('{format}','json').sub('{' + 'GroupId' + '}', group_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: ContactsApi#get_contacts_by_group_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_contacts_with_http_info(opts = {}) click to toggle source

List Contacts Retrieve a list of contacts. &lt;br&gt;&lt;br&gt; Returns a list of contact 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/contacts &#x60;&#x60;&#x60; @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records&#x3D;201-300&quot;) of contacts requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/contacts_api.rb, line 220
def get_contacts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ContactsApi.get_contacts ..."
  end
  # resource path
  local_var_path = "/contacts".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: ContactsApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_contact_by_id(update_contact_by_id_parameters, contact_id, opts = {}) click to toggle source

Update Contact Update an existing contact in your contact list.
Returns a contact object if a valid identifier was provided and input validation passed, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X PUT -d "{\"phone\": \"5555555555\"}" $API_KEY@api.dialmycalls.com/2.0/contact/$CONTACT_ID “` @param update_contact_by_id_parameters Request body @param contact_id ContactId @param [Hash] opts the optional parameters @return [Object]

# File lib/dialmycalls_client/api/contacts_api.rb, line 324
def update_contact_by_id(update_contact_by_id_parameters, contact_id, opts = {})
  data, _status_code, _headers = update_contact_by_id_with_http_info(update_contact_by_id_parameters, contact_id, opts)
  return data
end
update_contact_by_id_with_http_info(update_contact_by_id_parameters, contact_id, opts = {}) click to toggle source

Update Contact Update an existing contact in your contact list. &lt;br&gt;&lt;br&gt; Returns a contact object if a valid identifier was provided and input validation passed, and returns an error otherwise. &lt;br&gt;&lt;br&gt; &#x60;&#x60;&#x60; curl -i -H "Content-Type: application/json&quot; -X PUT -d "{\&quot;phone\&quot;: \&quot;5555555555\&quot;}&quot; $API_KEY@api.dialmycalls.com/2.0/contact/$CONTACT_ID &#x60;&#x60;&#x60; @param update_contact_by_id_parameters Request body @param contact_id ContactId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/dialmycalls_client/api/contacts_api.rb, line 335
def update_contact_by_id_with_http_info(update_contact_by_id_parameters, contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ContactsApi.update_contact_by_id ..."
  end
  # verify the required parameter 'update_contact_by_id_parameters' is set
  fail ArgumentError, "Missing the required parameter 'update_contact_by_id_parameters' when calling ContactsApi.update_contact_by_id" if update_contact_by_id_parameters.nil?
  # verify the required parameter 'contact_id' is set
  fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsApi.update_contact_by_id" if contact_id.nil?
  # resource path
  local_var_path = "/contact/{ContactId}".sub('{format}','json').sub('{' + 'ContactId' + '}', contact_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 = @api_client.object_to_http_body(update_contact_by_id_parameters)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:PUT, 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: ContactsApi#update_contact_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end