Departments

Get departments

GET/v2/departments
Query parameters
Header parameters
Response

Success

Body
Idinteger (int32)
Namenullable string
ExternalIdnullable string
ParentIdnullable integer (int32)
Childrennullable array of Adopto.Common.Api.Dto.DepartmentReadOnly (object)
IsTranslatedboolean
TranslationAdopto.Common.Api.Dto.Translation (object)
Request
const response = await fetch('/v2/departments', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "Name": "text",
    "ExternalId": "text",
    "Children": [],
    "IsTranslated": false,
    "Translation": {
      "TranslationProperties": [
        "text"
      ],
      "TranslationRequiredProperties": [
        "text"
      ],
      "Translations": [
        {
          "Language": "text",
          "Property": "text",
          "TranslateValue": "text"
        }
      ]
    }
  }
]

Create department

POST/v2/departments
Header parameters
Body
Idinteger (int32)
Namenullable string
ExternalIdnullable string
ParentIdnullable integer (int32)
IsTranslatedboolean
TranslationAdopto.Common.Api.Dto.Translation (object)
Response

Created

Body
Idinteger (int32)
Namenullable string
ExternalIdnullable string
ParentIdnullable integer (int32)
Childrennullable array of Adopto.Common.Api.Dto.DepartmentReadOnly (object)
IsTranslatedboolean
TranslationAdopto.Common.Api.Dto.Translation (object)
Request
const response = await fetch('/v2/departments', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json-patch+json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "Name": "text",
  "ExternalId": "text",
  "Children": [],
  "IsTranslated": false,
  "Translation": {
    "TranslationProperties": [
      "text"
    ],
    "TranslationRequiredProperties": [
      "text"
    ],
    "Translations": [
      {
        "Language": "text",
        "Property": "text",
        "TranslateValue": "text"
      }
    ]
  }
}

Get department

GET/v2/departments/{id}
Path parameters
id*integer (int32)
Header parameters
Response

Success

Body
Idinteger (int32)
Namenullable string
ExternalIdnullable string
ParentIdnullable integer (int32)
Childrennullable array of Adopto.Common.Api.Dto.DepartmentReadOnly (object)
IsTranslatedboolean
TranslationAdopto.Common.Api.Dto.Translation (object)
Request
const response = await fetch('/v2/departments/{id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "Name": "text",
  "ExternalId": "text",
  "Children": [],
  "IsTranslated": false,
  "Translation": {
    "TranslationProperties": [
      "text"
    ],
    "TranslationRequiredProperties": [
      "text"
    ],
    "Translations": [
      {
        "Language": "text",
        "Property": "text",
        "TranslateValue": "text"
      }
    ]
  }
}

Update department

PUT/v2/departments/{id}
Path parameters
id*integer (int32)
Header parameters
Body
Idinteger (int32)
Namenullable string
ExternalIdnullable string
ParentIdnullable integer (int32)
IsTranslatedboolean
TranslationAdopto.Common.Api.Dto.Translation (object)
Response

No Content

Request
const response = await fetch('/v2/departments/{id}', {
    method: 'PUT',
    headers: {
      "Content-Type": "application/json-patch+json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "Message": "text",
  "Errors": [
    {
      "Field": "text",
      "Message": "text"
    }
  ]
}

Delete department

DELETE/v2/departments/{id}
Path parameters
id*integer (int32)
Header parameters
Response

No Content

Request
const response = await fetch('/v2/departments/{id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "Message": "text",
  "Errors": [
    {
      "Field": "text",
      "Message": "text"
    }
  ]
}

Get department by external ID

GET/v2/departments/{id}/external
Path parameters
id*string
Header parameters
Response

Success

Body
Idinteger (int32)
Namenullable string
ExternalIdnullable string
ParentIdnullable integer (int32)
Childrennullable array of Adopto.Common.Api.Dto.DepartmentReadOnly (object)
IsTranslatedboolean
TranslationAdopto.Common.Api.Dto.Translation (object)
Request
const response = await fetch('/v2/departments/{id}/external', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "Name": "text",
  "ExternalId": "text",
  "Children": [],
  "IsTranslated": false,
  "Translation": {
    "TranslationProperties": [
      "text"
    ],
    "TranslationRequiredProperties": [
      "text"
    ],
    "Translations": [
      {
        "Language": "text",
        "Property": "text",
        "TranslateValue": "text"
      }
    ]
  }
}

Last updated