airtimeLookupNumberWithHttpInfo method

Future<Response> airtimeLookupNumberWithHttpInfo(
  1. String phoneNumber, {
  2. Future<void>? abortTrigger,
})

Look up a phone number

Describes a phone number and returns its carrier from a carrier lookup when the number is valid. Describes the number from numbering-plan data and, for a valid number, adds carrier information from a live carrier lookup. A number without the international shape gives 400 / 10001; a number its country does not assign returns 200 with isValid: false and carrier: null, without a carrier lookup. Returns 503 / 10007 when the carrier lookup is unavailable. The carrier is for display only and nothing is stored; use search to find a sellable operator.

Note: This method returns the HTTP Response.

Parameters:

  • String phoneNumber (required): The number in international format, starting with + or 00; spaces, hyphens and parentheses are allowed.

Implementation

Future<Response> airtimeLookupNumberWithHttpInfo(String phoneNumber, { Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/airtime/number-lookup';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

    queryParams.addAll(_queryParams('', 'phoneNumber', phoneNumber));

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}