# Validar Dirección

## Validar Dirección

<mark style="color:green;">`POST`</mark> `https://www.rapigo.co/api/v1/validate_address/`

Valida que una dirección puede ser georreferenciada

#### Headers

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| Authentication | string | Token Basic Auth |

#### Request Body

| Name     | Type   | Description         |
| -------- | ------ | ------------------- |
| lon      | string | latitud             |
| lat      | string | longitud            |
| city\_id | number | Ciudad              |
| address  | string | Dirección a validar |

{% tabs %}
{% tab title="200 Respuesta " %}

```javascript
{
    "result": true
}

{
    "message": "without geographic coverage",
    "result": false
}

{ 
    "result": false, 
    "message": "not found"
}
```

{% endtab %}
{% endtabs %}

## Ejemplo en php

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://www.rapigo.co/api/v1/validate_address/');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'postman-token' => 'bc28b90a-c12d-b8a2-b272-7f8f881052a7',
  'cache-control' => 'no-cache',
  'content-type' => 'application/x-www-form-urlencoded',
  'authorization' => 'Basic anVsaWFuQHJhcGlnby5jbzpjb2xvbWJpYTEyMjQ='
));

$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
  'address' => 'carrera 38A #25A-69'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```
