POST api/Department/Update?departmentName={departmentName}&departmentId={departmentId}

Updates existing department

Request Information

URI Parameters

NameDescriptionTypeMandatory when
departmentName

string

departmentId

integer

URI Parameters are mutually exclusive (i.e. only one parameter should be specified when calling this API)

For example:

  • POST api/Department/Update?departmentName=Finance
  • POST api/Department/Update?departmentId=4

Body Parameters

Department
NameDescriptionTypeMandatory when
Name

Department name

string

Description

Department description

string

DepartmentManagerAbbreviation

Abbreviation for position that is department manager.

string

MemberAbbreviations

Abbreviations for all department members. This is a complete list of all positions in a department. If a position exists in the department in RGS, but is not in this list, then it will be removed from the department.

Collection of string

Request Formats

application/json, text/json

Sample:
{
  "Id": 1,
  "Name": "Finance MODIFIED",
  "Description": "Financial division",
  "DepartmentManagerAbbreviation": "CFO",
  "MemberAbbreviations": [
    "ACC",
    "BA",
    "CFO"
  ]
}

text/xml

Sample:
<Department xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/QAP.API.ModelsForClient">
  <DepartmentManagerAbbreviation>CFO</DepartmentManagerAbbreviation>
  <Description>Financial division</Description>
  <Id>1</Id>
  <MemberAbbreviations xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>ACC</d2p1:string>
    <d2p1:string>BA</d2p1:string>
    <d2p1:string>CFO</d2p1:string>
  </MemberAbbreviations>
  <Name>Finance MODIFIED</Name>
</Department>

Response Information

Resource Description

JsonResponseModelOfDepartment
NameDescriptionTypeMandatory when
ResponseCode

integer

ResponseMessage

string

Data

Department

Response Formats

application/json, text/json

Sample:
{
  "ResponseCode": 200,
  "ResponseMessage": "Department updated.",
  "Data": {
    "Id": 1,
    "Name": "Finance MODIFIED",
    "Description": "Financial division",
    "DepartmentManagerAbbreviation": "CFO",
    "MemberAbbreviations": [
      "ACC",
      "BA",
      "CFO"
    ]
  }
}

text/xml

Sample:
<JsonResponseModelOfDepartmentCyyWUdKo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RGS.API.Models">
  <Data xmlns:d2p1="http://schemas.datacontract.org/2004/07/QAP.API.ModelsForClient">
    <d2p1:DepartmentManagerAbbreviation>CFO</d2p1:DepartmentManagerAbbreviation>
    <d2p1:Description>Financial division</d2p1:Description>
    <d2p1:Id>1</d2p1:Id>
    <d2p1:MemberAbbreviations xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>ACC</d3p1:string>
      <d3p1:string>BA</d3p1:string>
      <d3p1:string>CFO</d3p1:string>
    </d2p1:MemberAbbreviations>
    <d2p1:Name>Finance MODIFIED</d2p1:Name>
  </Data>
  <ResponseCode>200</ResponseCode>
  <ResponseMessage>Department updated.</ResponseMessage>
</JsonResponseModelOfDepartmentCyyWUdKo>

Error Response Causes

  • Invalid API credentials
  • Another department with same name already exists
  • No department exists with the given name (if departmentName parameter is provided)
  • No department exists with the given id (if departmentId parameter is provided)