department


URI

<departments_uri>/{departmentId}[.<format>]

Supported methods

GET, PUT, HEAD

Parent resource

departments

Child resources

departmentAdminsdepartmentMembersdepartmentNamemoveDepartment

Introduction

The department resource is a information list of a single department among organization structure. By sending PUT request, you can edit the property information of a single department.

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiserver is the server name, with rjson being the output format.

http://supermapiportal:8090/iportal/manager/iportalconfig/departments/{departmentId}.rjson

GET request

Gets the list information of a single department.

Response structure

Execute GET request on the department resource. The returned list information of a single department in portal consists of following fields:

Field Type Description
childIds String ID list of sub departments of this department.
createTime long Department created time.
id Integer ID of department.
name String Name of the department.
orderNum Integer Order number of department which can be used for ordering departments.
parentId Integer Superior department id.

Response example

Perform the GET request on the department resource: http://localhost:8090/iportal/manager/iportalconfig/departments/1.rjson to get the list info of a single department. The returned rjson resource representation is as follows:

{

    "childIds": "2,3",

    "createTime": 1487663320292,

    "id": 1,

    "name": " Environmental Protection Bureau of city A",

    "orderNum": 1,

    "parentId": null

}

PUT request

Edits the property information of a single department.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether it's successful to edit the property information of a single department.
error Httperror Error. This field will be none if edit succeeds.

Response example

Implement the PUT request on the department resource: http://localhost:8090/iportal/manager/iportalconfig/departments/1.rjson to edit the department property information. Request body is as follows:

{

    "name": " Environmental Protection Bureau of city A",

    "orderNum": 10

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information contained in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

HEAD request can be used to check whether the department resource exists, or whether the the client has the permission to access it. It can also determine if the department resource supports an output format <format> if performed on a URI with .<format> included.

See