{
  "swagger": "2.0",
  "info": {
    "version": "1.0",
    "title": "Global Phone Validate API",
    "description": "Global Phone Validate is a web service that allows you to validate phone numbers and obtain additional information related to those numbers. Currently support over 160 countries"
  },
  "host": "api.experianmarketingservices.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "security": [
    {
      "AuthTokenHeader": []
    },
    {
      "AuthTokenQueryParam": []
    }
  ],
  "paths": {
    "/query/PhoneValidate/3.0/": {
      "post": {
        "tags": ["Endpoints"],
        "description": "Asynchronous - posts a phone number to the service to be validated. Make a GET /result request to retrieve the results.",
        "summary": "Async - Query",
        "operationId": "Async - Query",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "The body of the request.",
            "schema": {
              "$ref": "#/definitions/QueryRequestModel"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Content type to be returned.",
            "default": "application/json"
          }
        ],
        "responses": {
          "204": {
            "description": "No content",
            "headers": {
              "Content-Location": {
                "type": "string",
                "description": "Location of the validation result"
              }
            }
          },
          "400": {
            "description": "Request failed due to malformed syntax. Check the response header for more information"
          },
          "401": {
            "description": "Provided token is incorrect"
          },
          "403": {
            "description": "Request is not authorized to use the service"
          },
          "500": {
            "description": "We have encountered an unexpected server error"
          },
          "503": {
            "description": "The server is currently unavailable"
          }
        }
      }
    },
    "/result/PhoneValidate/3.0/{id}": {
      "get": {
        "tags": ["Endpoints"],
        "description": "Asynchronous - retrieves the results of a Global Phone Validate API POST /query request. The URL for this request is returned in the Content-Location response header when making the initial query.",
        "summary": "Async - Result",
        "operationId": "Async - Result",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Id for the results of a synchronous Global Phone Validate API request. The full URL for this request is returned in the Content-Type header of a synchronous POST request."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/QueryResultResponseModel"
            }
          },
          "400": {
            "description": "Request failed due to malformed syntax. Check the response header for more information"
          },
          "401": {
            "description": "Provided token is incorrect"
          },
          "403": {
            "description": "Request is not authorized to use the service"
          },
          "500": {
            "description": "We have encountered an unexpected server error"
          },
          "503": {
            "description": "The server is currently unavailable"
          }
        }
      }
    },
    "/sync/queryresult/PhoneValidate/3.0/": {
      "post": {
        "tags": ["Endpoints"],
        "description": "Synchronous - posts a phone number to the service to be validated and, once complete, returns the results of the validation.",
        "summary": "Sync - QueryResult",
        "operationId": "Sync - QueryResult",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Body",
            "in": "body",
            "required": true,
            "description": "The body of the request.",
            "schema": {
              "$ref": "#/definitions/QueryRequestModel"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "type": "string",
            "description": "Content type to be returned.",
            "default": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "$ref": "#/definitions/QueryResultResponseModel"
            }
          },
          "400": {
            "description": "Request failed due to malformed syntax. Check the response header for more information"
          },
          "401": {
            "description": "Provided token is incorrect"
          },
          "403": {
            "description": "Request is not authorized to use the service"
          },
          "500": {
            "description": "We have encountered an unexpected server error"
          },
          "503": {
            "description": "The server is currently unavailable"
          }
        }
      }
    }
  },
  "securityDefinitions": {
    "AuthTokenHeader": {
      "type": "apiKey",
      "in": "header",
      "name": "auth-token",
      "description": "Token used to authenticate your requests - sent in header."
    },
    "AuthTokenQueryParam": {
      "type": "apiKey",
      "in": "query",
      "name": "auth-token",
      "description": "Token used to authenticate your requests - sent as query parameter."
    }
  },
  "definitions": {
    "QueryRequestModel": {
      "title": "QueryRequestModel",
      "type": "object",
      "properties": {
        "Number": {
          "description": "The calling party number is the phone number of the person who originates the call. The following formats are also supported +15026576033 (the E.164 format), 0015026576033, 15026576033",
          "type": "string",
          "example": 447956654325
        }
      },
      "required": [
        "Number"
      ]
    },
    "QueryResultResponseModel": {
      "title": "ResultResponseModel",
      "type": "object",
      "properties": {
        "Number": {
          "description": "Submitted phone number.",
          "type": "string",
          "example": 447956654325
        },
        "PhoneType": {
          "description": "The type of phone number",
          "type": "string",
          "enum": [
            "Landline",
            "Mobile",
            "Provided number is invalid"
          ],
          "example": "Mobile"
        },
        "ResultCode": {
          "description": "Status code of the submitted phone.\n* 0 - Unverified = Invalid number format supplied. \n* 1 - Unknown = Valid number format but not verified with network lookup.\n* 2 - Absent = Number format validated and number verified via network lookup but not currently available (i.e. phone off, out of range).\n* 3 - Verified = Number format validated and number verified.\n* 4 - Teleservice not provisioned = Valid number but not active on a network.\n",
          "type": "integer",
          "enum": [
            0,
            1,
            2,
            3,
            4
          ],
          "example": 3
        },
        "Certainty": {
          "description": "Description of the ResultCode",
          "type": "string",
          "enum": [
            "Unverified",
            "Unknown",
            "Absent",
            "Verified",
            "Teleservice not provisioned"
          ],
          "example": "Verified"
        },
        "AdditionalPhoneInfo": {
          "type": "object",
          "properties": {
            "ValidatedPhoneNumber": {
              "description": "Verified number in international format without the leading.",
              "type": "string",
              "example": 447123456789
            },
            "CountryName": {
              "description": "Name of the country relating to the phone number.",
              "type": "string",
              "example": "United Kingdom"
            },
            "CountryCode": {
              "description": "Home country relating to the phone number.",
              "type": "string",
              "example": 44
            },
            "OperatorName": {
              "description": "Company name of the MSISDN Operator.",
              "type": "string",
              "example": "TMobile (Everything Everywhere) Limited"
            },
            "PortedOperatorName": {
              "description": "Operator from which the mobile number is ported.",
              "type": "string",
              "example": "TMobile (Everything Everywhere) Limited"
            },
            "PortedCountryName": {
              "description": "Name of the country from which the mobile number is ported.",
              "type": "string",
              "example": "United Kingdom"
            },
            "PortedCountryCode": {
              "description": "Home country code from which the mobile number is ported.",
              "type": "string",
              "example": 44
            },
            "IsRoaming": {
              "description": "Indicates whether the number is currently outside of the country where it is registered.",
              "type": "string",
              "example": "No",
              "enum":[
                "Yes",
                "No"
              ]
            },
            "RoamingNetworkName": {
              "description": "The network name of the Mobile Switching Centre that the number is currently connected to.",
              "type": "string",
              "example": "TMobile (Everything Everywhere) Limited"
            },
            "RoamingNetworkPrefix": {
              "description": "The prefix of the Mobile Switching Centre the number is currently connected to.",
              "type": "string",
              "example": ""
            },
            "RoamingCountryCode": {
              "description": "The prefix of the country the number is currently located in.",
              "type": "string",
              "example": 44
            },
            "MCCMNC": {
              "description": "Mobile Country Code (MCC) and Mobile Network Code (MNC).",
              "type": "string",
              "example": 23430
            }
          }
        }
      }
    }
  }
}