Sha256: 6923d3e51daf15abda47d0335f98388c8b664ebbfecb2160b01ea3ea9748eda9

Contents?: true

Size: 1.62 KB

Versions: 8

Compression:

Stored size: 1.62 KB

Contents

# OpenApiIpifyClient::DefaultApi

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

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
| [**get_ip**](DefaultApi.md#get_ip) | **GET** / | Get your public IP address |


## get_ip

> <Ip> get_ip(opts)

Get your public IP address

### Examples

```ruby
require 'time'
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 "Error when calling DefaultApi->get_ip: #{e}"
end
```

#### Using the get_ip_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> <Array(<Ip>, Integer, Hash)> get_ip_with_http_info(opts)

```ruby
begin
  # Get your public IP address
  data, status_code, headers = api_instance.get_ip_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Ip>
rescue OpenApiIpifyClient::ApiError => e
  puts "Error when calling DefaultApi->get_ip_with_http_info: #{e}"
end
```

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **format** | **String** | Response format | [optional] |
| **callback** | **String** | JSONP callback function name | [optional] |

### Return type

[**Ip**](Ip.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json, application/javascript, text/plain

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
openapi_ipify-5.2.0 docs/DefaultApi.md
openapi_ipify-5.1.0 docs/DefaultApi.md
openapi_ipify-5.0.0 docs/DefaultApi.md
openapi_ipify-4.0.0 docs/DefaultApi.md
openapi_ipify-3.3.0 docs/DefaultApi.md
openapi_ipify-3.2.1 docs/DefaultApi.md
openapi_ipify-3.0.0 docs/DefaultApi.md
openapi_ipify-2.0.0 docs/DefaultApi.md