UNPKG

@ringer-tel/telique

Version:
71 lines (58 loc) 3.58 kB
/* tslint:disable */ /* eslint-disable */ /** * Telique API * The Ringer Telique API provides access to telecommunications data, including caller name (CNAM) data, line type information, and more. The API also includes services for checking phone numbers against Do Not Originate (DNO) and Do Not Call (DNC) databases, as well as STIR/SHAKEN call authentication validation. ## Authentication This API uses IP whitelist authentication. Your server\'s IP address must be registered with Ringer before making API calls. Contact support@ringer.tel to register your IP address. * * The version of the OpenAPI document: 1.0.18 * Contact: support@ringer.tel * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; export interface GetLrnInfoRequest { phoneNumber: string; } /** * */ export class LocalRoutingNumberLRNApi extends runtime.BaseAPI { /** * Returns the Local Routing Number (LRN) and Service Provider ID (SPID) for a specified 10-digit North American phone number in plain text format. This information is used to correctly route calls to numbers that have been ported from one carrier to another. Response format: LRN;SPID (semicolon-separated) If SPID is not available, only the LRN will be returned. Note: Content-Type is always text/plain - no JSON or XML support for LRN queries. * Retrieve LRN for a phone number */ async getLrnInfoRaw(requestParameters: GetLrnInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> { if (requestParameters['phoneNumber'] == null) { throw new runtime.RequiredError( 'phoneNumber', 'Required parameter "phoneNumber" was null or undefined when calling getLrnInfo().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["X-Forwarded-For"] = await this.configuration.apiKey("X-Forwarded-For"); // ipWhitelist authentication } const response = await this.request({ path: `/telique/lrn/{phoneNumber}`.replace(`{${"phoneNumber"}}`, encodeURIComponent(String(requestParameters['phoneNumber']))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse<string>(response); } else { return new runtime.TextApiResponse(response) as any; } } /** * Returns the Local Routing Number (LRN) and Service Provider ID (SPID) for a specified 10-digit North American phone number in plain text format. This information is used to correctly route calls to numbers that have been ported from one carrier to another. Response format: LRN;SPID (semicolon-separated) If SPID is not available, only the LRN will be returned. Note: Content-Type is always text/plain - no JSON or XML support for LRN queries. * Retrieve LRN for a phone number */ async getLrnInfo(requestParameters: GetLrnInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> { const response = await this.getLrnInfoRaw(requestParameters, initOverrides); return await response.value(); } }