openapi_ipify

OpenApiIpifyClient - the Ruby gem for the openapi-ipify

OpenAPI client for ipify, a simple public IP address API

This SDK is automatically generated by the OpenAPI Generator project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build openapi_ipify.gemspec

Then either install the gem locally:

gem install ./openapi_ipify-5.1.0.gem

(for development, run gem install --dev ./openapi_ipify-5.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'openapi_ipify', '~> 5.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/cliffano/openapi-ipify, then add the following in the Gemfile:

gem 'openapi_ipify', :git => 'https://github.com/cliffano/openapi-ipify.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'openapi_ipify'

api_instance = OpenApiIpifyClient::DefaultApi.new
opts = {
  format: 'json', # String | Response format
  callback: 'callback_example' # String | JSONP callback function name
}

begin
  #Get your public IP address
  result = api_instance.get_ip(opts)
  p result
rescue OpenApiIpifyClient::ApiError => e
  puts "Exception when calling DefaultApi->get_ip: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.ipify.org

Class Method HTTP request Description
OpenApiIpifyClient::DefaultApi get_ip GET / Get your public IP address

Documentation for Models

Documentation for Authorization

Endpoints do not require authorization.