departmentMembers


URI

<department_uri>/members[.<format>]

Supported methods

GET, POST, PUT, HEAD

Parent resource

department

Introduction

The departmentMembers resource is the members list information of a single department. By sending GET request, you can get members list information of a single department; By sending POST request, you can add a member to a department, with batches-add supported. By sending PUT request, you can simulating DELETE request to remove member from department, batches-operation supported. The removed one will not be the member of this department, but it's still in portal.

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}/members.rjson

GET request

Gets the members list information of a single department.

Response structure

Execute GET request on departmentMembers resource to return the members list information of a single department.The information representation structure is as follows:

Field Type Description
id Integer Identification field.
departmentId Integer Belonging department ID.
userName String Name of department member.
nickname String Nick name of department member.

Response example

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

[

    {

        "departmentId": 2,

        "id": 1,

        "nickname": "liyl",

        "userName": "liyl"

    },

    {

        "departmentId": 2,

        "id": 2,

        "nickname": "xiaoli",

        "userName": "xiaoli"

    }

]

POST request

Adds a member to a department.Batches-add is supported. When sending request, array of members need to be passed.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
postResultType PostResultType Adds a member into a department.
succeed boolean Whether it is successful to add a member.

Response example

Implement POST request on the departmentMembers resource: http://localhost:8090/iportal/manager/iportalconfig/departments/4/members.rjson to to add a member into a department. Request body is as follows:

[

    "liyl",

    "xiaoli"

]

The returned resource representation in rjson format is as follows:

{

    "postResultType": "CreateChild",

    "succeed": true

}

PUT request

Removes member from department, batches-operation supported. The removed one will not be the member of this department, but it's still in portal. When sending request, array of members need to be passed.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether it is successful to remove department member.
error Httperror Error information. This field will not be displayed if the member is successfully removed.

Response example

Implement PUT request on the departmentMembers resource: http://localhost:8090/iportal/manager/iportalconfig/departments/4/members.rjson. Request body is as follows:

[

    "liyl",

    "xiaoli"

]

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 departmentMembers resource exists, or whether the the client has the permission to access it. It can also determine if the departmentMembers resource supports an output format <format> if performed on a URI with .<format> included.

See