Skip to content

InfoboardPostReadUsers

Model & Relations

Namespace

Modules\Infoboard\Entities\InfoboardPostReadUser

Relations

RelationKeyTypeRelation Field(s)
UseruserBelongs touser_id
InfoboardPostpostBelongs topost_id

List

Get a list of InfoboardPostReadUsers by InfoboardPost.

Definition

GET /api/infoboard/posts/{postId}/read-users

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/infoboard/posts/1/read-users', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response

json
[
  {
    "id": 1,
    "user_id": 4,
    "post_id": 1,
    "created_at": "2018-12-21 13:03:33"
  },
  {
    "id": 2,
    "user_id": 5,
    "post_id": 1,
    "created_at": "2018-12-21 13:04:29"
  }
]

Create

Create a new InfoboardPostReadUser by InfoboardPost.

Definition

POST /api/infoboard/posts/{postId}/read-users

Request Keys

KeyTypeDefaultDescription
user_id *integer-The related User
post_id **integer-The related InfoboardPost

Keys with * are required.
Keys with ** are normalized to the information given by the route.

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/infoboard/posts/1/read-users', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'user_id' => 6
    ]
]);

Example Response

json
{
  "status": "success",
  "data": {
    "id": 3,
    "user_id": 6,
    "post_id": 1,
    "created_at": "2018-12-21 13:07:12"
  }
}