Class: Zernio::PhoneNumbersApi
- Inherits:
-
Object
- Object
- Zernio::PhoneNumbersApi
- Defined in:
- lib/zernio-sdk/api/phone_numbers_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#cancel_phone_number_port_in(id, opts = {}) ⇒ CancelPhoneNumberPortIn200Response
Cancel a port-in Cancel an in-flight port (wrong number, staying with the old carrier).
-
#cancel_phone_number_port_in_with_http_info(id, opts = {}) ⇒ Array<(CancelPhoneNumberPortIn200Response, Integer, Hash)>
Cancel a port-in Cancel an in-flight port (wrong number, staying with the old carrier).
-
#check_phone_number_availability(country, opts = {}) ⇒ CheckPhoneNumberAvailability200Response
Check country availability Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days).
-
#check_phone_number_availability_with_http_info(country, opts = {}) ⇒ Array<(CheckPhoneNumberAvailability200Response, Integer, Hash)>
Check country availability Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days).
-
#check_phone_number_portability(check_phone_number_portability_request, opts = {}) ⇒ CheckPhoneNumberPortability200Response
Check portability Pre-flight portability check: whether each number can be ported in, whether it qualifies for FastPort, and its current carrier and line type where the carrier lookup knows them, BEFORE the user commits to a port order (LOA, invoice, service address).
-
#check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts = {}) ⇒ Array<(CheckPhoneNumberPortability200Response, Integer, Hash)>
Check portability Pre-flight portability check: whether each number can be ported in, whether it qualifies for FastPort, and its current carrier and line type where the carrier lookup knows them, BEFORE the user commits to a port order (LOA, invoice, service address).
-
#create_phone_number_kyc_link(create_phone_number_kyc_link_request, opts = {}) ⇒ CreatePhoneNumberKycLink200Response
Create a hosted KYC link Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login.
-
#create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts = {}) ⇒ Array<(CreatePhoneNumberKycLink200Response, Integer, Hash)>
Create a hosted KYC link Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login.
-
#create_phone_number_port_in(create_phone_number_port_in_request, opts = {}) ⇒ CreatePhoneNumberPortIn201Response
Port numbers in Submit a port-in for one or more existing numbers from another carrier.
-
#create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts = {}) ⇒ Array<(CreatePhoneNumberPortIn201Response, Integer, Hash)>
Port numbers in Submit a port-in for one or more existing numbers from another carrier.
-
#create_phone_number_stock_watch(create_phone_number_stock_watch_request, opts = {}) ⇒ PhoneNumberStockWatch
Watch an out-of-stock country Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the
phone_number.stock_availablewebhook. -
#create_phone_number_stock_watch_with_http_info(create_phone_number_stock_watch_request, opts = {}) ⇒ Array<(PhoneNumberStockWatch, Integer, Hash)>
Watch an out-of-stock country Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook.
-
#delete_phone_number_stock_watch(id, opts = {}) ⇒ DeleteSmsSenderId200Response
Stop watching a country.
-
#delete_phone_number_stock_watch_with_http_info(id, opts = {}) ⇒ Array<(DeleteSmsSenderId200Response, Integer, Hash)>
Stop watching a country.
-
#get_phone_number(id, opts = {}) ⇒ GetPhoneNumber200Response
Get phone number Retrieve the current status of a purchased phone number.
-
#get_phone_number_claim(claim_id, opts = {}) ⇒ GetPhoneNumberClaim200Response
Resolve a number claim Resolves a
claimIdfrom a keyless search or purchase into the selection it carries (country, number type, area and exact number) priced at today's rate. -
#get_phone_number_claim_with_http_info(claim_id, opts = {}) ⇒ Array<(GetPhoneNumberClaim200Response, Integer, Hash)>
Resolve a number claim Resolves a `claimId` from a keyless search or purchase into the selection it carries (country, number type, area and exact number) priced at today's rate.
-
#get_phone_number_kyc_form(country, opts = {}) ⇒ GetPhoneNumberKycForm200Response
Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.
-
#get_phone_number_kyc_form_with_http_info(country, opts = {}) ⇒ Array<(GetPhoneNumberKycForm200Response, Integer, Hash)>
Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.
-
#get_phone_number_port_claim(claim_id, opts = {}) ⇒ GetPhoneNumberPortClaim200Response
Resolve a port claim Resolves a
claimIdfrom a keyless portability check into the number it carries. -
#get_phone_number_port_claim_with_http_info(claim_id, opts = {}) ⇒ Array<(GetPhoneNumberPortClaim200Response, Integer, Hash)>
Resolve a port claim Resolves a `claimId` from a keyless portability check into the number it carries.
-
#get_phone_number_port_in_order_requirements(id, opts = {}) ⇒ GetPhoneNumberPortInOrderRequirements200Response
A port-in order's pending requirements The live requirements on an EXISTING porting order: which are filled, which are still pending, and which bounced on review (
requirement-info-exception). -
#get_phone_number_port_in_order_requirements_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumberPortInOrderRequirements200Response, Integer, Hash)>
A port-in order's pending requirements The live requirements on an EXISTING porting order: which are filled, which are still pending, and which bounced on review (`requirement-info-exception`).
-
#get_phone_number_port_in_requirements(country, opts = {}) ⇒ GetPhoneNumberPortInRequirements200Response
Country porting requirements The country-specific information a port-in needs BEYOND the LOA, invoice, and account/address details, such as an ID copy, proof of address, a tax id, or a porting code.
-
#get_phone_number_port_in_requirements_with_http_info(country, opts = {}) ⇒ Array<(GetPhoneNumberPortInRequirements200Response, Integer, Hash)>
Country porting requirements The country-specific information a port-in needs BEYOND the LOA, invoice, and account/address details, such as an ID copy, proof of address, a tax id, or a porting code.
-
#get_phone_number_remediation(id, opts = {}) ⇒ GetPhoneNumberRemediation200Response
Get declined requirements For a number in
regulatory_declined, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). -
#get_phone_number_remediation_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumberRemediation200Response, Integer, Hash)>
Get declined requirements For a number in `regulatory_declined`, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET).
-
#get_phone_number_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumber200Response, Integer, Hash)>
Get phone number Retrieve the current status of a purchased phone number.
-
#initialize(api_client = ApiClient.default) ⇒ PhoneNumbersApi
constructor
A new instance of PhoneNumbersApi.
-
#list_phone_number_countries(opts = {}) ⇒ ListPhoneNumberCountries200Response
List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound).
-
#list_phone_number_countries_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberCountries200Response, Integer, Hash)>
List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound).
-
#list_phone_number_port_ins(opts = {}) ⇒ ListPhoneNumberPortIns200Response
List port-in orders Your porting orders, newest first (max 50).
-
#list_phone_number_port_ins_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberPortIns200Response, Integer, Hash)>
List port-in orders Your porting orders, newest first (max 50).
-
#list_phone_number_stock_watches(opts = {}) ⇒ ListPhoneNumberStockWatches200Response
List stock watches.
-
#list_phone_number_stock_watches_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberStockWatches200Response, Integer, Hash)>
List stock watches.
-
#list_phone_numbers(opts = {}) ⇒ ListPhoneNumbers200Response
List phone numbers List all phone numbers purchased by the authenticated user.
-
#list_phone_numbers_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumbers200Response, Integer, Hash)>
List phone numbers List all phone numbers purchased by the authenticated user.
-
#purchase_phone_number(purchase_phone_number_request, opts = {}) ⇒ PurchasePhoneNumber200Response
Purchase phone number Payment-first: the system provisions a number and auto-assigns it, unless you pass
phoneNumberto buy one exact number fromGET /v1/phone-numbers/available. -
#purchase_phone_number_with_http_info(purchase_phone_number_request, opts = {}) ⇒ Array<(PurchasePhoneNumber200Response, Integer, Hash)>
Purchase phone number Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`.
-
#release_phone_number(id, opts = {}) ⇒ ReleasePhoneNumber200Response
Release phone number Release a purchased phone number.
-
#release_phone_number_with_http_info(id, opts = {}) ⇒ Array<(ReleasePhoneNumber200Response, Integer, Hash)>
Release phone number Release a purchased phone number.
-
#remediate_phone_number(id, remediate_phone_number_request, opts = {}) ⇒ RemediatePhoneNumber200Response
Resubmit a declined number Submit corrected values/documents for the declined requirement(s).
-
#remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts = {}) ⇒ Array<(RemediatePhoneNumber200Response, Integer, Hash)>
Resubmit a declined number Submit corrected values/documents for the declined requirement(s).
-
#reply_to_phone_number_reviewer(id, reply_to_phone_number_reviewer_request, opts = {}) ⇒ ReplyToPhoneNumberReviewer200Response
Reply to the regulatory reviewer Post a free-text reply (with optional file attachments) to the reviewer on a number awaiting remediation, for asks the structured form can't express (e.g. "is this personal or business?").
-
#reply_to_phone_number_reviewer_with_http_info(id, reply_to_phone_number_reviewer_request, opts = {}) ⇒ Array<(ReplyToPhoneNumberReviewer200Response, Integer, Hash)>
Reply to the regulatory reviewer Post a free-text reply (with optional file attachments) to the reviewer on a number awaiting remediation, for asks the structured form can't express (e.g. "is this personal or business?").
-
#respond_to_phone_number_reviewer(id, respond_to_phone_number_reviewer_request, opts = {}) ⇒ RespondToPhoneNumberReviewer200Response
Respond to the regulatory reviewer (message + corrections) Send a single response to the reviewer on a number awaiting remediation: a free-text message and/or corrected requirement documents, in one call.
-
#respond_to_phone_number_reviewer_with_http_info(id, respond_to_phone_number_reviewer_request, opts = {}) ⇒ Array<(RespondToPhoneNumberReviewer200Response, Integer, Hash)>
Respond to the regulatory reviewer (message + corrections) Send a single response to the reviewer on a number awaiting remediation: a free-text message and/or corrected requirement documents, in one call.
-
#review_phone_number_kyc_packet(review_phone_number_kyc_packet_request, opts = {}) ⇒ ReviewPhoneNumberKycPacket200Response
Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans).
-
#review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts = {}) ⇒ Array<(ReviewPhoneNumberKycPacket200Response, Integer, Hash)>
Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans).
-
#search_available_phone_numbers(opts = {}) ⇒ SearchAvailablePhoneNumbers200Response
Search available numbers Search the provider's inventory for numbers available to purchase in a country (default US).
-
#search_available_phone_numbers_with_http_info(opts = {}) ⇒ Array<(SearchAvailablePhoneNumbers200Response, Integer, Hash)>
Search available numbers Search the provider's inventory for numbers available to purchase in a country (default US).
-
#submit_phone_number_kyc(submit_phone_number_kyc_request, opts = {}) ⇒ SubmitPhoneNumberKyc200Response
Submit KYC Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country.
-
#submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts = {}) ⇒ Array<(SubmitPhoneNumberKyc200Response, Integer, Hash)>
Submit KYC Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country.
-
#upload_phone_number_kyc_document(x_filename, body, opts = {}) ⇒ UploadPhoneNumberKycDocument200Response
Upload a KYC document Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via
documents[].documentId. -
#upload_phone_number_kyc_document_with_http_info(x_filename, body, opts = {}) ⇒ Array<(UploadPhoneNumberKycDocument200Response, Integer, Hash)>
Upload a KYC document Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via `documents.documentId`.
-
#upload_phone_number_port_in_document(file, opts = {}) ⇒ UploadPhoneNumberPortInDocument200Response
Upload a porting document Upload ONE porting document and get back its
documentId. -
#upload_phone_number_port_in_document_with_http_info(file, opts = {}) ⇒ Array<(UploadPhoneNumberPortInDocument200Response, Integer, Hash)>
Upload a porting document Upload ONE porting document and get back its `documentId`.
-
#validate_phone_number_kyc_address(validate_phone_number_kyc_address_request, opts = {}) ⇒ ValidatePhoneNumberKycAddress200Response
Pre-validate KYC address Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded.
-
#validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {}) ⇒ Array<(ValidatePhoneNumberKycAddress200Response, Integer, Hash)>
Pre-validate KYC address Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded.
-
#view_phone_number_kyc_document(document_id, opts = {}) ⇒ File
View a KYC document on file Stream a document backing a reusable verification (the
documentIdvalues from GET /v1/phone-numbers/kycreusable.options[].details[]), so the account holder can see what's on file before reusing it. - #view_phone_number_kyc_document_with_http_info(document_id, opts = {}) ⇒ Array<(File, Integer, Hash)>
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ PhoneNumbersApi
Returns a new instance of PhoneNumbersApi.
19 20 21 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#cancel_phone_number_port_in(id, opts = {}) ⇒ CancelPhoneNumberPortIn200Response
Cancel a port-in
Cancel an in-flight port (wrong number, staying with the old carrier). Only orders that haven't ported can be cancelled; a completed port is a normal number release instead. The carrier may report cancel-pending briefly while the losing carrier acknowledges; it settles to cancelled.
27 28 29 30 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 27 def cancel_phone_number_port_in(id, opts = {}) data, _status_code, _headers = cancel_phone_number_port_in_with_http_info(id, opts) data end |
#cancel_phone_number_port_in_with_http_info(id, opts = {}) ⇒ Array<(CancelPhoneNumberPortIn200Response, Integer, Hash)>
Cancel a port-in Cancel an in-flight port (wrong number, staying with the old carrier). Only orders that haven't ported can be cancelled; a completed port is a normal number release instead. The carrier may report `cancel-pending` briefly while the losing carrier acknowledges; it settles to `cancelled`.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 37 def cancel_phone_number_port_in_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.cancel_phone_number_port_in ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.cancel_phone_number_port_in" end # resource path local_var_path = '/v1/phone-numbers/port-in/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CancelPhoneNumberPortIn200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.cancel_phone_number_port_in", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#cancel_phone_number_port_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#check_phone_number_availability(country, opts = {}) ⇒ CheckPhoneNumberAvailability200Response
Check country availability
Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - addressConstraint: geo → the registered address MUST be in one of the returned areas (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - addressConstraint: country → any in-country address works. - addressConstraint: none → field-only / instant country, no address. Call this before starting the KYC form for regulated countries. Without an API key it answers from cache only and returns just country, numberType and areaOptions, for building an area picker before signup.
92 93 94 95 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 92 def check_phone_number_availability(country, opts = {}) data, _status_code, _headers = check_phone_number_availability_with_http_info(country, opts) data end |
#check_phone_number_availability_with_http_info(country, opts = {}) ⇒ Array<(CheckPhoneNumberAvailability200Response, Integer, Hash)>
Check country availability Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - `addressConstraint: geo` → the registered address MUST be in one of the returned `areas` (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - `addressConstraint: country` → any in-country address works. - `addressConstraint: none` → field-only / instant country, no address. Call this before starting the KYC form for regulated countries. Without an API key it answers from cache only and returns just `country`, `numberType` and `areaOptions`, for building an area picker before signup.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 104 def check_phone_number_availability_with_http_info(country, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.check_phone_number_availability ...' end # verify the required parameter 'country' is set if @api_client.config.client_side_validation && country.nil? fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.check_phone_number_availability" end allowable_values = ["local", "mobile", "national", "toll_free"] if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type']) fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/phone-numbers/availability' # query parameters query_params = opts[:query_params] || {} query_params[:'country'] = country query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil? query_params[:'sms'] = opts[:'sms'] if !opts[:'sms'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CheckPhoneNumberAvailability200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.check_phone_number_availability", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#check_phone_number_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#check_phone_number_portability(check_phone_number_portability_request, opts = {}) ⇒ CheckPhoneNumberPortability200Response
Check portability
Pre-flight portability check: whether each number can be ported in, whether it qualifies for FastPort, and its current carrier and line type where the carrier lookup knows them, BEFORE the user commits to a port order (LOA, invoice, service address). Read-only; creates no order and bills nothing. Works without an API key for one number per request. Keyless calls are what the checker at https://zernio.com/port-your-number makes: they must come from that page (a browser bot check rejects scripted callers with 401), are limited per IP (3 a minute, 10 a day) and by a shared daily budget (429 once spent), because each check runs a paid carrier lookup. Each portable keyless result carries a claimId and a claimUrl: a signup link that opens the dashboard's port form with the number filled in. Send an API key to check up to 50 numbers without those limits.
164 165 166 167 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 164 def check_phone_number_portability(check_phone_number_portability_request, opts = {}) data, _status_code, _headers = check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts) data end |
#check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts = {}) ⇒ Array<(CheckPhoneNumberPortability200Response, Integer, Hash)>
Check portability Pre-flight portability check: whether each number can be ported in, whether it qualifies for FastPort, and its current carrier and line type where the carrier lookup knows them, BEFORE the user commits to a port order (LOA, invoice, service address). Read-only; creates no order and bills nothing. Works without an API key for one number per request. Keyless calls are what the checker at https://zernio.com/port-your-number makes: they must come from that page (a browser bot check rejects scripted callers with 401), are limited per IP (3 a minute, 10 a day) and by a shared daily budget (429 once spent), because each check runs a paid carrier lookup. Each portable keyless result carries a `claimId` and a `claimUrl`: a signup link that opens the dashboard's port form with the number filled in. Send an API key to check up to 50 numbers without those limits.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 174 def check_phone_number_portability_with_http_info(check_phone_number_portability_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.check_phone_number_portability ...' end # verify the required parameter 'check_phone_number_portability_request' is set if @api_client.config.client_side_validation && check_phone_number_portability_request.nil? fail ArgumentError, "Missing the required parameter 'check_phone_number_portability_request' when calling PhoneNumbersApi.check_phone_number_portability" end # resource path local_var_path = '/v1/phone-numbers/port-in/check' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(check_phone_number_portability_request) # return_type return_type = opts[:debug_return_type] || 'CheckPhoneNumberPortability200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.check_phone_number_portability", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#check_phone_number_portability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_phone_number_kyc_link(create_phone_number_kyc_link_request, opts = {}) ⇒ CreatePhoneNumberKycLink200Response
Create a hosted KYC link
Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login. Useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. Pass numberType (local, mobile, national, toll_free) to choose which of the country's offered types the shared form collects KYC for and eventually orders; omitted defaults to the country's default type (which may be national and therefore have no inventory in a geographic area code). Pass areaCode (NDC digits) to constrain the eventual order to a specific area; it is validated against the chosen numberType. White-label the page with branding (your company name, logo, brand color). Supply redirect_url to send the end customer back to your own site after a successful submit (completion params are appended; see below). Listen for the whatsapp.number.kyc_submitted webhook to react when the form is completed.
232 233 234 235 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 232 def create_phone_number_kyc_link(create_phone_number_kyc_link_request, opts = {}) data, _status_code, _headers = create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts) data end |
#create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts = {}) ⇒ Array<(CreatePhoneNumberKycLink200Response, Integer, Hash)>
Create a hosted KYC link Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login. Useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. Pass `numberType` (`local`, `mobile`, `national`, `toll_free`) to choose which of the country's offered types the shared form collects KYC for and eventually orders; omitted defaults to the country's default type (which may be `national` and therefore have no inventory in a geographic area code). Pass `areaCode` (NDC digits) to constrain the eventual order to a specific area; it is validated against the chosen `numberType`. White-label the page with `branding` (your company name, logo, brand color). Supply `redirect_url` to send the end customer back to your own site after a successful submit (completion params are appended; see below). Listen for the `whatsapp.number.kyc_submitted` webhook to react when the form is completed.
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 242 def create_phone_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.create_phone_number_kyc_link ...' end # verify the required parameter 'create_phone_number_kyc_link_request' is set if @api_client.config.client_side_validation && create_phone_number_kyc_link_request.nil? fail ArgumentError, "Missing the required parameter 'create_phone_number_kyc_link_request' when calling PhoneNumbersApi.create_phone_number_kyc_link" end # resource path local_var_path = '/v1/phone-numbers/kyc/share' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_phone_number_kyc_link_request) # return_type return_type = opts[:debug_return_type] || 'CreatePhoneNumberKycLink200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.create_phone_number_kyc_link", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#create_phone_number_kyc_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_phone_number_port_in(create_phone_number_port_in_request, opts = {}) ⇒ CreatePhoneNumberPortIn201Response
Port numbers in
Submit a port-in for one or more existing numbers from another carrier. Creates the carrier order(s), attaches the end-user (current account) info plus the LOA and invoice documents, and submits to the losing carrier. The transfer PIN is forwarded to the carrier and never stored. Ported numbers arrive voice-ready (and SMS-ready where the order supports messaging). Run the portability check (POST /v1/phone-numbers/port-in/check) and upload the two documents (POST /v1/phone-numbers/port-in/documents) first. Uploaded documents must be attached to an order within 30 minutes or the carrier deletes them, so upload right before this call. The carrier may split the numbers into several orders (by country, number type, losing carrier); orders carries per-order results, and a partial failure still returns 201 with the failed orders' error set (they stay as cancellable drafts). Non-US/CA numbers additionally need the country-specific values from GET /v1/phone-numbers/port-in/requirements, passed via requirements, and must be submitted one country per request. When required information is still missing after submission, the order is kept as a resumable draft whose error / declineReason names the gaps.
300 301 302 303 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 300 def create_phone_number_port_in(create_phone_number_port_in_request, opts = {}) data, _status_code, _headers = create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts) data end |
#create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts = {}) ⇒ Array<(CreatePhoneNumberPortIn201Response, Integer, Hash)>
Port numbers in Submit a port-in for one or more existing numbers from another carrier. Creates the carrier order(s), attaches the end-user (current account) info plus the LOA and invoice documents, and submits to the losing carrier. The transfer PIN is forwarded to the carrier and never stored. Ported numbers arrive voice-ready (and SMS-ready where the order supports messaging). Run the portability check (POST /v1/phone-numbers/port-in/check) and upload the two documents (POST /v1/phone-numbers/port-in/documents) first. Uploaded documents must be attached to an order within 30 minutes or the carrier deletes them, so upload right before this call. The carrier may split the numbers into several orders (by country, number type, losing carrier); `orders` carries per-order results, and a partial failure still returns 201 with the failed orders' `error` set (they stay as cancellable drafts). Non-US/CA numbers additionally need the country-specific values from GET /v1/phone-numbers/port-in/requirements, passed via `requirements`, and must be submitted one country per request. When required information is still missing after submission, the order is kept as a resumable draft whose `error` / `declineReason` names the gaps.
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 310 def create_phone_number_port_in_with_http_info(create_phone_number_port_in_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.create_phone_number_port_in ...' end # verify the required parameter 'create_phone_number_port_in_request' is set if @api_client.config.client_side_validation && create_phone_number_port_in_request.nil? fail ArgumentError, "Missing the required parameter 'create_phone_number_port_in_request' when calling PhoneNumbersApi.create_phone_number_port_in" end # resource path local_var_path = '/v1/phone-numbers/port-in' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_phone_number_port_in_request) # return_type return_type = opts[:debug_return_type] || 'CreatePhoneNumberPortIn201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.create_phone_number_port_in", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#create_phone_number_port_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_phone_number_stock_watch(create_phone_number_stock_watch_request, opts = {}) ⇒ PhoneNumberStockWatch
Watch an out-of-stock country
Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the phone_number.stock_available webhook. Stock is re-checked every 6h. One watch per country and number type; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 watches at once. Countries and types marked fulfilment: request by GET /v1/phone-numbers/countries can also be watched, but anything with preOrderable: true does not need a watch: submit KYC and the carrier sources the number to order. Pass areaCode (with numberType) to watch one sold-out area, for example an entry of soldOutAreas from GET /v1/phone-numbers/availability. Area stock is checked live on the same 6h cadence.
368 369 370 371 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 368 def create_phone_number_stock_watch(create_phone_number_stock_watch_request, opts = {}) data, _status_code, _headers = create_phone_number_stock_watch_with_http_info(create_phone_number_stock_watch_request, opts) data end |
#create_phone_number_stock_watch_with_http_info(create_phone_number_stock_watch_request, opts = {}) ⇒ Array<(PhoneNumberStockWatch, Integer, Hash)>
Watch an out-of-stock country Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country and number type; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 watches at once. Countries and types marked `fulfilment: request` by GET /v1/phone-numbers/countries can also be watched, but anything with `preOrderable: true` does not need a watch: submit KYC and the carrier sources the number to order. Pass `areaCode` (with `numberType`) to watch one sold-out area, for example an entry of `soldOutAreas` from GET /v1/phone-numbers/availability. Area stock is checked live on the same 6h cadence.
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 378 def create_phone_number_stock_watch_with_http_info(create_phone_number_stock_watch_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.create_phone_number_stock_watch ...' end # verify the required parameter 'create_phone_number_stock_watch_request' is set if @api_client.config.client_side_validation && create_phone_number_stock_watch_request.nil? fail ArgumentError, "Missing the required parameter 'create_phone_number_stock_watch_request' when calling PhoneNumbersApi.create_phone_number_stock_watch" end # resource path local_var_path = '/v1/phone-numbers/stock-watches' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_phone_number_stock_watch_request) # return_type return_type = opts[:debug_return_type] || 'PhoneNumberStockWatch' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.create_phone_number_stock_watch", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#create_phone_number_stock_watch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_phone_number_stock_watch(id, opts = {}) ⇒ DeleteSmsSenderId200Response
Stop watching a country
435 436 437 438 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 435 def delete_phone_number_stock_watch(id, opts = {}) data, _status_code, _headers = delete_phone_number_stock_watch_with_http_info(id, opts) data end |
#delete_phone_number_stock_watch_with_http_info(id, opts = {}) ⇒ Array<(DeleteSmsSenderId200Response, Integer, Hash)>
Stop watching a country
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 444 def delete_phone_number_stock_watch_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.delete_phone_number_stock_watch ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.delete_phone_number_stock_watch" end # resource path local_var_path = '/v1/phone-numbers/stock-watches/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteSmsSenderId200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.delete_phone_number_stock_watch", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#delete_phone_number_stock_watch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_phone_number(id, opts = {}) ⇒ GetPhoneNumber200Response
Get phone number
Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, onfidoVerificationUrl appears here once the order is placed. Forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)
497 498 499 500 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 497 def get_phone_number(id, opts = {}) data, _status_code, _headers = get_phone_number_with_http_info(id, opts) data end |
#get_phone_number_claim(claim_id, opts = {}) ⇒ GetPhoneNumberClaim200Response
Resolve a number claim
Resolves a claimId from a keyless search or purchase into the selection it carries (country, number type, area and exact number) priced at today's rate. The dashboard calls it when a person lands from a claimUrl. The number is not held, so buying it can still fail with 409 PHONE_NUMBER_UNAVAILABLE.
560 561 562 563 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 560 def get_phone_number_claim(claim_id, opts = {}) data, _status_code, _headers = get_phone_number_claim_with_http_info(claim_id, opts) data end |
#get_phone_number_claim_with_http_info(claim_id, opts = {}) ⇒ Array<(GetPhoneNumberClaim200Response, Integer, Hash)>
Resolve a number claim Resolves a `claimId` from a keyless search or purchase into the selection it carries (country, number type, area and exact number) priced at today's rate. The dashboard calls it when a person lands from a `claimUrl`. The number is not held, so buying it can still fail with 409 PHONE_NUMBER_UNAVAILABLE.
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 570 def get_phone_number_claim_with_http_info(claim_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_claim ...' end # verify the required parameter 'claim_id' is set if @api_client.config.client_side_validation && claim_id.nil? fail ArgumentError, "Missing the required parameter 'claim_id' when calling PhoneNumbersApi.get_phone_number_claim" end # resource path local_var_path = '/v1/phone-numbers/claims/{claimId}'.sub('{' + 'claimId' + '}', CGI.escape(claim_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetPhoneNumberClaim200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.get_phone_number_claim", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_phone_number_kyc_form(country, opts = {}) ⇒ GetPhoneNumberKycForm200Response
Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.
624 625 626 627 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 624 def get_phone_number_kyc_form(country, opts = {}) data, _status_code, _headers = get_phone_number_kyc_form_with_http_info(country, opts) data end |
#get_phone_number_kyc_form_with_http_info(country, opts = {}) ⇒ Array<(GetPhoneNumberKycForm200Response, Integer, Hash)>
Get KYC form spec For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 635 def get_phone_number_kyc_form_with_http_info(country, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_kyc_form ...' end # verify the required parameter 'country' is set if @api_client.config.client_side_validation && country.nil? fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.get_phone_number_kyc_form" end allowable_values = ["local", "mobile", "national", "toll_free"] if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type']) fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/phone-numbers/kyc' # query parameters query_params = opts[:query_params] || {} query_params[:'country'] = country query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetPhoneNumberKycForm200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.get_phone_number_kyc_form", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_kyc_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_phone_number_port_claim(claim_id, opts = {}) ⇒ GetPhoneNumberPortClaim200Response
Resolve a port claim
Resolves a claimId from a keyless portability check into the number it carries. The dashboard calls it when a person lands from a port claimUrl, to open the port form with that number filled in. It does not start a port.
694 695 696 697 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 694 def get_phone_number_port_claim(claim_id, opts = {}) data, _status_code, _headers = get_phone_number_port_claim_with_http_info(claim_id, opts) data end |
#get_phone_number_port_claim_with_http_info(claim_id, opts = {}) ⇒ Array<(GetPhoneNumberPortClaim200Response, Integer, Hash)>
Resolve a port claim Resolves a `claimId` from a keyless portability check into the number it carries. The dashboard calls it when a person lands from a port `claimUrl`, to open the port form with that number filled in. It does not start a port.
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 704 def get_phone_number_port_claim_with_http_info(claim_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_port_claim ...' end # verify the required parameter 'claim_id' is set if @api_client.config.client_side_validation && claim_id.nil? fail ArgumentError, "Missing the required parameter 'claim_id' when calling PhoneNumbersApi.get_phone_number_port_claim" end # resource path local_var_path = '/v1/phone-numbers/port-in/claims/{claimId}'.sub('{' + 'claimId' + '}', CGI.escape(claim_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetPhoneNumberPortClaim200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.get_phone_number_port_claim", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_port_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_phone_number_port_in_order_requirements(id, opts = {}) ⇒ GetPhoneNumberPortInOrderRequirements200Response
A port-in order's pending requirements
The live requirements on an EXISTING porting order: which are filled, which are still pending, and which bounced on review (requirement-info-exception). Use it to fix and resubmit a rejected international port. Same field shape as the country-level requirements endpoint, plus per-requirement status.
757 758 759 760 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 757 def get_phone_number_port_in_order_requirements(id, opts = {}) data, _status_code, _headers = get_phone_number_port_in_order_requirements_with_http_info(id, opts) data end |
#get_phone_number_port_in_order_requirements_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumberPortInOrderRequirements200Response, Integer, Hash)>
A port-in order's pending requirements The live requirements on an EXISTING porting order: which are filled, which are still pending, and which bounced on review (`requirement-info-exception`). Use it to fix and resubmit a rejected international port. Same field shape as the country-level requirements endpoint, plus per-requirement status.
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 767 def get_phone_number_port_in_order_requirements_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_port_in_order_requirements ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number_port_in_order_requirements" end # resource path local_var_path = '/v1/phone-numbers/port-in/{id}/requirements'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetPhoneNumberPortInOrderRequirements200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.get_phone_number_port_in_order_requirements", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_port_in_order_requirements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_phone_number_port_in_requirements(country, opts = {}) ⇒ GetPhoneNumberPortInRequirements200Response
Country porting requirements
The country-specific information a port-in needs BEYOND the LOA, invoice, and account/address details, such as an ID copy, proof of address, a tax id, or a porting code. Call it after the portability check (which returns each number's countryCode and phoneNumberType), render the fields, and pass the collected values as the create request's requirements. US/CA return an empty list.
821 822 823 824 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 821 def get_phone_number_port_in_requirements(country, opts = {}) data, _status_code, _headers = get_phone_number_port_in_requirements_with_http_info(country, opts) data end |
#get_phone_number_port_in_requirements_with_http_info(country, opts = {}) ⇒ Array<(GetPhoneNumberPortInRequirements200Response, Integer, Hash)>
Country porting requirements The country-specific information a port-in needs BEYOND the LOA, invoice, and account/address details, such as an ID copy, proof of address, a tax id, or a porting code. Call it after the portability check (which returns each number's `countryCode` and `phoneNumberType`), render the fields, and pass the collected values as the create request's `requirements`. US/CA return an empty list.
832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 832 def get_phone_number_port_in_requirements_with_http_info(country, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_port_in_requirements ...' end # verify the required parameter 'country' is set if @api_client.config.client_side_validation && country.nil? fail ArgumentError, "Missing the required parameter 'country' when calling PhoneNumbersApi.get_phone_number_port_in_requirements" end if @api_client.config.client_side_validation && country.to_s.length > 2 fail ArgumentError, 'invalid value for "country" when calling PhoneNumbersApi.get_phone_number_port_in_requirements, the character length must be smaller than or equal to 2.' end if @api_client.config.client_side_validation && country.to_s.length < 2 fail ArgumentError, 'invalid value for "country" when calling PhoneNumbersApi.get_phone_number_port_in_requirements, the character length must be greater than or equal to 2.' end allowable_values = ["local", "mobile", "national", "toll_free"] if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type']) fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/phone-numbers/port-in/requirements' # query parameters query_params = opts[:query_params] || {} query_params[:'country'] = country query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetPhoneNumberPortInRequirements200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.get_phone_number_port_in_requirements", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_port_in_requirements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_phone_number_remediation(id, opts = {}) ⇒ GetPhoneNumberRemediation200Response
Get declined requirements
For a number in regulatory_declined, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes only those, because Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.
899 900 901 902 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 899 def get_phone_number_remediation(id, opts = {}) data, _status_code, _headers = get_phone_number_remediation_with_http_info(id, opts) data end |
#get_phone_number_remediation_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumberRemediation200Response, Integer, Hash)>
Get declined requirements For a number in `regulatory_declined`, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes only those, because Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 909 def get_phone_number_remediation_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number_remediation ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number_remediation" end # resource path local_var_path = '/v1/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetPhoneNumberRemediation200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.get_phone_number_remediation", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number_remediation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_phone_number_with_http_info(id, opts = {}) ⇒ Array<(GetPhoneNumber200Response, Integer, Hash)>
Get phone number Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, `onfidoVerificationUrl` appears here once the order is placed. Forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 507 def get_phone_number_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.get_phone_number ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.get_phone_number" end # resource path local_var_path = '/v1/phone-numbers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetPhoneNumber200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.get_phone_number", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#get_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_phone_number_countries(opts = {}) ⇒ ListPhoneNumberCountries200Response
List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound). Drives the country picker. Tier-4 countries appear only when enabled. No API key needed: the catalog is public so you can browse it before you have an account.
961 962 963 964 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 961 def list_phone_number_countries(opts = {}) data, _status_code, _headers = list_phone_number_countries_with_http_info(opts) data end |
#list_phone_number_countries_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberCountries200Response, Integer, Hash)>
List offerable number countries The phone number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and per-feature availability (PSTN calls, WhatsApp, SMS, and WhatsApp Business Calling outbound). Drives the country picker. Tier-4 countries appear only when enabled. No API key needed: the catalog is public so you can browse it before you have an account.
970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 970 def list_phone_number_countries_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_number_countries ...' end # resource path local_var_path = '/v1/phone-numbers/countries' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListPhoneNumberCountries200Response' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"PhoneNumbersApi.list_phone_number_countries", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_number_countries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_phone_number_port_ins(opts = {}) ⇒ ListPhoneNumberPortIns200Response
List port-in orders Your porting orders, newest first (max 50). Poll this for port progress: pending, confirmed FOC date, exception reason, or ported.
1018 1019 1020 1021 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1018 def list_phone_number_port_ins(opts = {}) data, _status_code, _headers = list_phone_number_port_ins_with_http_info(opts) data end |
#list_phone_number_port_ins_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberPortIns200Response, Integer, Hash)>
List port-in orders Your porting orders, newest first (max 50). Poll this for port progress: pending, confirmed FOC date, exception reason, or ported.
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1027 def list_phone_number_port_ins_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_number_port_ins ...' end # resource path local_var_path = '/v1/phone-numbers/port-in' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListPhoneNumberPortIns200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.list_phone_number_port_ins", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_number_port_ins\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_phone_number_stock_watches(opts = {}) ⇒ ListPhoneNumberStockWatches200Response
List stock watches
1074 1075 1076 1077 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1074 def list_phone_number_stock_watches(opts = {}) data, _status_code, _headers = list_phone_number_stock_watches_with_http_info(opts) data end |
#list_phone_number_stock_watches_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumberStockWatches200Response, Integer, Hash)>
List stock watches
1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1082 def list_phone_number_stock_watches_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_number_stock_watches ...' end # resource path local_var_path = '/v1/phone-numbers/stock-watches' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListPhoneNumberStockWatches200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.list_phone_number_stock_watches", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_number_stock_watches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_phone_numbers(opts = {}) ⇒ ListPhoneNumbers200Response
List phone numbers
List all phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) WhatsApp numbers are returned in the separate connected array; they are not billed and have no provisioning lifecycle.
1132 1133 1134 1135 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1132 def list_phone_numbers(opts = {}) data, _status_code, _headers = list_phone_numbers_with_http_info(opts) data end |
#list_phone_numbers_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumbers200Response, Integer, Hash)>
List phone numbers List all phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) WhatsApp numbers are returned in the separate `connected` array; they are not billed and have no provisioning lifecycle.
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1143 def list_phone_numbers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.list_phone_numbers ...' end allowable_values = ["provisioning", "verifying", "pending_payment", "pending_regulatory", "regulatory_declined", "active", "suspended", "releasing", "released"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/phone-numbers' # query parameters query_params = opts[:query_params] || {} query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListPhoneNumbers200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.list_phone_numbers", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#list_phone_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#purchase_phone_number(purchase_phone_number_request, opts = {}) ⇒ PurchasePhoneNumber200Response
Purchase phone number
Payment-first: the system provisions a number and auto-assigns it, unless you pass phoneNumber to buy one exact number from GET /v1/phone-numbers/available. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns 402 PAYMENT_REQUIRED; a regulated country returns 202 with status: \"kyc_required\" and a kycUrl. The monthly price is the one GET /v1/phone-numbers/countries quotes for that country and numberType at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
1198 1199 1200 1201 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1198 def purchase_phone_number(purchase_phone_number_request, opts = {}) data, _status_code, _headers = purchase_phone_number_with_http_info(purchase_phone_number_request, opts) data end |
#purchase_phone_number_with_http_info(purchase_phone_number_request, opts = {}) ⇒ Array<(PurchasePhoneNumber200Response, Integer, Hash)>
Purchase phone number Payment-first: the system provisions a number and auto-assigns it, unless you pass `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: "kyc_required"` and a `kycUrl`. The monthly price is the one `GET /v1/phone-numbers/countries` quotes for that country and `numberType` at the time of purchase, and it is stamped on the number: later rate-card changes never move a number you already own. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1208 def purchase_phone_number_with_http_info(purchase_phone_number_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.purchase_phone_number ...' end # verify the required parameter 'purchase_phone_number_request' is set if @api_client.config.client_side_validation && purchase_phone_number_request.nil? fail ArgumentError, "Missing the required parameter 'purchase_phone_number_request' when calling PhoneNumbersApi.purchase_phone_number" end # resource path local_var_path = '/v1/phone-numbers/purchase' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(purchase_phone_number_request) # return_type return_type = opts[:debug_return_type] || 'PurchasePhoneNumber200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.purchase_phone_number", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#purchase_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#release_phone_number(id, opts = {}) ⇒ ReleasePhoneNumber200Response
Release phone number Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released
1266 1267 1268 1269 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1266 def release_phone_number(id, opts = {}) data, _status_code, _headers = release_phone_number_with_http_info(id, opts) data end |
#release_phone_number_with_http_info(id, opts = {}) ⇒ Array<(ReleasePhoneNumber200Response, Integer, Hash)>
Release phone number Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released
1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1276 def release_phone_number_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.release_phone_number ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.release_phone_number" end # resource path local_var_path = '/v1/phone-numbers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ReleasePhoneNumber200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.release_phone_number", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#release_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#remediate_phone_number(id, remediate_phone_number_request, opts = {}) ⇒ RemediatePhoneNumber200Response
Resubmit a declined number
Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes regulatory_declined → pending_regulatory. No new number and no new billing. Body shape matches the KYC submit (values / documents / address). Send only the corrected fields.
1330 1331 1332 1333 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1330 def remediate_phone_number(id, remediate_phone_number_request, opts = {}) data, _status_code, _headers = remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts) data end |
#remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts = {}) ⇒ Array<(RemediatePhoneNumber200Response, Integer, Hash)>
Resubmit a declined number Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes `regulatory_declined` → `pending_regulatory`. No new number and no new billing. Body shape matches the KYC submit (values / documents / address). Send only the corrected fields.
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1341 def remediate_phone_number_with_http_info(id, remediate_phone_number_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.remediate_phone_number ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.remediate_phone_number" end # verify the required parameter 'remediate_phone_number_request' is set if @api_client.config.client_side_validation && remediate_phone_number_request.nil? fail ArgumentError, "Missing the required parameter 'remediate_phone_number_request' when calling PhoneNumbersApi.remediate_phone_number" end # resource path local_var_path = '/v1/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(remediate_phone_number_request) # return_type return_type = opts[:debug_return_type] || 'RemediatePhoneNumber200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.remediate_phone_number", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#remediate_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#reply_to_phone_number_reviewer(id, reply_to_phone_number_reviewer_request, opts = {}) ⇒ ReplyToPhoneNumberReviewer200Response
Reply to the regulatory reviewer Post a free-text reply (with optional file attachments) to the reviewer on a number awaiting remediation, for asks the structured form can't express (e.g. "is this personal or business?"). Attachments are stored by us and their links are added to the reviewer's comment thread (the carrier's number order takes no loose files). A reply to a comment-style ask moves the number back to "in review"; a reply on a formal decline is supplementary and you must still resubmit the fix. Requires text or at least one attachment.
1404 1405 1406 1407 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1404 def reply_to_phone_number_reviewer(id, reply_to_phone_number_reviewer_request, opts = {}) data, _status_code, _headers = reply_to_phone_number_reviewer_with_http_info(id, reply_to_phone_number_reviewer_request, opts) data end |
#reply_to_phone_number_reviewer_with_http_info(id, reply_to_phone_number_reviewer_request, opts = {}) ⇒ Array<(ReplyToPhoneNumberReviewer200Response, Integer, Hash)>
Reply to the regulatory reviewer Post a free-text reply (with optional file attachments) to the reviewer on a number awaiting remediation, for asks the structured form can't express (e.g. "is this personal or business?"). Attachments are stored by us and their links are added to the reviewer's comment thread (the carrier's number order takes no loose files). A reply to a comment-style ask moves the number back to "in review"; a reply on a formal decline is supplementary and you must still resubmit the fix. Requires text or at least one attachment.
1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1415 def reply_to_phone_number_reviewer_with_http_info(id, reply_to_phone_number_reviewer_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.reply_to_phone_number_reviewer ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.reply_to_phone_number_reviewer" end # verify the required parameter 'reply_to_phone_number_reviewer_request' is set if @api_client.config.client_side_validation && reply_to_phone_number_reviewer_request.nil? fail ArgumentError, "Missing the required parameter 'reply_to_phone_number_reviewer_request' when calling PhoneNumbersApi.reply_to_phone_number_reviewer" end # resource path local_var_path = '/v1/phone-numbers/{id}/remediate/reply'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(reply_to_phone_number_reviewer_request) # return_type return_type = opts[:debug_return_type] || 'ReplyToPhoneNumberReviewer200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.reply_to_phone_number_reviewer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#reply_to_phone_number_reviewer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#respond_to_phone_number_reviewer(id, respond_to_phone_number_reviewer_request, opts = {}) ⇒ RespondToPhoneNumberReviewer200Response
Respond to the regulatory reviewer (message + corrections)
Send a single response to the reviewer on a number awaiting remediation: a free-text message and/or corrected requirement documents, in one call. If corrections are present they are PATCHed onto the requirement group and re-submitted (the number goes back to "in review"); if a message or file attachments are present they are posted to the reviewer's comment thread. When both are present, your message is the thread comment and the resubmit drives the state change. At least one of message, corrections, or attachments is required. documents correct requirement slots; attachments are loose files (their links are added to your message).
1478 1479 1480 1481 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1478 def respond_to_phone_number_reviewer(id, respond_to_phone_number_reviewer_request, opts = {}) data, _status_code, _headers = respond_to_phone_number_reviewer_with_http_info(id, respond_to_phone_number_reviewer_request, opts) data end |
#respond_to_phone_number_reviewer_with_http_info(id, respond_to_phone_number_reviewer_request, opts = {}) ⇒ Array<(RespondToPhoneNumberReviewer200Response, Integer, Hash)>
Respond to the regulatory reviewer (message + corrections) Send a single response to the reviewer on a number awaiting remediation: a free-text message and/or corrected requirement documents, in one call. If corrections are present they are PATCHed onto the requirement group and re-submitted (the number goes back to "in review"); if a message or file attachments are present they are posted to the reviewer's comment thread. When both are present, your message is the thread comment and the resubmit drives the state change. At least one of message, corrections, or attachments is required. `documents` correct requirement slots; `attachments` are loose files (their links are added to your message).
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1489 def respond_to_phone_number_reviewer_with_http_info(id, respond_to_phone_number_reviewer_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.respond_to_phone_number_reviewer ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PhoneNumbersApi.respond_to_phone_number_reviewer" end # verify the required parameter 'respond_to_phone_number_reviewer_request' is set if @api_client.config.client_side_validation && respond_to_phone_number_reviewer_request.nil? fail ArgumentError, "Missing the required parameter 'respond_to_phone_number_reviewer_request' when calling PhoneNumbersApi.respond_to_phone_number_reviewer" end # resource path local_var_path = '/v1/phone-numbers/{id}/remediate/respond'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(respond_to_phone_number_reviewer_request) # return_type return_type = opts[:debug_return_type] || 'RespondToPhoneNumberReviewer200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.respond_to_phone_number_reviewer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#respond_to_phone_number_reviewer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#review_phone_number_kyc_packet(review_phone_number_kyc_packet_request, opts = {}) ⇒ ReviewPhoneNumberKycPacket200Response
Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans). Non-blocking: advisories are warnings, submitting anyway is always allowed, and any review failure degrades to an empty list.
1551 1552 1553 1554 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1551 def review_phone_number_kyc_packet(review_phone_number_kyc_packet_request, opts = {}) data, _status_code, _headers = review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts) data end |
#review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts = {}) ⇒ Array<(ReviewPhoneNumberKycPacket200Response, Integer, Hash)>
Pre-review a KYC packet Advisory dry-run of a regulated-KYC packet before submitting: reviews the exact documents the regulator will see (referenced by the ids from POST /v1/phone-numbers/kyc/upload-document) against the declared values and address, and returns plain-language advisories for likely decline reasons (wrong document type, mismatched address, one-sided ID scans). Non-blocking: advisories are warnings, submitting anyway is always allowed, and any review failure degrades to an empty list.
1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1561 def review_phone_number_kyc_packet_with_http_info(review_phone_number_kyc_packet_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.review_phone_number_kyc_packet ...' end # verify the required parameter 'review_phone_number_kyc_packet_request' is set if @api_client.config.client_side_validation && review_phone_number_kyc_packet_request.nil? fail ArgumentError, "Missing the required parameter 'review_phone_number_kyc_packet_request' when calling PhoneNumbersApi.review_phone_number_kyc_packet" end # resource path local_var_path = '/v1/phone-numbers/kyc/review-packet' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(review_phone_number_kyc_packet_request) # return_type return_type = opts[:debug_return_type] || 'ReviewPhoneNumberKycPacket200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.review_phone_number_kyc_packet", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#review_phone_number_kyc_packet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#search_available_phone_numbers(opts = {}) ⇒ SearchAvailablePhoneNumbers200Response
Search available numbers
Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass sms=true to only see numbers that can also text (SMS support is per-number, not per-country). Numbers a purchase would refuse are left out, and any result's phoneNumber can be bought exactly by passing it to POST /v1/phone-numbers/purchase. Works without an API key. Keyless calls get up to 12 results with the middle digits masked (maskedNumber), each with a claimId and a claimUrl: a signup link that lands a person on the dashboard's confirm step with that number picked, so an agent can search for a user and hand them one link. Keyless calls are rate limited per IP and results are cached for a few minutes. With an API key you get full numbers and no claim fields.
1628 1629 1630 1631 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1628 def search_available_phone_numbers(opts = {}) data, _status_code, _headers = search_available_phone_numbers_with_http_info(opts) data end |
#search_available_phone_numbers_with_http_info(opts = {}) ⇒ Array<(SearchAvailablePhoneNumbers200Response, Integer, Hash)>
Search available numbers Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/phone-numbers/countries). Voice capability is always required; pass `sms=true` to only see numbers that can also text (SMS support is per-number, not per-country). Numbers a purchase would refuse are left out, and any result's `phoneNumber` can be bought exactly by passing it to POST /v1/phone-numbers/purchase. Works without an API key. Keyless calls get up to 12 results with the middle digits masked (`maskedNumber`), each with a `claimId` and a `claimUrl`: a signup link that lands a person on the dashboard's confirm step with that number picked, so an agent can search for a user and hand them one link. Keyless calls are rate limited per IP and results are cached for a few minutes. With an API key you get full numbers and no claim fields.
1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1647 def search_available_phone_numbers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.search_available_phone_numbers ...' end allowable_values = ["local", "mobile", "national", "toll_free"] if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type']) fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PhoneNumbersApi.search_available_phone_numbers, must be smaller than or equal to 100.' end # resource path local_var_path = '/v1/phone-numbers/available' # query parameters query_params = opts[:query_params] || {} query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil? query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].nil? query_params[:'areaCode'] = opts[:'area_code'] if !opts[:'area_code'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil? query_params[:'locality'] = opts[:'locality'] if !opts[:'locality'].nil? query_params[:'contains'] = opts[:'contains'] if !opts[:'contains'].nil? query_params[:'sms'] = opts[:'sms'] if !opts[:'sms'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'masked'] = opts[:'masked'] if !opts[:'masked'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SearchAvailablePhoneNumbers200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.search_available_phone_numbers", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#search_available_phone_numbers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#submit_phone_number_kyc(submit_phone_number_kyc_request, opts = {}) ⇒ SubmitPhoneNumberKyc200Response
Submit KYC
Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via submissionId. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/phone-numbers/id/remediate. Before submitting, call GET /v1/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in. Otherwise the submission can pass review yet never be assignable a number.
1714 1715 1716 1717 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1714 def submit_phone_number_kyc(submit_phone_number_kyc_request, opts = {}) data, _status_code, _headers = submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts) data end |
#submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts = {}) ⇒ Array<(SubmitPhoneNumberKyc200Response, Integer, Hash)>
Submit KYC Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via `submissionId`. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/phone-numbers/id/remediate. Before submitting, call GET /v1/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in. Otherwise the submission can pass review yet never be assignable a number.
1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1724 def submit_phone_number_kyc_with_http_info(submit_phone_number_kyc_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.submit_phone_number_kyc ...' end # verify the required parameter 'submit_phone_number_kyc_request' is set if @api_client.config.client_side_validation && submit_phone_number_kyc_request.nil? fail ArgumentError, "Missing the required parameter 'submit_phone_number_kyc_request' when calling PhoneNumbersApi.submit_phone_number_kyc" end # resource path local_var_path = '/v1/phone-numbers/kyc' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(submit_phone_number_kyc_request) # return_type return_type = opts[:debug_return_type] || 'SubmitPhoneNumberKyc200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.submit_phone_number_kyc", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#submit_phone_number_kyc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_phone_number_kyc_document(x_filename, body, opts = {}) ⇒ UploadPhoneNumberKycDocument200Response
Upload a KYC document
Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via documents[].documentId. Send the RAW file bytes as the request body (not base64); put the filename in the X-Filename header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.
1783 1784 1785 1786 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1783 def upload_phone_number_kyc_document(x_filename, body, opts = {}) data, _status_code, _headers = upload_phone_number_kyc_document_with_http_info(x_filename, body, opts) data end |
#upload_phone_number_kyc_document_with_http_info(x_filename, body, opts = {}) ⇒ Array<(UploadPhoneNumberKycDocument200Response, Integer, Hash)>
Upload a KYC document Upload ONE document and get back its provider document id, to reference from POST /v1/phone-numbers/kyc via `documents.documentId`. Send the RAW file bytes as the request body (not base64); put the filename in the `X-Filename` header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.
1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1794 def upload_phone_number_kyc_document_with_http_info(x_filename, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.upload_phone_number_kyc_document ...' end # verify the required parameter 'x_filename' is set if @api_client.config.client_side_validation && x_filename.nil? fail ArgumentError, "Missing the required parameter 'x_filename' when calling PhoneNumbersApi.upload_phone_number_kyc_document" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PhoneNumbersApi.upload_phone_number_kyc_document" end # resource path local_var_path = '/v1/phone-numbers/kyc/upload-document' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/octet-stream']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Filename'] = x_filename # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'UploadPhoneNumberKycDocument200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.upload_phone_number_kyc_document", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#upload_phone_number_kyc_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_phone_number_port_in_document(file, opts = {}) ⇒ UploadPhoneNumberPortInDocument200Response
Upload a porting document
Upload ONE porting document and get back its documentId. For the signed LOA / carrier invoice the id goes to loaDocumentId / invoiceDocumentId; for a country-specific document requirement (international ports) it becomes that requirement's fieldValue. Requirement documents are normalized to PDF automatically (regulators reject raw images). PDF, JPEG, or PNG, 10MB max. Uploads must be attached to an order within 30 minutes or the carrier deletes them.
1858 1859 1860 1861 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1858 def upload_phone_number_port_in_document(file, opts = {}) data, _status_code, _headers = upload_phone_number_port_in_document_with_http_info(file, opts) data end |
#upload_phone_number_port_in_document_with_http_info(file, opts = {}) ⇒ Array<(UploadPhoneNumberPortInDocument200Response, Integer, Hash)>
Upload a porting document Upload ONE porting document and get back its `documentId`. For the signed LOA / carrier invoice the id goes to `loaDocumentId` / `invoiceDocumentId`; for a country-specific document requirement (international ports) it becomes that requirement's `fieldValue`. Requirement documents are normalized to PDF automatically (regulators reject raw images). PDF, JPEG, or PNG, 10MB max. Uploads must be attached to an order within 30 minutes or the carrier deletes them.
1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1869 def upload_phone_number_port_in_document_with_http_info(file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.upload_phone_number_port_in_document ...' end # verify the required parameter 'file' is set if @api_client.config.client_side_validation && file.nil? fail ArgumentError, "Missing the required parameter 'file' when calling PhoneNumbersApi.upload_phone_number_port_in_document" end # resource path local_var_path = '/v1/phone-numbers/port-in/documents' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['file'] = file form_params['kind'] = opts[:'kind'] if !opts[:'kind'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UploadPhoneNumberPortInDocument200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.upload_phone_number_port_in_document", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#upload_phone_number_port_in_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#validate_phone_number_kyc_address(validate_phone_number_kyc_address_request, opts = {}) ⇒ ValidatePhoneNumberKycAddress200Response
Pre-validate KYC address
Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (administrative_area) is required by the validator; when it is omitted the pre-check is skipped and { ok: true, skipped: true } is returned (the final submit still validates).
1929 1930 1931 1932 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1929 def validate_phone_number_kyc_address(validate_phone_number_kyc_address_request, opts = {}) data, _status_code, _headers = validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts) data end |
#validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {}) ⇒ Array<(ValidatePhoneNumberKycAddress200Response, Integer, Hash)>
Pre-validate KYC address Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (`administrative_area`) is required by the validator; when it is omitted the pre-check is skipped and `{ ok: true, skipped: true }` is returned (the final submit still validates).
1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1939 def validate_phone_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.validate_phone_number_kyc_address ...' end # verify the required parameter 'validate_phone_number_kyc_address_request' is set if @api_client.config.client_side_validation && validate_phone_number_kyc_address_request.nil? fail ArgumentError, "Missing the required parameter 'validate_phone_number_kyc_address_request' when calling PhoneNumbersApi.validate_phone_number_kyc_address" end # resource path local_var_path = '/v1/phone-numbers/kyc/validate-address' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_phone_number_kyc_address_request) # return_type return_type = opts[:debug_return_type] || 'ValidatePhoneNumberKycAddress200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.validate_phone_number_kyc_address", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#validate_phone_number_kyc_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#view_phone_number_kyc_document(document_id, opts = {}) ⇒ File
View a KYC document on file
Stream a document backing a reusable verification (the documentId values from GET /v1/phone-numbers/kyc reusable.options[].details[]), so the account holder can see what's on file before reusing it. Returned inline as application/pdf (uploads are normalized to PDF). Auth-scoped: a document is viewable only when its id is referenced by one of the caller's own numbers. Otherwise 404.
1997 1998 1999 2000 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 1997 def view_phone_number_kyc_document(document_id, opts = {}) data, _status_code, _headers = view_phone_number_kyc_document_with_http_info(document_id, opts) data end |
#view_phone_number_kyc_document_with_http_info(document_id, opts = {}) ⇒ Array<(File, Integer, Hash)>
View a KYC document on file Stream a document backing a reusable verification (the `documentId` values from GET /v1/phone-numbers/kyc `reusable.options.details`), so the account holder can see what's on file before reusing it. Returned inline as `application/pdf` (uploads are normalized to PDF). Auth-scoped: a document is viewable only when its id is referenced by one of the caller's own numbers. Otherwise `404`.
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 |
# File 'lib/zernio-sdk/api/phone_numbers_api.rb', line 2007 def view_phone_number_kyc_document_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PhoneNumbersApi.view_phone_number_kyc_document ...' end # verify the required parameter 'document_id' is set if @api_client.config.client_side_validation && document_id.nil? fail ArgumentError, "Missing the required parameter 'document_id' when calling PhoneNumbersApi.view_phone_number_kyc_document" end # resource path local_var_path = '/v1/phone-numbers/kyc/document/{documentId}'.sub('{' + 'documentId' + '}', CGI.escape(document_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'File' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PhoneNumbersApi.view_phone_number_kyc_document", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PhoneNumbersApi#view_phone_number_kyc_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |