# /id

## location info and geometry by id

<mark style="color:blue;">`GET`</mark> `geolytix.xyz/api/location/select/id`

Request a location's info and geometry by its ID. The infoj which defines the fields to be queried will be taken from the workspace in memory.

#### Query Parameters

| Name   | Type   | Description                                         |
| ------ | ------ | --------------------------------------------------- |
| locale | string | The locale (key) which contains the location layer. |
| layer  | string | The layer (key) which contains the location table.  |
| table  | string | The table which holds the locations.                |
| id     | string | The layer qID ID of the location.                   |
| token  | string | A token is required to access private endpoints.    |

{% tabs %}
{% tab title="200 JSON object with geometry as GeoJSON and infoj array with values." %}

```javascript
{
  "geomj": "{\"type\":\"Point\",\"coordinates\":[-1.80310353310663,52.5013484988118]}",
  "infoj": [
    {
      "type": "streetview"
    },
    {
      "label": "ID",
      "field": "retailpoint_id",
      "type": "text",
      "inline": true,
      "value": 1010004483
    },
    {...}
  ]
}
```

{% endtab %}

{% tab title="204 Returned when the database query was successful but no records were returned. This is the case if the token does not grant access to the location." %}

```
'No rows returned from table.'
```

{% endtab %}

{% tab title="401 Returned when trying to access a private endpoint with an invalid or missing token." %}

```
'Invalid token.'
```

{% endtab %}

{% tab title="406 Will be returned if paramter are missing or don't match the workspace in memory." %}

```
'Invalid locale.'

'Invalid layer.'

'Missing table.'

'Missing id.'

'Invalid parameter.'
```

{% endtab %}

{% tab title="500 Backend failed to fetch results from database table." %}

```
'Failed to query PostGIS table.'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Access filter on the layer apply and the location info can not be returned if the access token does hold the required roles for private endpoints.
{% endhint %}
