class DialMyCalls::CallerIdsApi
Attributes
Public Class Methods
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Add Caller ID Add a caller ID.
Returns a caller ID object on success, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"phone\": \"5555555555\", \"name\": \"New Number\"}" $API_KEY@api.dialmycalls.com/2.0/callerid “` @param create_caller_id_parameters Request body @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 39 def create_caller_id(create_caller_id_parameters, opts = {}) data, _status_code, _headers = create_caller_id_with_http_info(create_caller_id_parameters, opts) return data end
Add Caller ID Add a caller ID. <br><br> Returns a caller ID object on success, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X POST -d "{\"phone\": \"5555555555\", \"name\": \"New Number\"}" $API_KEY@api.dialmycalls.com/2.0/callerid ``` @param create_caller_id_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/caller_ids_api.rb, line 49 def create_caller_id_with_http_info(create_caller_id_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallerIdsApi.create_caller_id ..." end # verify the required parameter 'create_caller_id_parameters' is set fail ArgumentError, "Missing the required parameter 'create_caller_id_parameters' when calling CallerIdsApi.create_caller_id" if create_caller_id_parameters.nil? # resource path local_var_path = "/callerid".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_caller_id_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: CallerIdsApi#create_caller_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add Caller ID (Unverified) Initiate adding a new caller ID when you need to go through the verification process. You will receive a phone call at the phone number provided and will need to make a subsequent API call with the PIN code that you are provided.
Returns a caller ID object on success, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"phone\": \"5555555555\", \"name\": \"New Number\"}" $API_KEY@api.dialmycalls.com/2.0/verify/callerid “` @param create_unverified_caller_id_parameters Request body @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 96 def create_unverified_caller_id(create_unverified_caller_id_parameters, opts = {}) data, _status_code, _headers = create_unverified_caller_id_with_http_info(create_unverified_caller_id_parameters, opts) return data end
Add Caller ID (Unverified) Initiate adding a new caller ID when you need to go through the verification process. You will receive a phone call at the phone number provided and will need to make a subsequent API call with the PIN code that you are provided. <br><br> Returns a caller ID object on success, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X POST -d "{\"phone\": \"5555555555\", \"name\": \"New Number\"}" $API_KEY@api.dialmycalls.com/2.0/verify/callerid ``` @param create_unverified_caller_id_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/caller_ids_api.rb, line 106 def create_unverified_caller_id_with_http_info(create_unverified_caller_id_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallerIdsApi.create_unverified_caller_id ..." end # verify the required parameter 'create_unverified_caller_id_parameters' is set fail ArgumentError, "Missing the required parameter 'create_unverified_caller_id_parameters' when calling CallerIdsApi.create_unverified_caller_id" if create_unverified_caller_id_parameters.nil? # resource path local_var_path = "/verify/callerid".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_unverified_caller_id_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: CallerIdsApi#create_unverified_caller_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete Caller ID Delete a caller ID.
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/callerid/$CALLERID_ID “` @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 153 def delete_caller_id_by_id(callerid_id, opts = {}) data, _status_code, _headers = delete_caller_id_by_id_with_http_info(callerid_id, opts) return data end
Delete Caller ID Delete a caller ID. <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/callerid/$CALLERID_ID ``` @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 163 def delete_caller_id_by_id_with_http_info(callerid_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallerIdsApi.delete_caller_id_by_id ..." end # verify the required parameter 'callerid_id' is set fail ArgumentError, "Missing the required parameter 'callerid_id' when calling CallerIdsApi.delete_caller_id_by_id" if callerid_id.nil? # resource path local_var_path = "/callerid/{CalleridId}".sub('{format}','json').sub('{' + 'CalleridId' + '}', callerid_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: CallerIdsApi#delete_caller_id_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Caller ID Retrieve a caller ID.
Returns a caller ID 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/callerid/$CALLERID_ID “` @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 210 def get_caller_id_by_id(callerid_id, opts = {}) data, _status_code, _headers = get_caller_id_by_id_with_http_info(callerid_id, opts) return data end
Get Caller ID Retrieve a caller ID. <br><br> Returns a caller ID 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/callerid/$CALLERID_ID ``` @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 220 def get_caller_id_by_id_with_http_info(callerid_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallerIdsApi.get_caller_id_by_id ..." end # verify the required parameter 'callerid_id' is set fail ArgumentError, "Missing the required parameter 'callerid_id' when calling CallerIdsApi.get_caller_id_by_id" if callerid_id.nil? # resource path local_var_path = "/callerid/{CalleridId}".sub('{format}','json').sub('{' + 'CalleridId' + '}', callerid_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: CallerIdsApi#get_caller_id_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Caller IDs Retrieve a list of caller IDs.
Returns a list of caller ID objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/callerids “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of callerids requested @return [Object]
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 267 def get_caller_ids(opts = {}) data, _status_code, _headers = get_caller_ids_with_http_info(opts) return data end
List Caller IDs Retrieve a list of caller IDs. <br><br> Returns a list of caller ID objects. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/callerids ``` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of callerids requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 277 def get_caller_ids_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallerIdsApi.get_caller_ids ..." end # resource path local_var_path = "/callerids".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: CallerIdsApi#get_caller_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update Caller ID Update an existing caller ID.
Returns a caller ID 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 "{\"name\": \"New Number Updated\"}" $API_KEY@api.dialmycalls.com/2.0/callerid/$CALLERID_ID “` @param update_caller_id_by_id_parameters Request body @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 324 def update_caller_id_by_id(update_caller_id_by_id_parameters, callerid_id, opts = {}) data, _status_code, _headers = update_caller_id_by_id_with_http_info(update_caller_id_by_id_parameters, callerid_id, opts) return data end
Update Caller ID Update an existing caller ID. <br><br> Returns a caller ID object if a valid identifier was provided and input validation passed, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X PUT -d "{\"name\": \"New Number Updated\"}" $API_KEY@api.dialmycalls.com/2.0/callerid/$CALLERID_ID ``` @param update_caller_id_by_id_parameters Request body @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 335 def update_caller_id_by_id_with_http_info(update_caller_id_by_id_parameters, callerid_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallerIdsApi.update_caller_id_by_id ..." end # verify the required parameter 'update_caller_id_by_id_parameters' is set fail ArgumentError, "Missing the required parameter 'update_caller_id_by_id_parameters' when calling CallerIdsApi.update_caller_id_by_id" if update_caller_id_by_id_parameters.nil? # verify the required parameter 'callerid_id' is set fail ArgumentError, "Missing the required parameter 'callerid_id' when calling CallerIdsApi.update_caller_id_by_id" if callerid_id.nil? # resource path local_var_path = "/callerid/{CalleridId}".sub('{format}','json').sub('{' + 'CalleridId' + '}', callerid_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_caller_id_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: CallerIdsApi#update_caller_id_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Verify Caller ID Verify a new caller ID.
Returns a caller ID object if a valid identifier was provided, and returns an error otherwise.
“` curl -i -H "Content-Type: application/json" -X POST -d "{\"phone\": \"5555555555\", \"name\": \"New Number\"}" $API_KEY@api.dialmycalls.com/2.0/verify/callerid/$CALLERID_ID “` @param verify_caller_id_by_id_parameters Request body @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 385 def verify_caller_id_by_id(verify_caller_id_by_id_parameters, callerid_id, opts = {}) data, _status_code, _headers = verify_caller_id_by_id_with_http_info(verify_caller_id_by_id_parameters, callerid_id, opts) return data end
Verify Caller ID Verify a new caller ID. <br><br> Returns a caller ID object if a valid identifier was provided, and returns an error otherwise. <br><br> ``` curl -i -H "Content-Type: application/json" -X POST -d "{\"phone\": \"5555555555\", \"name\": \"New Number\"}" $API_KEY@api.dialmycalls.com/2.0/verify/callerid/$CALLERID_ID ``` @param verify_caller_id_by_id_parameters Request body @param callerid_id CalleridId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/caller_ids_api.rb, line 396 def verify_caller_id_by_id_with_http_info(verify_caller_id_by_id_parameters, callerid_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallerIdsApi.verify_caller_id_by_id ..." end # verify the required parameter 'verify_caller_id_by_id_parameters' is set fail ArgumentError, "Missing the required parameter 'verify_caller_id_by_id_parameters' when calling CallerIdsApi.verify_caller_id_by_id" if verify_caller_id_by_id_parameters.nil? # verify the required parameter 'callerid_id' is set fail ArgumentError, "Missing the required parameter 'callerid_id' when calling CallerIdsApi.verify_caller_id_by_id" if callerid_id.nil? # resource path local_var_path = "/verify/callerid/{CalleridId}".sub('{format}','json').sub('{' + 'CalleridId' + '}', callerid_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(verify_caller_id_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: CallerIdsApi#verify_caller_id_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end