class DialMyCalls::KeywordsApi
Attributes
Public Class Methods
# File lib/dialmycalls_client/api/keywords_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete Keyword
Delete a keyword.
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/keyword/$KEYWORD_ID “` @param keyword_id KeywordId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/keywords_api.rb, line 39 def delete_keyword_by_id(keyword_id, opts = {}) data, _status_code, _headers = delete_keyword_by_id_with_http_info(keyword_id, opts) return data end
Delete Keyword
Delete a keyword. <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/keyword/$KEYWORD_ID ``` @param keyword_id KeywordId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/keywords_api.rb, line 49 def delete_keyword_by_id_with_http_info(keyword_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KeywordsApi.delete_keyword_by_id ..." end # verify the required parameter 'keyword_id' is set fail ArgumentError, "Missing the required parameter 'keyword_id' when calling KeywordsApi.delete_keyword_by_id" if keyword_id.nil? # resource path local_var_path = "/keyword/{KeywordId}".sub('{format}','json').sub('{' + 'KeywordId' + '}', keyword_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: KeywordsApi#delete_keyword_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get Keyword
Retrieve a keyword.
Returns a keyword 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/keyword/$KEYWORD_ID “` @param keyword_id KeywordId @param [Hash] opts the optional parameters @return [Object]
# File lib/dialmycalls_client/api/keywords_api.rb, line 96 def get_keyword_by_id(keyword_id, opts = {}) data, _status_code, _headers = get_keyword_by_id_with_http_info(keyword_id, opts) return data end
Get Keyword
Retrieve a keyword. <br><br> Returns a keyword 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/keyword/$KEYWORD_ID ``` @param keyword_id KeywordId @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/keywords_api.rb, line 106 def get_keyword_by_id_with_http_info(keyword_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KeywordsApi.get_keyword_by_id ..." end # verify the required parameter 'keyword_id' is set fail ArgumentError, "Missing the required parameter 'keyword_id' when calling KeywordsApi.get_keyword_by_id" if keyword_id.nil? # resource path local_var_path = "/keyword/{KeywordId}".sub('{format}','json').sub('{' + 'KeywordId' + '}', keyword_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: KeywordsApi#get_keyword_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Keywords Retrieve a list of keywords.
Returns a list of keyword objects.
“` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/keywords “` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of keywords requested @return [Object]
# File lib/dialmycalls_client/api/keywords_api.rb, line 153 def get_keywords(opts = {}) data, _status_code, _headers = get_keywords_with_http_info(opts) return data end
List Keywords Retrieve a list of keywords. <br><br> Returns a list of keyword objects. <br><br> ``` curl -i -H "Content-Type: application/json" -X GET $API_KEY@api.dialmycalls.com/2.0/keywords ``` @param [Hash] opts the optional parameters @option opts [String] :range Range (ie "records=201-300") of keywords requested @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# File lib/dialmycalls_client/api/keywords_api.rb, line 163 def get_keywords_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: KeywordsApi.get_keywords ..." end # resource path local_var_path = "/keywords".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: KeywordsApi#get_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end