myDepartments


URI

<myContent_uri>/departments[.<format>]

Supported methods

GET, HEAD

Parent resource

myContent

Child resources

myDepartmentMembers, myDepartmentResources

Introduction

myDepartments resource is the information list of the department where the current user locates, eg. my department. The located department means the current user is a member or administrator of the department. Note: a user only can be a member of one department, but the user can manage many departments.

Supported Methods:

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

Resource hierarchy

HTTP request methods

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

http://supermapiportal:8090/iportal/web/mycontent/departments.rjson

GET request

Gets the basic informaiton of my department.

Response structure

Sending GET request to myDepartments resource, returning list information of my department , where the structure of single department is:

Field Type Description
createTime long The creation time.
id Integer id of a department.
name String The department name.
upperDepartmentNames List<String> The upper department name.

Response example

The returned rjson format representation after implementing the GET request on the myDepartments resource http://localhost:8090/iportal/web/mycontent/departments.rjson is as follows:

[

    {

        "createTime": 1481681711688,

        "id": 3,

        name": "Research 1",

        "upperDepartmentNames": [

            "Research department",

            "xx company"

        ]

    },

    {

        "createTime": 1481681703250,

        "id": 2,

        "name": "Research department",

        "upperDepartmentNames": [

            "xx company"

        ]

    }

]

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 written 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 if the myDepartments resource exists, or if the imageValue resource can be accessed by clients. It can also determine if the myDepartments resource supports an output format <format> if performed on a URI with .<format> included.

See