# Address Lookup by Contact

`GET /address_lookup_by_contact`

- Live: `GET https://gdapi.globaldata.net.au/api/v2/address_lookup_by_contact`
- Sandbox: `GET https://sandbox-gdapi.globaldata.net.au/api/v2/address_lookup_by_contact`

The address lookup by contact query will return the GNAF ID which corresponds to a given email address or phone
number from the Global Data universe.

Note: If both a phone number and email address are supplied, the phone number will searched first, and if no
match is found, the email address will be searched.

## Sandbox environment

When simulating queries in the sandbox environment, the following records will return the matching GNAF ID:

| Email                    | Phone                  | GNAF ID        |
|:-------------------------|:-----------------------|:---------------|
| jsmith1998@example.com   | 0399999999, 0491222111 | GAVIC421647320 |
|                          | 0399998888             | GAVIC419608268 |
| mary_jones89@example.com | 0399995000             | GANSW716615055 |
| rp_brown71@example.com   |                        | GANSW712900961 |

## Parameters

| Name | In | Type | Description |
|------|----|------|-------------|
| `email` | query | string | The email address to search for. Email addresses are not case sensitive. |
| `phone` | query | string | The phone number to search for. Phone numbers must be in 0NSN format (10 digits, no spaces or other intermediate characters and starting with a 0) eg 0299995000, or 0491570006. Example: `0491222111` |

## Responses

### 200 Result of address lookup

Content type: `application/json`

| Field | Type | Description |
|-------|------|-------------|
| `message` | string | A message indicating the result of the request. This will be `Ok` if the request was successful. or `No record` if the an address could not be found. Example: `Ok` |
| `address_id` | string | The GNAF address id of the address (supplied if the request was successful) Example: `GANSW716615055` |
| `record_date` | string (date) | The date the record was create or last updated Example: `2021-01-01` |
| `api_reference` | string (uuid) | A unique identifier for this request Example: `738d9a89-b6fe-4fc1-96be-1389b2a506a2` |

**Sample response**

```json
{
    "message": "Ok",
    "address_id": "GANSW716615055",
    "record_date": "2021-01-01",
    "api_reference": "738d9a89-b6fe-4fc1-96be-1389b2a506a2"
}
```

Standard error responses: 400, 401, 402, 403, 429, 5XX (see [Common error responses](/docs/reference/general/common-error-responses.md))

