## API URL
URL used to send HTTP requests:
```url
https://portal.bulkgate.com/api/1.0/address-book/get
```

> [!NOTE]
> If the request does not reach its destination, repeat it on the [backup server](https://www.bulkgate.com/en/docs/api-administration-tokens/api-backup-server/) `backup1.bulkgate.com`.


## Supported HTTP methods

- `POST` - `application/json`

```http
POST /api/1.0/address-book/get HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
```

## Parameters table

| PARAMETER NAME    | VALUE                                         | MANDATORY | DEFAULT VALUE |
|:------------------|:----------------------------------------------|:----------|:--------------|
| application_id    | [Application ID](https://www.bulkgate.com/en/docs/api-administration-tokens/api-administration/) | **Yes**   | -             | 
| application_token | [Application token](https://www.bulkgate.com/en/docs/api-administration-tokens/api-tokens/)	     | **Yes**   | -             |
| phone_number      | Phone number to be looked up.                 | **Yes**   | -             |
| category          | The address book to work with. Defaults to the account main one. | No       | `main`                      |


## Example request

```http-json
POST /api/1.0/address-book/get HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json

{
	"application_id": 451,
	"application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
	"phone_number": "123456789"
}
```

## Response

**In case of success:**
```json
{
    "data": {
        "phone_mobile": "123456789",
        "phone": "",
        "phone_number_iso": null,
        "email": "",
        "url": "",
        "first_name": "Morgan",
        "last_name": "Yu",
        "title_before": "",
        "title_after": "",
        "gender": "",
        "type": "",
        "street1": "",
        "street2": "",
        "city": "",
        "zip": "",
        "state": "",
        "country": "",
        "company_name": "",
        "company_number": "",
        "company_vat": "",
        "custom_field_0": "",
        "custom_field_1": "",
        "custom_field_2": "",
        "custom_field_3": "",
        "custom_field_4": "",
        "custom_field_5": "",
        "custom_field_6": "",
        "custom_field_7": "",
        "custom_field_8": "",
        "custom_field_9": ""
    }
}
```


**In case of error:**
```json
{
    "type": "number_not_found",
    "code": 400,
    "error": "Number not found",
    "detail": null
}
```

```json
{
    "type": "invalid_phone_number",
    "code": 400,
    "error": "Invalid phone number",
    "detail": null
}
```

Where:

- **type** and **error** (description of the error) can be found in the [error types table](https://www.bulkgate.com/en/docs/api-administration-tokens/api-error-types/)
- **code** represents http error
- **detail** is an additional info about the error
