Skip to content

Retrieve Department

Overview

You can use the API to retrieve the record details.

Preparations

Please Create an API Key before performing API operations.

Request

Send json data in the following request format:

Setting column Value
HTTP Method POST
Content-Type application/json
Character Code UTF-8
URL http://{server name}/api/depts/get (*1)
Body Refer to the json data below

(*1) Please edit the {server name} part to suit your environment as appropriate.
For Pleasanter.net, the format is as follows:
https://pleasanter.net/fs/api/depts/get

To Retrieve Department Information

JSON
{
     "ApiVersion": 1.1,
     "ApiKey": "dD32ai53j3asdK2fre..."
}

Specifying conditions to obtain matching department information

JSON

{
    "ApiVersion": 1.1,
    "ApiKey": "1ao3ea5kDH2335sar529UY...",
    "View": {
        "ColumnFilterHash": {
            "Groups": "[1,2]"
        }
    }
}

In the above example, departments contained in groups with group ID 1 or 2 will be retrieved.

Response

The following json data format will be returned.
Please refer to here for the data layout.

JSON
{
    "StatusCode": 200,
    "Response": {
        "Offset": 0,
        "PageSize": 200,
        "TotalCount": 1,
        "Data": [
            {
                "TenantId": 1,
                "DeptId": 1,
                "Ver": 1,
                "DeptCode": "1234",
                "DeptName": "System Development Department",
                "Body": "",
                "Disabled": false,
                "Comments": "[]",
                "Creator": 1,
                "Updator": 1,
                "CreatedTime": "2023-04-01T12:00:00",
                "UpdatedTime": "2023-08-15T12:00:00",
                "ApiVersion": 1.1,
                "ClassHash": {
                },
                "NumHash": {
                },
                "DateHash": {
                },
                "DescriptionHash": {
                },
                "CheckHash": {
                },
                "AttachmentsHash": {
                }
            }
        ]
    }
}

Confirmation Column in Case of Error

・Precautions when using the API and things to check if an error occurs
・FAQ: What to check if modified configuration files or API requests (JSON format) are not recognized correctly

Specification Changes

*API specifications have been partially changed since October 2019.**
- Classification, Numerical Value, Date, Description, and Check Column have been changed from being directly entered in the JSON to being entered within "~Hash".

*API specifications have been partially changed since November 2018.**
- The URL format has been changed from '/pleasanter/api_items/xxxx' to '/pleasanter/api/items/xxxx'.
- The Content-Type specification has been changed from 'application/x-www-form-urlencoded' to 'application/json'.