# リアクションの追加

`POST /api/reaction`

URL: https://repsona.com/ja/api/post-reaction

自分のリアクションを追加します。同じ対象に同じ絵文字をすでに付けている場合も成功します。

## リクエストボディ

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `targetType` | body | project \| taskComment \| noteComment \| user \| activity \| introduction | 必須 | リアクションの対象の種類です。 |
| `targetId` | body | integer | 必須 | 対象の ID です。`targetType` に応じて、プロジェクトやコメント、ユーザーなどの ID を渡します。 |
| `text` | body | string | 必須 | リアクションの文字列です。通常は絵文字 1 つです (64 文字まで。前後の空白は取り除かれます)。 |

## リクエスト

```sh
curl -X POST "https://<space>.repsona.com/api/reaction" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "targetType": "noteComment",
    "targetId": 36,
    "text": "👍"
  }'
```

## レスポンス

- 200: Updated reaction list
- 400: Empty or too long text
- 401: Authentication is required
- 403: Not a project member
- 404: Target not found

## レスポンスの例

```json
{
  "reactions": [
    {
      "text": "👍",
      "count": 1,
      "byMe": true
    }
  ]
}
```
