|
| 1 | +# MessenteApi::NumberVerificationApi |
| 2 | + |
| 3 | +All URIs are relative to *https://api.messente.com/v1* |
| 4 | + |
| 5 | +| Method | HTTP request | Description | |
| 6 | +| ------ | ------------ | ----------- | |
| 7 | +| [**verify_number**](NumberVerificationApi.md#verify_number) | **POST** /verify/start | verify number | |
| 8 | +| [**verify_pin**](NumberVerificationApi.md#verify_pin) | **POST** /verify/pin | verified the PIN code entered by the user. | |
| 9 | + |
| 10 | + |
| 11 | +## verify_number |
| 12 | + |
| 13 | +> String verify_number(username, password, to, opts) |
| 14 | +
|
| 15 | +verify number |
| 16 | + |
| 17 | +### Examples |
| 18 | + |
| 19 | +```ruby |
| 20 | +require 'time' |
| 21 | +require 'messente_api' |
| 22 | +# setup authorization |
| 23 | +MessenteApi.configure do |config| |
| 24 | + # Configure API key authorization: apiPassword |
| 25 | + config.api_key['password'] = 'YOUR API KEY' |
| 26 | + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) |
| 27 | + # config.api_key_prefix['password'] = 'Bearer' |
| 28 | + |
| 29 | + # Configure API key authorization: apiUsername |
| 30 | + config.api_key['username'] = 'YOUR API KEY' |
| 31 | + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) |
| 32 | + # config.api_key_prefix['username'] = 'Bearer' |
| 33 | +end |
| 34 | + |
| 35 | +api_instance = MessenteApi::NumberVerificationApi.new |
| 36 | +username = 'username_example' # String | The API username |
| 37 | +password = 'password_example' # String | The API password |
| 38 | +to = 'to_example' # String | Receiver's phone number with the country code |
| 39 | +opts = { |
| 40 | + template: 'template_example', # String | Template of the message, including PIN code. Placeholder for PIN code is <PIN>. When not set, default template is used: \"Your Verification PIN code is <PIN>\". |
| 41 | + pin_length: 'pin_length_example', # String | Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4. |
| 42 | + from: 'from_example', # String | Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand. |
| 43 | + max_tries: 'max_tries_example', # String | Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. |
| 44 | + retry_delay: 'retry_delay_example', # String | For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds. |
| 45 | + validity: 'validity_example', # String | For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds). |
| 46 | + ip: 'ip_example', # String | IP address of the client making verification request. |
| 47 | + browser: 'browser_example', # String | User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". |
| 48 | + cookie: 'cookie_example' # String | Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. |
| 49 | +} |
| 50 | + |
| 51 | +begin |
| 52 | + # verify number |
| 53 | + result = api_instance.verify_number(username, password, to, opts) |
| 54 | + p result |
| 55 | +rescue MessenteApi::ApiError => e |
| 56 | + puts "Error when calling NumberVerificationApi->verify_number: #{e}" |
| 57 | +end |
| 58 | +``` |
| 59 | + |
| 60 | +#### Using the verify_number_with_http_info variant |
| 61 | + |
| 62 | +This returns an Array which contains the response data, status code and headers. |
| 63 | + |
| 64 | +> <Array(String, Integer, Hash)> verify_number_with_http_info(username, password, to, opts) |
| 65 | +
|
| 66 | +```ruby |
| 67 | +begin |
| 68 | + # verify number |
| 69 | + data, status_code, headers = api_instance.verify_number_with_http_info(username, password, to, opts) |
| 70 | + p status_code # => 2xx |
| 71 | + p headers # => { ... } |
| 72 | + p data # => String |
| 73 | +rescue MessenteApi::ApiError => e |
| 74 | + puts "Error when calling NumberVerificationApi->verify_number_with_http_info: #{e}" |
| 75 | +end |
| 76 | +``` |
| 77 | + |
| 78 | +### Parameters |
| 79 | + |
| 80 | +| Name | Type | Description | Notes | |
| 81 | +| ---- | ---- | ----------- | ----- | |
| 82 | +| **username** | **String** | The API username | | |
| 83 | +| **password** | **String** | The API password | | |
| 84 | +| **to** | **String** | Receiver's phone number with the country code | | |
| 85 | +| **template** | **String** | Template of the message, including PIN code. Placeholder for PIN code is <PIN>. When not set, default template is used: \"Your Verification PIN code is <PIN>\". | [optional] | |
| 86 | +| **pin_length** | **String** | Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4. | [optional] | |
| 87 | +| **from** | **String** | Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand. | [optional] | |
| 88 | +| **max_tries** | **String** | Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. | [optional] | |
| 89 | +| **retry_delay** | **String** | For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds. | [optional] | |
| 90 | +| **validity** | **String** | For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds). | [optional] | |
| 91 | +| **ip** | **String** | IP address of the client making verification request. | [optional] | |
| 92 | +| **browser** | **String** | User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". | [optional] | |
| 93 | +| **cookie** | **String** | Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. | [optional] | |
| 94 | + |
| 95 | +### Return type |
| 96 | + |
| 97 | +**String** |
| 98 | + |
| 99 | +### Authorization |
| 100 | + |
| 101 | +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) |
| 102 | + |
| 103 | +### HTTP request headers |
| 104 | + |
| 105 | +- **Content-Type**: Not defined |
| 106 | +- **Accept**: text/plain |
| 107 | + |
| 108 | + |
| 109 | +## verify_pin |
| 110 | + |
| 111 | +> String verify_pin(username, password, verification_id, pin, opts) |
| 112 | +
|
| 113 | +verified the PIN code entered by the user. |
| 114 | + |
| 115 | +### Examples |
| 116 | + |
| 117 | +```ruby |
| 118 | +require 'time' |
| 119 | +require 'messente_api' |
| 120 | +# setup authorization |
| 121 | +MessenteApi.configure do |config| |
| 122 | + # Configure API key authorization: apiPassword |
| 123 | + config.api_key['password'] = 'YOUR API KEY' |
| 124 | + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) |
| 125 | + # config.api_key_prefix['password'] = 'Bearer' |
| 126 | + |
| 127 | + # Configure API key authorization: apiUsername |
| 128 | + config.api_key['username'] = 'YOUR API KEY' |
| 129 | + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) |
| 130 | + # config.api_key_prefix['username'] = 'Bearer' |
| 131 | +end |
| 132 | + |
| 133 | +api_instance = MessenteApi::NumberVerificationApi.new |
| 134 | +username = 'username_example' # String | The API username |
| 135 | +password = 'password_example' # String | The API password |
| 136 | +verification_id = 'verification_id_example' # String | Verification ID returned by the successful verification request. |
| 137 | +pin = 'pin_example' # String | PIN code entered by the user. |
| 138 | +opts = { |
| 139 | + ip: 'ip_example', # String | IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match. |
| 140 | + browser: 'browser_example', # String | User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". |
| 141 | + cookie: 'cookie_example' # String | Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. |
| 142 | +} |
| 143 | + |
| 144 | +begin |
| 145 | + # verified the PIN code entered by the user. |
| 146 | + result = api_instance.verify_pin(username, password, verification_id, pin, opts) |
| 147 | + p result |
| 148 | +rescue MessenteApi::ApiError => e |
| 149 | + puts "Error when calling NumberVerificationApi->verify_pin: #{e}" |
| 150 | +end |
| 151 | +``` |
| 152 | + |
| 153 | +#### Using the verify_pin_with_http_info variant |
| 154 | + |
| 155 | +This returns an Array which contains the response data, status code and headers. |
| 156 | + |
| 157 | +> <Array(String, Integer, Hash)> verify_pin_with_http_info(username, password, verification_id, pin, opts) |
| 158 | +
|
| 159 | +```ruby |
| 160 | +begin |
| 161 | + # verified the PIN code entered by the user. |
| 162 | + data, status_code, headers = api_instance.verify_pin_with_http_info(username, password, verification_id, pin, opts) |
| 163 | + p status_code # => 2xx |
| 164 | + p headers # => { ... } |
| 165 | + p data # => String |
| 166 | +rescue MessenteApi::ApiError => e |
| 167 | + puts "Error when calling NumberVerificationApi->verify_pin_with_http_info: #{e}" |
| 168 | +end |
| 169 | +``` |
| 170 | + |
| 171 | +### Parameters |
| 172 | + |
| 173 | +| Name | Type | Description | Notes | |
| 174 | +| ---- | ---- | ----------- | ----- | |
| 175 | +| **username** | **String** | The API username | | |
| 176 | +| **password** | **String** | The API password | | |
| 177 | +| **verification_id** | **String** | Verification ID returned by the successful verification request. | | |
| 178 | +| **pin** | **String** | PIN code entered by the user. | | |
| 179 | +| **ip** | **String** | IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match. | [optional] | |
| 180 | +| **browser** | **String** | User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". | [optional] | |
| 181 | +| **cookie** | **String** | Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. | [optional] | |
| 182 | + |
| 183 | +### Return type |
| 184 | + |
| 185 | +**String** |
| 186 | + |
| 187 | +### Authorization |
| 188 | + |
| 189 | +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) |
| 190 | + |
| 191 | +### HTTP request headers |
| 192 | + |
| 193 | +- **Content-Type**: Not defined |
| 194 | +- **Accept**: text/plain |
| 195 | + |
0 commit comments