basePath: /api/v1
consumes:
- application/json
definitions:
  example.BadRequest:
    properties:
      code:
        example: ERR001
        type: string
      message:
        example: Request contains malformed JSON
        type: string
      reason:
        example: Bad request - The request could not be understood by the service
          due to malformed syntax
        type: string
    type: object
  example.InsufficientFunds:
    properties:
      code:
        example: ERR606
        type: string
      message:
        example: Out of money
        type: string
      reason:
        example: Account has insufficient funds
        type: string
    type: object
  example.ResourceDenied:
    properties:
      code:
        example: ERR203
        type: string
      message:
        example: Access denied
        type: string
      reason:
        example: Resource permission denied - you do not have a permission to access
          to the resource
        type: string
    type: object
  example.ResourceInvalid:
    properties:
      code:
        example: ERR011
        type: string
      message:
        example: Request contains invalid data
        type: string
      reason:
        example: Resource validation failed
        type: string
    type: object
  example.RuntimeErrorUnkwn:
    properties:
      code:
        example: ERR003
        type: string
      message:
        example: An unexpected error occurred
        type: string
      reason:
        example: Runtime error - The service encountered an unexpected condition which
          prevented it from fulfilling your request
        type: string
    type: object
  v1.LookupResponse:
    properties:
      cic:
        description: Carrier Identification Code (where applicable)
        example: "48502"
        type: string
      country_code_iso2:
        description: Two letter ISO2 code of the number country
        example: PL
        type: string
      error:
        description: Error description, if any
        type: string
      mcc:
        description: Mobile Country Code of the current carrier
        example: "260"
        type: string
      mnc:
        description: Mobile Network Code of the current carrier
        example: "03"
        type: string
      network_name:
        description: Carrier network name
        example: Orange Polska S.A.
        type: string
      number:
        description: Original phone number after sanitization (`+(48) 514-111-111`
          -> `48514111111`)
        example: "48514111111"
        type: string
      number_type:
        description: |-
          Number type - `mobile` / `fixed` (landline).

          This field is only present if the queried number is a valid phone number.
        example: mobile
        type: string
      ocn:
        description: Operating Company Number (where applicable)
        example: 985A
        type: string
      ported:
        description: |-
          Flag specifying if the queried number was ported from one carrier to another.

          This field is only present if the carrier supports portability checks, and it is missing otherwise.
        example: false
        type: boolean
      present:
        description: |-
          Flag specifying if the queried number subscriber is present in the carrier network.

          This field is only present if the carrier supports presence checks, and it is missing otherwise.
        example: true
        type: boolean
      region_code:
        description: Numerical code of the number region (where applicable)
        example: "72"
        type: string
      valid:
        description: Flag specifying if the queried number is a valid phone number.
        example: true
        type: boolean
    type: object
host: hlr.apifonica.com
info:
  contact:
    email: info@apifonica.com
    name: Apifonica Support
    url: https://www.apifonica.com/en/company/contacts
  description: |
    ## Overview
    Apifonica HLR Lookup Service allows to programmatically query for phone number information,
    such as number type, carrier network details, presence status, portability status, etc.

    ## Base URL path
    Base URL path (prefix) for all endpoints is `/api/v1`

    ## Authentication
    Authorization scheme: **Basic Auth**.

    You need to authenticate all your requests using valid Apifonica credentials pair - `account_sid` and `account_token`.

    You can find them in your [Apifonica Personal Account](https://account.apifonica.com/profile).

    More details can be found in [Apifonica FAQ](https://www.apifonica.com/en/developers/faq/basics/).

    ## Configuration
    In order to use this service, it first has to be configured/enabled on your Apifonica account.
    Please, reach us via Support form in the Personal Account, or using any other method listed on our
    [Contacts page](https://www.apifonica.com/en/company/contacts).

    ## Billing
    The service is billed on per-request basis. Usually, billing is static, but may depend on additional features
    such as mobile number presence check. Please provide these details when submitting a service request to our team.
  termsOfService: https://www.apifonica.com/public/legal/apifonica_terms_of_service.pdf
  title: HLR Lookup Service
  version: "1.0"
  x-logo:
    altText: Apifonica logo
    url: https://apifonica.com/public/img/logo.svg
paths:
  /lookup/{number}:
    get:
      description: Send HLR lookup query for a phone number.
      operationId: lookup
      parameters:
      - description: phone number
        in: path
        name: number
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/v1.LookupResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/example.ResourceInvalid'
        "402":
          description: Payment Required
          schema:
            $ref: '#/definitions/example.InsufficientFunds'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/example.ResourceDenied'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/example.RuntimeErrorUnkwn'
      summary: Lookup
      tags:
      - Lookup
produces:
- application/json
schemes:
- https
swagger: "2.0"
