smspool 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +61 -0
- data/lib/smspool/api/business_api.rb +300 -0
- data/lib/smspool/api/carrier_api.rb +91 -0
- data/lib/smspool/api/esims_api.rb +637 -0
- data/lib/smspool/api/information_api.rb +479 -0
- data/lib/smspool/api/preorders_api.rb +385 -0
- data/lib/smspool/api/pricing_api.rb +174 -0
- data/lib/smspool/api/rental_api.rb +1115 -0
- data/lib/smspool/api/sms_api.rb +1214 -0
- data/lib/smspool/api/voucher_api.rb +285 -0
- data/lib/smspool/api_client.rb +397 -0
- data/lib/smspool/api_error.rb +58 -0
- data/lib/smspool/api_model_base.rb +88 -0
- data/lib/smspool/configuration.rb +308 -0
- data/lib/smspool/version.rb +15 -0
- data/lib/smspool.rb +49 -0
- metadata +100 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6715cace4f206de2bed3308dfb5b64b91d052adce7b110d87c4c893d972863db
|
|
4
|
+
data.tar.gz: 70e3be6c9c1efccf92cad0d1e8a7b6653b9abb7b0f42a3ec588eeb588a2a6085
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 63651006706c9509cbda8399d4098ca75c4c85b74a5fc1b7051f0dcf82d9acc0177efcd4ad5a05e185565fbd2dec175f995d8375a1fea265a6b1006217c53a1a
|
|
7
|
+
data.tar.gz: ba8eea412e10ec4b2281912e77f458fa196dc4b681820c90a6ea81ddcc2cf84fb9ccdea3684f125c0b88eb59e865123d8b975d588bb84a1be0b52ada13734587
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SMSPool
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# SMSPool Ruby SDK
|
|
2
|
+
|
|
3
|
+
Official Ruby client for the [SMSPool API](https://api.smspool.net/docs): one-time SMS
|
|
4
|
+
verification numbers, rentals, pre-orders, eSIMs and more.
|
|
5
|
+
|
|
6
|
+
Package: [`smspool`](https://rubygems.org/gems/smspool) on RubyGems.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
gem install smspool
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
Get your API key from [your settings page](https://www.smspool.net/my/settings).
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require "smspool"
|
|
20
|
+
|
|
21
|
+
SMSPool.configure { |c| c.access_token = "YOUR_API_KEY" }
|
|
22
|
+
p SMSPool::InformationApi.new.request_balance
|
|
23
|
+
countries = SMSPool::InformationApi.new.country_retrieve_all
|
|
24
|
+
order = SMSPool::SMSApi.new.purchase_sms("1", country: "US")
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Errors (HTTP 4xx/5xx) raise `SMSPool::ApiError`, with `code` and `response_body`.
|
|
28
|
+
|
|
29
|
+
## Calling endpoints
|
|
30
|
+
|
|
31
|
+
Every endpoint in the [API reference](https://api.smspool.net/docs) is a method named after
|
|
32
|
+
its path, on the class for its section: `/sms/check` is `sms_check` on `SMSApi`. Endpoints that need
|
|
33
|
+
your API key send it as a bearer token.
|
|
34
|
+
|
|
35
|
+
Responses are returned as decoded JSON exactly as the API sends them: many endpoints answer
|
|
36
|
+
`200` with `"success": 0` and a `message` when a request is refused, so check `success`.
|
|
37
|
+
|
|
38
|
+
- Generated reference for every method and parameter: [`docs/`](docs/)
|
|
39
|
+
- API reference with examples: https://api.smspool.net/docs
|
|
40
|
+
|
|
41
|
+
## How this SDK is made
|
|
42
|
+
|
|
43
|
+
The code is generated from the API's OpenAPI spec
|
|
44
|
+
([openapi.json](https://api.smspool.net/openapi.json)) with
|
|
45
|
+
[OpenAPI Generator](https://openapi-generator.tech). Do not edit generated files by hand:
|
|
46
|
+
a workflow regenerates them every week and opens a pull request when the API changed.
|
|
47
|
+
Hand-written files are listed in `.openapi-generator-ignore`.
|
|
48
|
+
|
|
49
|
+
## Releasing (maintainers)
|
|
50
|
+
|
|
51
|
+
1. Set the new version in `openapi-generator.yaml` (`gemVersion`).
|
|
52
|
+
2. Run `scripts/generate.sh` (needs Docker) and `scripts/smoke.sh`, then commit.
|
|
53
|
+
3. Tag and push: `git tag vX.Y.Z && git push origin vX.Y.Z`.
|
|
54
|
+
|
|
55
|
+
The Release workflow checks the tag against the version, runs the smoke test and publishes.
|
|
56
|
+
RubyGems uses trusted publishing (no token): the gem's publisher is this repo's
|
|
57
|
+
`release.yml` workflow in the `release` environment.
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SMSPool API
|
|
3
|
+
|
|
4
|
+
#Every endpoint accepts its parameters as form fields (POST) or query parameters (GET). Authenticate with your API key from https://www.smspool.net/my/settings, either as a bearer token (`Authorization: Bearer <key>`) or as a `key` parameter.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module SMSPool
|
|
16
|
+
class BusinessApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Register user
|
|
23
|
+
# @param username [String]
|
|
24
|
+
# @param password [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [Float] :daily_spend_limit Optional daily spend cap in USD. Omit for no limit.
|
|
27
|
+
# @return [Object]
|
|
28
|
+
def business_create(username, password, opts = {})
|
|
29
|
+
data, _status_code, _headers = business_create_with_http_info(username, password, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Register user
|
|
34
|
+
# @param username [String]
|
|
35
|
+
# @param password [String]
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [Float] :daily_spend_limit Optional daily spend cap in USD. Omit for no limit.
|
|
38
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
39
|
+
def business_create_with_http_info(username, password, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: BusinessApi.business_create ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'username' is set
|
|
44
|
+
if @api_client.config.client_side_validation && username.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling BusinessApi.business_create"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'password' is set
|
|
48
|
+
if @api_client.config.client_side_validation && password.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'password' when calling BusinessApi.business_create"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/business/create'
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
form_params['username'] = username
|
|
70
|
+
form_params['password'] = password
|
|
71
|
+
form_params['daily_spend_limit'] = opts[:'daily_spend_limit'] if !opts[:'daily_spend_limit'].nil?
|
|
72
|
+
|
|
73
|
+
# http body (model)
|
|
74
|
+
post_body = opts[:debug_body]
|
|
75
|
+
|
|
76
|
+
# return_type
|
|
77
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
78
|
+
|
|
79
|
+
# auth_names
|
|
80
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
81
|
+
|
|
82
|
+
new_options = opts.merge(
|
|
83
|
+
:operation => :"BusinessApi.business_create",
|
|
84
|
+
:header_params => header_params,
|
|
85
|
+
:query_params => query_params,
|
|
86
|
+
:form_params => form_params,
|
|
87
|
+
:body => post_body,
|
|
88
|
+
:auth_names => auth_names,
|
|
89
|
+
:return_type => return_type
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
93
|
+
if @api_client.config.debugging
|
|
94
|
+
@api_client.config.logger.debug "API called: BusinessApi#business_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
95
|
+
end
|
|
96
|
+
return data, status_code, headers
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# History
|
|
100
|
+
# @param id [Integer] User ID retrievd from `Retrieve users` endpoint
|
|
101
|
+
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @return [Object]
|
|
103
|
+
def business_user_history(id, opts = {})
|
|
104
|
+
data, _status_code, _headers = business_user_history_with_http_info(id, opts)
|
|
105
|
+
data
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# History
|
|
109
|
+
# @param id [Integer] User ID retrievd from `Retrieve users` endpoint
|
|
110
|
+
# @param [Hash] opts the optional parameters
|
|
111
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
112
|
+
def business_user_history_with_http_info(id, opts = {})
|
|
113
|
+
if @api_client.config.debugging
|
|
114
|
+
@api_client.config.logger.debug 'Calling API: BusinessApi.business_user_history ...'
|
|
115
|
+
end
|
|
116
|
+
# verify the required parameter 'id' is set
|
|
117
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
118
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling BusinessApi.business_user_history"
|
|
119
|
+
end
|
|
120
|
+
# resource path
|
|
121
|
+
local_var_path = '/business/user/history'
|
|
122
|
+
|
|
123
|
+
# query parameters
|
|
124
|
+
query_params = opts[:query_params] || {}
|
|
125
|
+
|
|
126
|
+
# header parameters
|
|
127
|
+
header_params = opts[:header_params] || {}
|
|
128
|
+
# HTTP header 'Accept' (if needed)
|
|
129
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
130
|
+
# HTTP header 'Content-Type'
|
|
131
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
132
|
+
if !content_type.nil?
|
|
133
|
+
header_params['Content-Type'] = content_type
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# form parameters
|
|
137
|
+
form_params = opts[:form_params] || {}
|
|
138
|
+
form_params['id'] = id
|
|
139
|
+
|
|
140
|
+
# http body (model)
|
|
141
|
+
post_body = opts[:debug_body]
|
|
142
|
+
|
|
143
|
+
# return_type
|
|
144
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
145
|
+
|
|
146
|
+
# auth_names
|
|
147
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
148
|
+
|
|
149
|
+
new_options = opts.merge(
|
|
150
|
+
:operation => :"BusinessApi.business_user_history",
|
|
151
|
+
:header_params => header_params,
|
|
152
|
+
:query_params => query_params,
|
|
153
|
+
:form_params => form_params,
|
|
154
|
+
:body => post_body,
|
|
155
|
+
:auth_names => auth_names,
|
|
156
|
+
:return_type => return_type
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
160
|
+
if @api_client.config.debugging
|
|
161
|
+
@api_client.config.logger.debug "API called: BusinessApi#business_user_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
162
|
+
end
|
|
163
|
+
return data, status_code, headers
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Update
|
|
167
|
+
# @param id [Integer] User ID retrievd from `Retrieve users` endpoint
|
|
168
|
+
# @param [Hash] opts the optional parameters
|
|
169
|
+
# @option opts [String] :password Leave empty if you do not wish to update the password
|
|
170
|
+
# @option opts [Float] :balance Leave empty if you do not wish to update the balance, sets the balance by the requested value
|
|
171
|
+
# @option opts [Integer] :active Disable/enable user account (optional)
|
|
172
|
+
# @option opts [Float] :daily_spend_limit Daily spend cap in USD. Leave empty to leave unchanged, send -1 to remove the cap, 0 to block all spending.
|
|
173
|
+
# @return [Object]
|
|
174
|
+
def business_user_update(id, opts = {})
|
|
175
|
+
data, _status_code, _headers = business_user_update_with_http_info(id, opts)
|
|
176
|
+
data
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Update
|
|
180
|
+
# @param id [Integer] User ID retrievd from `Retrieve users` endpoint
|
|
181
|
+
# @param [Hash] opts the optional parameters
|
|
182
|
+
# @option opts [String] :password Leave empty if you do not wish to update the password
|
|
183
|
+
# @option opts [Float] :balance Leave empty if you do not wish to update the balance, sets the balance by the requested value
|
|
184
|
+
# @option opts [Integer] :active Disable/enable user account (optional)
|
|
185
|
+
# @option opts [Float] :daily_spend_limit Daily spend cap in USD. Leave empty to leave unchanged, send -1 to remove the cap, 0 to block all spending.
|
|
186
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
187
|
+
def business_user_update_with_http_info(id, opts = {})
|
|
188
|
+
if @api_client.config.debugging
|
|
189
|
+
@api_client.config.logger.debug 'Calling API: BusinessApi.business_user_update ...'
|
|
190
|
+
end
|
|
191
|
+
# verify the required parameter 'id' is set
|
|
192
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
193
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling BusinessApi.business_user_update"
|
|
194
|
+
end
|
|
195
|
+
# resource path
|
|
196
|
+
local_var_path = '/business/user/update'
|
|
197
|
+
|
|
198
|
+
# query parameters
|
|
199
|
+
query_params = opts[:query_params] || {}
|
|
200
|
+
|
|
201
|
+
# header parameters
|
|
202
|
+
header_params = opts[:header_params] || {}
|
|
203
|
+
# HTTP header 'Accept' (if needed)
|
|
204
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
205
|
+
# HTTP header 'Content-Type'
|
|
206
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
207
|
+
if !content_type.nil?
|
|
208
|
+
header_params['Content-Type'] = content_type
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# form parameters
|
|
212
|
+
form_params = opts[:form_params] || {}
|
|
213
|
+
form_params['id'] = id
|
|
214
|
+
form_params['password'] = opts[:'password'] if !opts[:'password'].nil?
|
|
215
|
+
form_params['balance'] = opts[:'balance'] if !opts[:'balance'].nil?
|
|
216
|
+
form_params['active'] = opts[:'active'] if !opts[:'active'].nil?
|
|
217
|
+
form_params['daily_spend_limit'] = opts[:'daily_spend_limit'] if !opts[:'daily_spend_limit'].nil?
|
|
218
|
+
|
|
219
|
+
# http body (model)
|
|
220
|
+
post_body = opts[:debug_body]
|
|
221
|
+
|
|
222
|
+
# return_type
|
|
223
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
224
|
+
|
|
225
|
+
# auth_names
|
|
226
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
227
|
+
|
|
228
|
+
new_options = opts.merge(
|
|
229
|
+
:operation => :"BusinessApi.business_user_update",
|
|
230
|
+
:header_params => header_params,
|
|
231
|
+
:query_params => query_params,
|
|
232
|
+
:form_params => form_params,
|
|
233
|
+
:body => post_body,
|
|
234
|
+
:auth_names => auth_names,
|
|
235
|
+
:return_type => return_type
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
239
|
+
if @api_client.config.debugging
|
|
240
|
+
@api_client.config.logger.debug "API called: BusinessApi#business_user_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
241
|
+
end
|
|
242
|
+
return data, status_code, headers
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Retrieve users
|
|
246
|
+
# @param [Hash] opts the optional parameters
|
|
247
|
+
# @return [Object]
|
|
248
|
+
def business_users(opts = {})
|
|
249
|
+
data, _status_code, _headers = business_users_with_http_info(opts)
|
|
250
|
+
data
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Retrieve users
|
|
254
|
+
# @param [Hash] opts the optional parameters
|
|
255
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
256
|
+
def business_users_with_http_info(opts = {})
|
|
257
|
+
if @api_client.config.debugging
|
|
258
|
+
@api_client.config.logger.debug 'Calling API: BusinessApi.business_users ...'
|
|
259
|
+
end
|
|
260
|
+
# resource path
|
|
261
|
+
local_var_path = '/business/users'
|
|
262
|
+
|
|
263
|
+
# query parameters
|
|
264
|
+
query_params = opts[:query_params] || {}
|
|
265
|
+
|
|
266
|
+
# header parameters
|
|
267
|
+
header_params = opts[:header_params] || {}
|
|
268
|
+
# HTTP header 'Accept' (if needed)
|
|
269
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
270
|
+
|
|
271
|
+
# form parameters
|
|
272
|
+
form_params = opts[:form_params] || {}
|
|
273
|
+
|
|
274
|
+
# http body (model)
|
|
275
|
+
post_body = opts[:debug_body]
|
|
276
|
+
|
|
277
|
+
# return_type
|
|
278
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
279
|
+
|
|
280
|
+
# auth_names
|
|
281
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
282
|
+
|
|
283
|
+
new_options = opts.merge(
|
|
284
|
+
:operation => :"BusinessApi.business_users",
|
|
285
|
+
:header_params => header_params,
|
|
286
|
+
:query_params => query_params,
|
|
287
|
+
:form_params => form_params,
|
|
288
|
+
:body => post_body,
|
|
289
|
+
:auth_names => auth_names,
|
|
290
|
+
:return_type => return_type
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
294
|
+
if @api_client.config.debugging
|
|
295
|
+
@api_client.config.logger.debug "API called: BusinessApi#business_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
296
|
+
end
|
|
297
|
+
return data, status_code, headers
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SMSPool API
|
|
3
|
+
|
|
4
|
+
#Every endpoint accepts its parameters as form fields (POST) or query parameters (GET). Authenticate with your API key from https://www.smspool.net/my/settings, either as a bearer token (`Authorization: Bearer <key>`) or as a `key` parameter.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module SMSPool
|
|
16
|
+
class CarrierApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Lookup
|
|
23
|
+
# This API endpoint is used to perform a paid lookup for a phone number. The request is sent via an HTTP POST method to the following URL: `https://api.smspool.net/carrier/paid_lookup` ``` json { \"success\": true, \"phonenumber\": \"\", \"country\": \"\", \"carrier\": \"\", \"carrier_type\": \"\", \"charge\": 0 } ``` The `success` field indicates whether the lookup was successful or not. The `phonenumber` field represents the phone number for which the lookup was performed. The `country` field indicates the country associated with the phone number. The `carrier` field provides the name of the carrier associated with the phone number. The `carrier_type` field specifies the type of carrier. The `charge` field represents the cost charged for the lookup operation. Please note that specific values for `phonenumber`, `country`, `carrier`, and `carrier_type` were not provided in the response, and the `charge` field had a value of 0. To use this endpoint, send an HTTP POST request to the provided URL with the necessary parameters. The request should include the phone number for which you want to perform the lookup. The response will contain the details of the carrier and associated information. Make sure to handle any errors that may occur during the lookup process and check the `success` field in the response to determine the outcome of the operation.
|
|
24
|
+
# @param phonenumber [Integer]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [Object]
|
|
27
|
+
def carrier_paid_lookup(phonenumber, opts = {})
|
|
28
|
+
data, _status_code, _headers = carrier_paid_lookup_with_http_info(phonenumber, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Lookup
|
|
33
|
+
# This API endpoint is used to perform a paid lookup for a phone number. The request is sent via an HTTP POST method to the following URL: `https://api.smspool.net/carrier/paid_lookup` ``` json { \"success\": true, \"phonenumber\": \"\", \"country\": \"\", \"carrier\": \"\", \"carrier_type\": \"\", \"charge\": 0 } ``` The `success` field indicates whether the lookup was successful or not. The `phonenumber` field represents the phone number for which the lookup was performed. The `country` field indicates the country associated with the phone number. The `carrier` field provides the name of the carrier associated with the phone number. The `carrier_type` field specifies the type of carrier. The `charge` field represents the cost charged for the lookup operation. Please note that specific values for `phonenumber`, `country`, `carrier`, and `carrier_type` were not provided in the response, and the `charge` field had a value of 0. To use this endpoint, send an HTTP POST request to the provided URL with the necessary parameters. The request should include the phone number for which you want to perform the lookup. The response will contain the details of the carrier and associated information. Make sure to handle any errors that may occur during the lookup process and check the `success` field in the response to determine the outcome of the operation.
|
|
34
|
+
# @param phonenumber [Integer]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
37
|
+
def carrier_paid_lookup_with_http_info(phonenumber, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: CarrierApi.carrier_paid_lookup ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'phonenumber' is set
|
|
42
|
+
if @api_client.config.client_side_validation && phonenumber.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'phonenumber' when calling CarrierApi.carrier_paid_lookup"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/carrier/paid_lookup'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
form_params['phonenumber'] = phonenumber
|
|
64
|
+
|
|
65
|
+
# http body (model)
|
|
66
|
+
post_body = opts[:debug_body]
|
|
67
|
+
|
|
68
|
+
# return_type
|
|
69
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
70
|
+
|
|
71
|
+
# auth_names
|
|
72
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
73
|
+
|
|
74
|
+
new_options = opts.merge(
|
|
75
|
+
:operation => :"CarrierApi.carrier_paid_lookup",
|
|
76
|
+
:header_params => header_params,
|
|
77
|
+
:query_params => query_params,
|
|
78
|
+
:form_params => form_params,
|
|
79
|
+
:body => post_body,
|
|
80
|
+
:auth_names => auth_names,
|
|
81
|
+
:return_type => return_type
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
85
|
+
if @api_client.config.debugging
|
|
86
|
+
@api_client.config.logger.debug "API called: CarrierApi#carrier_paid_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
87
|
+
end
|
|
88
|
+
return data, status_code, headers
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|