[comment]: # ({7925fa72-7925fa72})
# report.get

[comment]: # ({/7925fa72-7925fa72})

[comment]: # ({c4ffda2f-22ec64b6})
### 説明

`integer/array report.get(object parameters)`

このメソッドは、指定されたパラメータに従ってスケジュールされたレポートを取得することができます。

::: noteclassic
このメソッドは、すべての種類のユーザーが利用できます。メソッドの呼び出し権限は、ユーザーロールの設定で取り消すことができます。詳細は[ユーザーロール](/manual/web_interface/frontend_sections/users/user_roles)を参照してください。
:::

[comment]: # ({/c4ffda2f-22ec64b6})

[comment]: # ({9bbdf58d-2bc4ba55})
### パラメータ

`(object)` 目的の出力を定義するパラメータです。

このメソッドは以下のパラメータをサポートしています。

|パラメータ|[型](/manual/api/reference_commentary#data-types)|説明|
|--|--|------|
|reportids|ID/array|指定されたレポートIDを持つ定期レポートのみを返します。|
|expired|boolean|`true` に設定すると、期限切れの定期レポートのみを返します。|
|selectUsers|query|レポートの送信先として設定されているユーザーを含む [`users`](/manual/api/reference/report/object#users) プロパティを返します。|
|selectUserGroups|query|レポートの送信先として設定されているユーザーグループを含む [`user_groups`](/manual/api/reference/report/object#user-groups) プロパティを返します。|
|sortfield|string/array|指定されたプロパティで結果をソートします。<br><br>指定可能な値: `reportid`, `name`, `status`。|
|countOutput|boolean|これらのパラメータについては、[リファレンスコメント](/manual/api/reference_commentary#common-get-method-parameters) を参照してください。|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/9bbdf58d-2bc4ba55})

[comment]: # ({7223bab1-7223bab1})
### 戻り値

`(integer/array)` 次のいずれかを返します:

-   オブジェクトの配列
-   `countOutput`パラメータが使用されている場合、取得されたオブジェクトの数

[comment]: # ({/7223bab1-7223bab1})

[comment]: # ({b41637d2-b41637d2})
### 例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({65ef8cf5-b7379080})
#### レポートデータの取得

[リクエスト](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "report.get",
    "params": [
        "output": "extend",
        "selectUsers": "extend",
        "selectUserGroups": "extend",
        "reportids": ["1", "2"]
    ],
    "id": 1
}
```

レスポンス:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "reportid": "1",
            "userid": "1",
            "name": "Weekly report",
            "dashboardid": "1",
            "period": "1",
            "cycle": "1",
            "start_time": "43200",
            "weekdays": "31",
            "active_since": "2021-04-01",
            "active_till": "2021-08-31",
            "subject": "Weekly report",
            "message": "Report accompanying text",
            "status": "1",
            "description": "Report description",
            "state": "1",
            "lastsent": "1613563219",
            "info": "",
            "users": [
                {
                    "userid": "1",
                    "access_userid": "1",
                    "exclude": "0"
                },
                {
                    "userid": "2",
                    "access_userid": "0",
                    "exclude": "1"
                }
            ],
            "user_groups": [
                {
                    "usrgrpid": "7",
                    "access_userid": "0"
                }
            ]
        },
        {
            "reportid": "2",
            "userid": "1",
            "name": "Monthly report",
            "dashboardid": "2",
            "period": "2",
            "cycle": "2",
            "start_time": "0",
            "weekdays": "0",
            "active_since": "2021-05-01",
            "active_till": "",
            "subject": "Monthly report",
            "message": "Report accompanying text",
            "status": "1",
            "description": "",
            "state": "0",
            "lastsent": "0",
            "info": "",
            "users": [
                {
                    "userid": "1",
                    "access_userid": "1",
                    "exclude": "0"
                }
            ],
            "user_groups": []
        }
    ],
    "id": 1
}
```

[comment]: # ({/65ef8cf5-b7379080})

[comment]: # ({7dcda109-7b8422b2})
### 関連項目

-   [ユーザー](/manual/api/reference/user/object#users)
-   [ユーザーグループ](/manual/api/reference/user/object#user-groups)

[comment]: # ({/7dcda109-7b8422b2})

[comment]: # ({de82795f-de82795f})
### ソース

CReport::get() in *ui/include/classes/api/services/CReport.php*.

[comment]: # ({/de82795f-de82795f})
