## Get location data

`client.Chats.Location.Get(ctx, chatID) (*GetChatLocationResponse, error)`

**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

- `chatID string`

### Returns

- `type GetChatLocationResponse struct{…}`

  - `Data GetChatLocationResponseData`

    - `Features []GetChatLocationResponseDataFeature`

      - `Geometry GetChatLocationResponseDataFeatureGeometry`

        - `Coordinates []float64`

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

        - `Type string`

          - `const GetChatLocationResponseDataFeatureGeometryTypePoint GetChatLocationResponseDataFeatureGeometryType = "Point"`

      - `Properties GetChatLocationResponseDataFeatureProperties`

        - `Handle string`

          Phone number or email of the person sharing their location

        - `Address string`

          Full street address

        - `Locality string`

          City or locality name

        - `UpdatedAt Time`

          When the location was last updated

      - `Type string`

        - `const GetChatLocationResponseDataFeatureTypeFeature GetChatLocationResponseDataFeatureType = "Feature"`

    - `Type string`

      - `const GetChatLocationResponseDataTypeFeatureCollection GetChatLocationResponseDataType = "FeatureCollection"`

  - `Success bool`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  getChatLocationResponse, err := client.Chats.Location.Get(context.TODO(), "975d0776-bd17-4273-8337-f346b4c661b0")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", getChatLocationResponse.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
}
```
