# Phone Validation using Harmony WS

## API:

```
http://localhost:8080/HarmonyWS/rest/parseCustomerData
```

## Role used in Harmony WebServices

Use the role detailed in [PDP configuration setup](/harmony-suite/user-guides/version-3.0.0/email-and-phone-validation/phone-and-email-pdp-configuration-setup.md).

## Sample Request and Response for AUSTRALIA

### 1. Pre Reading

Please ensure that you have read and understood the rule when you are running phone validation using default country as Australia. Refer guidance on [Alignment of Default Locale and 'hosted.defaultCountry' for Phone Validation Users](https://docs.mastersoftgroup.com/harmony-suite/user-guides/version-3.0.0/email-and-phone-validation/pages/ZwXtPNE8mQzOxJZfUjAJ#id-1.-alignment-of-default-locale-and-hosted.defaultcountry-for-phone-validation-users).

### 2. Request Samples

#### **Australian Number Validation.**

<details>

<summary>Request 1: Australian Mobile Phone Number with Country Code</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"AUSTRALIA"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"+61=mobile (04)12345678"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 1: Validated Mobile Number</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "61",
            "countryCode": "61",
            "localNumber": "412345678",
            "phoneQuality": 7,
            "extraAttributes": {
                "MediaType": "61",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "Telstra"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

<details>

<summary>Request 2: Australian Mobile Phone Number without Country Code</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"AUSTRALIA"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"412345678"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 2: Validated Mobile Number with Country Code</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "61",
            "countryCode": "61",
            "localNumber": "412345678",
            "phoneQuality": 7,
            "extraAttributes": {
                "MediaType": "61",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "Telstra"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

<details>

<summary>Request 3: Australian Landline Number</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"AUSTRALIA"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"0291234567"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 3: Please note that the phone number validation process does not support the validation of Landline Numbers.</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "61",
            "areaCode": "2",
            "localNumber": "91234567",
            "phoneQuality": 8,
            "extraAttributes": {
                "exception": "Network is forbidden",
                "MediaType": "61",
                "phoneStatus": "indeterminate"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

#### **NewZealand Number Validation**

**Please note the number has to be presented in precise international number format (ITU E.123) prefix '+' followed by country code '+##'**

<details>

<summary>Request 4: New Zealand Mobile Number with Country Code</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"AUSTRALIA"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"+64 ?(0)27 123 4567"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 4: Validated Mobile Number.</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "64",
            "countryCode": "64",
            "localNumber": "271234567",
            "phoneQuality": 7,
            "extraAttributes": {
                "exception": "Validated as another country - NZ",
                "MediaType": "64",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "Spark New Zealand (ex. Telecom NZ)"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

**Non-Australian/New Zealand Number Validation**

**Please follow steps below.**

{% hint style="info" %}

* **Number has to be presented in precise international number format (ITU E.123) ,prefix '+' followed by country code '+##'.**
* [Activating Global Phone Validation](/harmony-suite/user-guides/version-3.0.0/email-and-phone-validation/prerequisites.md#activating-global-phone-validation) configuration.
  {% endhint %}

<details>

<summary>Request 5: International Number with Country code (United Kingdom Number)</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"AUSTRALIA"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"+44 123 456 7865"
            }
        }
    }
}
```

</details>

<details>

<summary>Response 5: Validated International Number</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "locationInParties": 0,
        "containedInParties": false,
        "phone": {
            "countryCode": "44",
            "phoneQuality": 7,
            "localNumber": "1234567865",
            "extraAttributes": {
                "exception": "Validated as another country - GB",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "MNO - 3 (Hutchison 3G UK Ltd)"
            }
        }
    }
}
```

</details>

##

## Sample Request and Response for NEW\_ZEALAND

### 1. Pre Reading

Please ensure that you have read and understood the rule when you are running phone validation using default country as New Zealand. Refer guidance on Refer guidance on [Alignment of Default Locale and 'hosted.defaultCountry' for Phone Validation Users](https://docs.mastersoftgroup.com/harmony-suite/user-guides/version-3.0.0/email-and-phone-validation/pages/ZwXtPNE8mQzOxJZfUjAJ#id-1.-alignment-of-default-locale-and-hosted.defaultcountry-for-phone-validation-users).

### 2. Request Samples

Please note that for all validated connected numbers the user will see the phone provider's name under operatorName JSON object.

**New Zealand Number Validation**

<details>

<summary>Request 1: New-Zealand Mobile Phone Number with Country Code</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"NEW_ZEALAND"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"+64 Fax ?(0)27 123 4567"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 1: Validated Mobile Number</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "64",
            "countryCode": "64",
            "localNumber": "271234567",
            "phoneQuality": 7,
            "extraAttributes": {
                "MediaType": "64",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "Spark New Zealand (ex. Telecom NZ)"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

<details>

<summary>Request 2:  New-Zealand Mobile Phone Number without Country Code</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"NEW_ZEALAND"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"(0)27 123 4567"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 2: Validated Mobile Number with Country Code</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "64",
            "countryCode": "64",
            "localNumber": "0271234567",
            "phoneQuality": 7,
            "extraAttributes": {
                "MediaType": "64",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "Spark New Zealand (ex. Telecom NZ)"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

<details>

<summary>Request 3: New-Zealand Land Line Number </summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"NEW_ZEALAND"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"+64 09 7001234"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 3: Please note that the phone number validation process does not support the validation of landline numbers.</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "64",
            "areaCode": "9",
            "localNumber": "7001234",
            "phoneQuality": 8,
            "extraAttributes": {
                "exception": "Network is forbidden",
                "MediaType": "64",
                "phoneStatus": "indeterminate"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

#### **Australian Number Validation**

**Please note the number has to be presented in precise international number format (ITU E.123) prefix '+' followed by country code '+##'**

<details>

<summary>Request 4: Australian Mobile Number with Country Code</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"NEW_ZEALAND"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"+61=mobile (04)12345678"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 4: Validated Mobile Number.</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "phone": {
            "numberType": "61",
            "countryCode": "61",
            "localNumber": "412345678",
            "phoneQuality": 7,
            "extraAttributes": {
                "exception": "Validated as another country - AU",
                "MediaType": "61",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "Telstra"
            }
        },
        "containedInParties": false,
        "locationInParties": 0
    }
}
```

</details>

**Non-Australian/New Zealand Number Validation**

**Please follow steps below.**

{% hint style="info" %}

* **Number has to be presented in precise international number format (ITU E.123), prefix '+' followed by country code '+##'.**
* [Activating Global Phone Validation](/harmony-suite/user-guides/version-3.0.0/email-and-phone-validation/prerequisites.md#activating-global-phone-validation) configuration.
  {% endhint %}

<details>

<summary>Request 5: International Number with Country code (United Kingdom Number)</summary>

```json
{
    "harmonyServiceConfig": {
        "role": "HostedValRole",
        "locale":"NEW_ZEALAND"
    },
    "parserInput": {
        "rawDataInput": {
           
            "phoneNumber":
            {
            	"value":"+44 123 456 7865"
            }
        }
    }
}

```

</details>

<details>

<summary>Response 5: Validated International Number</summary>

```json
{
    "ciqPartyDocument": {
        "pdpchangeContext": {},
        "options": {
            "exposeAttributes": "7"
        },
        "locationInParties": 0,
        "containedInParties": false,
        "phone": {
            "countryCode": "44",
            "phoneQuality": 7,
            "localNumber": "1234567865",
            "extraAttributes": {
                "exception": "Validated as another country - GB",
                "phoneStatus": "connected|Network confirmed connection",
                "operatorName": "MNO - 3 (Hutchison 3G UK Ltd)"
            }
        }
    }
}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mastersoftgroup.com/harmony-suite/user-guides/version-3.0.0/email-and-phone-validation/phone-validation-using-harmony-ws.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
