class GiphyClient::DefaultApi
Attributes
Public Class Methods
# File lib/GiphyClient/api/default_api.rb, line 18 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Category
Tags Endpoint. Returns a list of tags for a given category. NOTE `limit` and `offset` must both be set; otherwise they're ignored. @param api_key Giphy API Key. @param category Filters results by category. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. (default to 25) @option opts [Integer] :offset An optional results offset. Defaults to 0. (default to 0) @return [InlineResponse2004]
# File lib/GiphyClient/api/default_api.rb, line 30 def gifs_categories_category_get(api_key, category, opts = {}) data, _status_code, _headers = gifs_categories_category_get_with_http_info(api_key, category, opts) return data end
Category
Tags Endpoint. Returns a list of tags for a given category. NOTE `limit` and `offset` must both be set; otherwise they're ignored. @param api_key Giphy API Key. @param category Filters results by category. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. @option opts [Integer] :offset An optional results offset. Defaults to 0. @return [Array<(InlineResponse2004
, Fixnum, Hash)>] InlineResponse2004
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 43 def gifs_categories_category_get_with_http_info(api_key, category, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_categories_category_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_categories_category_get" if api_key.nil? # verify the required parameter 'category' is set fail ArgumentError, "Missing the required parameter 'category' when calling DefaultApi.gifs_categories_category_get" if category.nil? if !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_categories_category_get, must be smaller than or equal to 100.' end if !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_categories_category_get, must be greater than or equal to 1.' end if !opts[:'offset'].nil? && opts[:'offset'] > 100 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.gifs_categories_category_get, must be smaller than or equal to 100.' end if !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.gifs_categories_category_get, must be greater than or equal to 0.' end # resource path local_var_path = "/gifs/categories/{category}".sub('{format}','json').sub('{' + 'category' + '}', category.to_s) # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2004') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_categories_category_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Tagged Gifs Endpoint. Returns a list of gifs for a given tag (alias to `/gif/search`). @param api_key Giphy API Key. @param category Filters results by category. @param tag Filters results by tag. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. (default to 25) @option opts [Integer] :offset An optional results offset. Defaults to 0. (default to 0) @return [InlineResponse2005]
# File lib/GiphyClient/api/default_api.rb, line 111 def gifs_categories_category_tag_get(api_key, category, tag, opts = {}) data, _status_code, _headers = gifs_categories_category_tag_get_with_http_info(api_key, category, tag, opts) return data end
Tagged Gifs Endpoint. Returns a list of gifs for a given tag (alias to `/gif/search`). @param api_key Giphy API Key. @param category Filters results by category. @param tag Filters results by tag. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. @option opts [Integer] :offset An optional results offset. Defaults to 0. @return [Array<(InlineResponse2005
, Fixnum, Hash)>] InlineResponse2005
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 125 def gifs_categories_category_tag_get_with_http_info(api_key, category, tag, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_categories_category_tag_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_categories_category_tag_get" if api_key.nil? # verify the required parameter 'category' is set fail ArgumentError, "Missing the required parameter 'category' when calling DefaultApi.gifs_categories_category_tag_get" if category.nil? # verify the required parameter 'tag' is set fail ArgumentError, "Missing the required parameter 'tag' when calling DefaultApi.gifs_categories_category_tag_get" if tag.nil? if !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_categories_category_tag_get, must be smaller than or equal to 100.' end if !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_categories_category_tag_get, must be greater than or equal to 1.' end if !opts[:'offset'].nil? && opts[:'offset'] > 100 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.gifs_categories_category_tag_get, must be smaller than or equal to 100.' end if !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.gifs_categories_category_tag_get, must be greater than or equal to 0.' end # resource path local_var_path = "/gifs/categories/{category}/{tag}".sub('{format}','json').sub('{' + 'category' + '}', category.to_s).sub('{' + 'tag' + '}', tag.to_s) # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2005') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_categories_category_tag_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Categories Endpoint. Returns a list of categories. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. (default to 25) @return [InlineResponse2003]
# File lib/GiphyClient/api/default_api.rb, line 192 def gifs_categories_get(api_key, opts = {}) data, _status_code, _headers = gifs_categories_get_with_http_info(api_key, opts) return data end
Categories Endpoint. Returns a list of categories. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. @return [Array<(InlineResponse2003
, Fixnum, Hash)>] InlineResponse2003
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 203 def gifs_categories_get_with_http_info(api_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_categories_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_categories_get" if api_key.nil? if !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_categories_get, must be smaller than or equal to 100.' end if !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_categories_get, must be greater than or equal to 1.' end # resource path local_var_path = "/gifs/categories".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2003') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_categories_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get GIFs by ID Endpoint A multiget version of the get GIF by ID endpoint. @param api_key Giphy API Key. @param ids Filters results by specified GIF IDs, separated by commas. @param [Hash] opts the optional parameters @return [InlineResponse200]
# File lib/GiphyClient/api/default_api.rb, line 257 def gifs_get(api_key, ids, opts = {}) data, _status_code, _headers = gifs_get_with_http_info(api_key, ids, opts) return data end
Get GIFs by ID Endpoint A multiget version of the get GIF by ID endpoint. @param api_key Giphy API Key. @param ids Filters results by specified GIF IDs, separated by commas. @param [Hash] opts the optional parameters @return [Array<(InlineResponse200
, Fixnum, Hash)>] InlineResponse200
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 268 def gifs_get_with_http_info(api_key, ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_get" if api_key.nil? # verify the required parameter 'ids' is set fail ArgumentError, "Missing the required parameter 'ids' when calling DefaultApi.gifs_get" if ids.nil? # resource path local_var_path = "/gifs".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'ids'] = ids # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse200') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get GIF by ID Endpoint Returns a GIF given that GIF's unique ID @param api_key Giphy API Key. @param gif_id Filters results by specified GIF ID. @param [Hash] opts the optional parameters @return [InlineResponse2001]
# File lib/GiphyClient/api/default_api.rb, line 316 def gifs_gif_id_get(api_key, gif_id, opts = {}) data, _status_code, _headers = gifs_gif_id_get_with_http_info(api_key, gif_id, opts) return data end
Get GIF by ID Endpoint Returns a GIF given that GIF's unique ID @param api_key Giphy API Key. @param gif_id Filters results by specified GIF ID. @param [Hash] opts the optional parameters @return [Array<(InlineResponse2001
, Fixnum, Hash)>] InlineResponse2001
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 327 def gifs_gif_id_get_with_http_info(api_key, gif_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_gif_id_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_gif_id_get" if api_key.nil? # verify the required parameter 'gif_id' is set fail ArgumentError, "Missing the required parameter 'gif_id' when calling DefaultApi.gifs_gif_id_get" if gif_id.nil? # resource path local_var_path = "/gifs/{gif_id}".sub('{format}','json').sub('{' + 'gif_id' + '}', gif_id.to_s) # query parameters query_params = {} query_params[:'api_key'] = api_key # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_gif_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Random Endpoint Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [String] :tag Filters results by specified tag. @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. (default to json) @return [InlineResponse2002]
# File lib/GiphyClient/api/default_api.rb, line 376 def gifs_random_get(api_key, opts = {}) data, _status_code, _headers = gifs_random_get_with_http_info(api_key, opts) return data end
Random Endpoint Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [String] :tag Filters results by specified tag. @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. @return [Array<(InlineResponse2002
, Fixnum, Hash)>] InlineResponse2002
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 389 def gifs_random_get_with_http_info(api_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_random_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_random_get" if api_key.nil? if opts[:'fmt'] && !['json', 'html'].include?(opts[:'fmt']) fail ArgumentError, 'invalid value for "fmt", must be one of json, html' end # resource path local_var_path = "/gifs/random".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'rating'] = opts[:'rating'] if !opts[:'rating'].nil? query_params[:'fmt'] = opts[:'fmt'] if !opts[:'fmt'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2002') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_random_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Search Endpoint Search all Giphy GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. @param api_key Giphy API Key. @param q Search query term or prhase. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. (default to 25) @option opts [Integer] :offset An optional results offset. Defaults to 0. (default to 0) @option opts [String] :rating Filters results by specified rating. @option opts [String] :lang Specify default country for regional content; use a 2-letter ISO 639-1 country code. See list of supported languages <a href = "../language-support">here</a>. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. (default to json) @return [InlineResponse200]
# File lib/GiphyClient/api/default_api.rb, line 445 def gifs_search_get(api_key, q, opts = {}) data, _status_code, _headers = gifs_search_get_with_http_info(api_key, q, opts) return data end
Search Endpoint Search all Giphy GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho. @param api_key Giphy API Key. @param q Search query term or prhase. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. @option opts [Integer] :offset An optional results offset. Defaults to 0. @option opts [String] :rating Filters results by specified rating. @option opts [String] :lang Specify default country for regional content; use a 2-letter ISO 639-1 country code. See list of supported languages <a href = "../language-support">here</a>. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. @return [Array<(InlineResponse200
, Fixnum, Hash)>] InlineResponse200
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 461 def gifs_search_get_with_http_info(api_key, q, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_search_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_search_get" if api_key.nil? # verify the required parameter 'q' is set fail ArgumentError, "Missing the required parameter 'q' when calling DefaultApi.gifs_search_get" if q.nil? if !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_search_get, must be smaller than or equal to 100.' end if !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_search_get, must be greater than or equal to 1.' end if !opts[:'offset'].nil? && opts[:'offset'] > 100 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.gifs_search_get, must be smaller than or equal to 100.' end if !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.gifs_search_get, must be greater than or equal to 0.' end if opts[:'fmt'] && !['json', 'html'].include?(opts[:'fmt']) fail ArgumentError, 'invalid value for "fmt", must be one of json, html' end # resource path local_var_path = "/gifs/search".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'q'] = q query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'rating'] = opts[:'rating'] if !opts[:'rating'].nil? query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil? query_params[:'fmt'] = opts[:'fmt'] if !opts[:'fmt'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse200') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_search_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Translate Endpoint The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. @param api_key Giphy API Key. @param s Search term. @param [Hash] opts the optional parameters @return [InlineResponse2001]
# File lib/GiphyClient/api/default_api.rb, line 533 def gifs_translate_get(api_key, s, opts = {}) data, _status_code, _headers = gifs_translate_get_with_http_info(api_key, s, opts) return data end
Translate Endpoint The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. @param api_key Giphy API Key. @param s Search term. @param [Hash] opts the optional parameters @return [Array<(InlineResponse2001
, Fixnum, Hash)>] InlineResponse2001
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 544 def gifs_translate_get_with_http_info(api_key, s, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_translate_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_translate_get" if api_key.nil? # verify the required parameter 's' is set fail ArgumentError, "Missing the required parameter 's' when calling DefaultApi.gifs_translate_get" if s.nil? # resource path local_var_path = "/gifs/translate".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'s'] = s # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_translate_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Trending GIFs Endpoint Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = "http://www.giphy.com">GIPHY homepage</a>. Returns 25 results by default. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. (default to 25) @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. (default to json) @return [InlineResponse200]
# File lib/GiphyClient/api/default_api.rb, line 594 def gifs_trending_get(api_key, opts = {}) data, _status_code, _headers = gifs_trending_get_with_http_info(api_key, opts) return data end
Trending GIFs Endpoint Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = "www.giphy.com">GIPHY homepage</a>. Returns 25 results by default. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. @return [Array<(InlineResponse200
, Fixnum, Hash)>] InlineResponse200
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 607 def gifs_trending_get_with_http_info(api_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.gifs_trending_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.gifs_trending_get" if api_key.nil? if !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_trending_get, must be smaller than or equal to 100.' end if !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.gifs_trending_get, must be greater than or equal to 1.' end if opts[:'fmt'] && !['json', 'html'].include?(opts[:'fmt']) fail ArgumentError, 'invalid value for "fmt", must be one of json, html' end # resource path local_var_path = "/gifs/trending".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'rating'] = opts[:'rating'] if !opts[:'rating'].nil? query_params[:'fmt'] = opts[:'fmt'] if !opts[:'fmt'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse200') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#gifs_trending_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Random Sticker Endpoint Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [String] :tag Filters results by specified tag. @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. (default to json) @return [InlineResponse2002]
# File lib/GiphyClient/api/default_api.rb, line 668 def stickers_random_get(api_key, opts = {}) data, _status_code, _headers = stickers_random_get_with_http_info(api_key, opts) return data end
Random Sticker Endpoint Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [String] :tag Filters results by specified tag. @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. @return [Array<(InlineResponse2002
, Fixnum, Hash)>] InlineResponse2002
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 681 def stickers_random_get_with_http_info(api_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.stickers_random_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.stickers_random_get" if api_key.nil? if opts[:'fmt'] && !['json', 'html'].include?(opts[:'fmt']) fail ArgumentError, 'invalid value for "fmt", must be one of json, html' end # resource path local_var_path = "/stickers/random".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'rating'] = opts[:'rating'] if !opts[:'rating'].nil? query_params[:'fmt'] = opts[:'fmt'] if !opts[:'fmt'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2002') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#stickers_random_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Sticker Search Endpoint Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. @param api_key Giphy API Key. @param q Search query term or prhase. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. (default to 25) @option opts [Integer] :offset An optional results offset. Defaults to 0. (default to 0) @option opts [String] :rating Filters results by specified rating. @option opts [String] :lang Specify default country for regional content; use a 2-letter ISO 639-1 country code. See list of supported languages <a href = "../language-support">here</a>. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. (default to json) @return [InlineResponse200]
# File lib/GiphyClient/api/default_api.rb, line 737 def stickers_search_get(api_key, q, opts = {}) data, _status_code, _headers = stickers_search_get_with_http_info(api_key, q, opts) return data end
Sticker Search Endpoint Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs. @param api_key Giphy API Key. @param q Search query term or prhase. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. @option opts [Integer] :offset An optional results offset. Defaults to 0. @option opts [String] :rating Filters results by specified rating. @option opts [String] :lang Specify default country for regional content; use a 2-letter ISO 639-1 country code. See list of supported languages <a href = "../language-support">here</a>. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. @return [Array<(InlineResponse200
, Fixnum, Hash)>] InlineResponse200
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 753 def stickers_search_get_with_http_info(api_key, q, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.stickers_search_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.stickers_search_get" if api_key.nil? # verify the required parameter 'q' is set fail ArgumentError, "Missing the required parameter 'q' when calling DefaultApi.stickers_search_get" if q.nil? if !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.stickers_search_get, must be smaller than or equal to 100.' end if !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.stickers_search_get, must be greater than or equal to 1.' end if !opts[:'offset'].nil? && opts[:'offset'] > 100 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.stickers_search_get, must be smaller than or equal to 100.' end if !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DefaultApi.stickers_search_get, must be greater than or equal to 0.' end if opts[:'fmt'] && !['json', 'html'].include?(opts[:'fmt']) fail ArgumentError, 'invalid value for "fmt", must be one of json, html' end # resource path local_var_path = "/stickers/search".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'q'] = q query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'rating'] = opts[:'rating'] if !opts[:'rating'].nil? query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil? query_params[:'fmt'] = opts[:'fmt'] if !opts[:'fmt'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse200') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#stickers_search_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Sticker Translate Endpoint The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. @param api_key Giphy API Key. @param s Search term. @param [Hash] opts the optional parameters @return [InlineResponse2001]
# File lib/GiphyClient/api/default_api.rb, line 825 def stickers_translate_get(api_key, s, opts = {}) data, _status_code, _headers = stickers_translate_get_with_http_info(api_key, s, opts) return data end
Sticker Translate Endpoint The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs. @param api_key Giphy API Key. @param s Search term. @param [Hash] opts the optional parameters @return [Array<(InlineResponse2001
, Fixnum, Hash)>] InlineResponse2001
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 836 def stickers_translate_get_with_http_info(api_key, s, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.stickers_translate_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.stickers_translate_get" if api_key.nil? # verify the required parameter 's' is set fail ArgumentError, "Missing the required parameter 's' when calling DefaultApi.stickers_translate_get" if s.nil? # resource path local_var_path = "/stickers/translate".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'s'] = s # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#stickers_translate_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Trending Stickers Endpoint Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = "http://www.giphy.com">GIPHY homepage</a>. Returns 25 results by default. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. (default to 25) @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. (default to json) @return [InlineResponse200]
# File lib/GiphyClient/api/default_api.rb, line 886 def stickers_trending_get(api_key, opts = {}) data, _status_code, _headers = stickers_trending_get_with_http_info(api_key, opts) return data end
Trending Stickers Endpoint Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = "www.giphy.com">GIPHY homepage</a>. Returns 25 results by default. @param api_key Giphy API Key. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of records to return. @option opts [String] :rating Filters results by specified rating. @option opts [String] :fmt Used to indicate the expected response format. Default is Json. @return [Array<(InlineResponse200
, Fixnum, Hash)>] InlineResponse200
data, response status code and response headers
# File lib/GiphyClient/api/default_api.rb, line 899 def stickers_trending_get_with_http_info(api_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi.stickers_trending_get ..." end # verify the required parameter 'api_key' is set fail ArgumentError, "Missing the required parameter 'api_key' when calling DefaultApi.stickers_trending_get" if api_key.nil? if !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.stickers_trending_get, must be smaller than or equal to 100.' end if !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.stickers_trending_get, must be greater than or equal to 1.' end if opts[:'fmt'] && !['json', 'html'].include?(opts[:'fmt']) fail ArgumentError, 'invalid value for "fmt", must be one of json, html' end # resource path local_var_path = "/stickers/trending".sub('{format}','json') # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'rating'] = opts[:'rating'] if !opts[:'rating'].nil? query_params[:'fmt'] = opts[:'fmt'] if !opts[:'fmt'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'InlineResponse200') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#stickers_trending_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end