POST Departments

Adds a Department.


Parameters

NameDescriptionAdditional information
request
The Department to add. 
            When adding a new Department through the API, the following properties are required:
            Id: Must be set to 0, or the add will throw an error.
            Label: Must be set to something meaningful, or the add will throw an error.

Define this parameter in the request body.

Request body formats

application/json, text/json

Sample:
{
  "Id": 1,
  "Label": "sample string 2",
  "Description": "sample string 3",
  "UserDefined": null,
  "Archived": true
}

application/xml, text/xml

Sample:
<Department xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Types">
  <Archived>true</Archived>
  <Description>sample string 3</Description>
  <Id>1</Id>
  <Label>sample string 2</Label>
  <UserDefined i:nil="true" />
</Department>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response body formats

A DepartmentResponse containing the added Department.

application/json, text/json

Sample:
{
  "Item": {
    "Id": 1,
    "Label": "sample string 2",
    "Description": "sample string 3",
    "UserDefined": null,
    "Archived": true
  },
  "ResponseInformation": {
    "Errors": [
      {
        "ErrorCode": "sample string 1",
        "Message": "sample string 2"
      },
      {
        "ErrorCode": "sample string 1",
        "Message": "sample string 2"
      },
      {
        "ErrorCode": "sample string 1",
        "Message": "sample string 2"
      }
    ],
    "Status": 0,
    "Links": [
      {
        "Rel": "sample string 1",
        "Href": "sample string 2",
        "Title": "sample string 3",
        "IsTemplated": true
      },
      {
        "Rel": "sample string 1",
        "Href": "sample string 2",
        "Title": "sample string 3",
        "IsTemplated": true
      },
      {
        "Rel": "sample string 1",
        "Href": "sample string 2",
        "Title": "sample string 3",
        "IsTemplated": true
      }
    ]
  }
}

application/xml, text/xml

Sample:
<DepartmentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Responses">
  <ResponseInformation xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Common">
    <Errors>
      <ApiErrorDetail>
        <ErrorCode>sample string 1</ErrorCode>
        <Message>sample string 2</Message>
      </ApiErrorDetail>
      <ApiErrorDetail>
        <ErrorCode>sample string 1</ErrorCode>
        <Message>sample string 2</Message>
      </ApiErrorDetail>
      <ApiErrorDetail>
        <ErrorCode>sample string 1</ErrorCode>
        <Message>sample string 2</Message>
      </ApiErrorDetail>
    </Errors>
    <Links>
      <Link>
        <Href>sample string 2</Href>
        <IsTemplated>true</IsTemplated>
        <Rel>sample string 1</Rel>
        <Title>sample string 3</Title>
      </Link>
      <Link>
        <Href>sample string 2</Href>
        <IsTemplated>true</IsTemplated>
        <Rel>sample string 1</Rel>
        <Title>sample string 3</Title>
      </Link>
      <Link>
        <Href>sample string 2</Href>
        <IsTemplated>true</IsTemplated>
        <Rel>sample string 1</Rel>
        <Title>sample string 3</Title>
      </Link>
    </Links>
    <Status>Failure</Status>
  </ResponseInformation>
  <Item xmlns:d2p1="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Types" xmlns="http://schemas.datacontract.org/2004/07/SpendManagementApi.Models.Common">
    <d2p1:Archived>true</d2p1:Archived>
    <d2p1:Description>sample string 3</d2p1:Description>
    <d2p1:Id>1</d2p1:Id>
    <d2p1:Label>sample string 2</d2p1:Label>
    <d2p1:UserDefined i:nil="true" />
  </Item>
</DepartmentResponse>
URI parameters
=
Headers | Add header
: Delete
Body
Samples:
Status
Headers
Body