POST api/Department/Add

Adds a new department

Request Information

URI Parameters

None.

Body Parameters

Department
NameDescriptionTypeMandatory when
Id

Department id

integer

Updating existing department

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": 0,
  "Name": "Finance",
  "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>0</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</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 added.",
  "Data": {
    "Id": 1,
    "Name": "Finance",
    "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</d2p1:Name>
  </Data>
  <ResponseCode>200</ResponseCode>
  <ResponseMessage>Department added.</ResponseMessage>
</JsonResponseModelOfDepartmentCyyWUdKo>

Error Response Causes

  • Invalid API credentials
  • Name is not provided
  • Another department with same Name already exists