# Suggestion object

## Fields

| Field                      | Type  | Description | Editable |
| -------------------------- | ----- | ----------- | -------- |
| suggestion\_messages\_data | array |             |          |

## Filters

| Field    | Description |
| -------- | ----------- |
| id       | ID          |
| room\_id | RoomのID     |

[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/981e77b11762be50c5d9)

## find suggestion

<mark style="color:blue;">`GET`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/{:id}`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="200 " %}

```
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "1",
    "type": "suggestions",
    "links": {
      "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1"
    },
    "attributes": {
      "suggestion_messages_data": [
        {
          "kind": "text",
          "content": "Content",
          "settings": {}
        }
      ]
    },
    "relationships": {
      "room": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/relationships/room",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/room"
        },
        "data": {
          "type": "rooms",
          "id": "1"
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## search suggestions

<mark style="color:blue;">`GET`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": [
    {
      "id": "1",
      "type": "suggestions",
      "links": {
        "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1"
      },
      "attributes": {
        "suggestion_messages_data": [
          {
            "kind": "text",
            "content": "Content",
            "settings": {}
          }
        ]
      },
      "relationships": {
        "room": {
          "links": {
            "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/relationships/room",
            "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/room"
          },
          "data": {
            "type": "rooms",
            "id": "1"
          }
        }
      }
    }
  ],
  "meta": {
    "record_count": 1
  },
  "links": {
    "first": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions?page%5Bnumber%5D=1&page%5Bsize%5D=25",
    "last": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions?page%5Bnumber%5D=1&page%5Bsize%5D=25"
  }
}
```

{% endtab %}
{% endtabs %}

## create suggestion

<mark style="color:green;">`POST`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| Accept         | string | application/vnd.api+json |
| Content-Type   | string | application/vnd.api+json |
| X-Access-Token | string | set your access token    |

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| data | object |             |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "id": "1",
    "type": "suggestions",
    "links": {
      "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1"
    },
    "attributes": {
      "suggestion_messages_data": [
        {
          "kind": "text",
          "content": "test"
        }
      ]
    },
    "relationships": {
      "room": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/relationships/room",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/room"
        },
        "data": {
          "type": "rooms",
          "id": "1"
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## update suggestions

<mark style="color:orange;">`PUT`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/{:id}`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| data | object |             |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "id": "1",
    "type": "suggestions",
    "links": {
      "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1"
    },
    "attributes": {
      "suggestion_messages_data": [
        {
          "kind": "text",
          "content": "test"
        }
      ]
    },
    "relationships": {
      "room": {
        "links": {
          "self": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/relationships/room",
          "related": "https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/1/room"
        },
        "data": {
          "type": "rooms",
          "id": "1"
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## delete suggestion

<mark style="color:red;">`DELETE`</mark> `https://{YOUR_OKSKY_DOMAIN}/rapi/v1/suggestions/{:id}`

#### Headers

| Name           | Type   | Description              |
| -------------- | ------ | ------------------------ |
| X-Access-Token | string | set you access token     |
| Content-Type   | string | application/vnd.api+json |
| Accept         | string | application/vnd.api+json |

{% tabs %}
{% tab title="204 " %}

```
Completed 204 No Content
```

{% endtab %}
{% endtabs %}
