## Get location data

`chats.location.retrieve(strchat_id)  -> GetChatLocationResponse`

**get** `/v3/chats/{chatId}/location`

Retrieve the current location for contacts sharing with you in a chat.

Returns a [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) `FeatureCollection`
with a `Feature` for each participant actively sharing their location.

Works for both 1:1 and group chats. In group chats, returns a separate feature for
each participant who is sharing. Each feature's `properties.handle` identifies the user.

Returns an empty `features` array if no one is sharing or no location data is available yet.

### Parameters

- `chat_id: str`

### Returns

- `class GetChatLocationResponse: …`

  - `data: Data`

    - `features: List[DataFeature]`

      - `geometry: DataFeatureGeometry`

        - `coordinates: List[float]`

          [longitude, latitude] or [longitude, latitude, altitude]

        - `type: Literal["Point"]`

          - `"Point"`

      - `properties: DataFeatureProperties`

        - `handle: str`

          Phone number or email of the person sharing their location

        - `address: Optional[str]`

          Full street address

        - `locality: Optional[str]`

          City or locality name

        - `updated_at: Optional[datetime]`

          When the location was last updated

      - `type: Literal["Feature"]`

        - `"Feature"`

    - `type: Literal["FeatureCollection"]`

      - `"FeatureCollection"`

  - `success: bool`

### Example

```python
import os
from linq import LinqAPIV3

client = LinqAPIV3(
    api_key=os.environ.get("LINQ_API_V3_API_KEY"),  # This is the default and can be omitted
)
get_chat_location_response = client.chats.location.retrieve(
    "975d0776-bd17-4273-8337-f346b4c661b0",
)
print(get_chat_location_response.data)
```

#### Response

```json
{
  "error": {
    "status": 400,
    "code": 1002,
    "message": "Phone number must be in E.164 format",
    "doc_url": "https://docs.linqapp.com/error/codes/1xxx/1002/"
  },
  "success": false
}
```
