# Capability

## Check iMessage capability

`client.Capability.CheckiMessage(ctx, body) (*HandleCheckResponse, error)`

**post** `/v3/capability/check_imessage`

Check whether a recipient address (phone number or email) is reachable via iMessage.

### Parameters

- `body CapabilityCheckiMessageParams`

  - `HandleCheck param.Field[HandleCheck]`

### Returns

- `type HandleCheckResponse struct{…}`

  - `Address string`

    The recipient address that was checked

  - `Available bool`

    Whether the recipient supports the checked messaging service

### 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"),
  )
  handleCheckResponse, err := client.Capability.CheckiMessage(context.TODO(), linqgo.CapabilityCheckiMessageParams{
    HandleCheck: linqgo.HandleCheckParam{
      Address: "+15551234567",
    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", handleCheckResponse.Address)
}
```

#### Response

```json
{
  "address": "+15551234567",
  "available": true
}
```

## Check RCS capability

`client.Capability.CheckRCS(ctx, body) (*HandleCheckResponse, error)`

**post** `/v3/capability/check_rcs`

Check whether a recipient address (phone number) supports RCS messaging.

### Parameters

- `body CapabilityCheckRCSParams`

  - `HandleCheck param.Field[HandleCheck]`

### Returns

- `type HandleCheckResponse struct{…}`

  - `Address string`

    The recipient address that was checked

  - `Available bool`

    Whether the recipient supports the checked messaging service

### 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"),
  )
  handleCheckResponse, err := client.Capability.CheckRCS(context.TODO(), linqgo.CapabilityCheckRCSParams{
    HandleCheck: linqgo.HandleCheckParam{
      Address: "+15551234567",
    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", handleCheckResponse.Address)
}
```

#### Response

```json
{
  "address": "+15551234567",
  "available": true
}
```

## Domain Types

### Handle Check

- `type HandleCheck struct{…}`

  - `Address string`

    The recipient phone number or email address to check

  - `From string`

    Optional sender phone number. If omitted, an available phone from your pool is used automatically.

### Handle Check Response

- `type HandleCheckResponse struct{…}`

  - `Address string`

    The recipient address that was checked

  - `Available bool`

    Whether the recipient supports the checked messaging service
