post Add Or Update Department
/Dictionaries/AddOrUpdateDepartment
Создание или обновление подразделения
Request Body
{
"Ext_ID": {
"required": true,
"type": "string",
"description": "ID внешней системы подразделения",
"example": ""1""
},
"FullName": {
"required": false,
"type": "string",
"description": "Полное название подразделения",
"example": ""Склад №3""
},
"Name": {
"required": true,
"type": "string",
"description": "Название подразделения",
"example": ""Склад3""
},
"manager": {
"required": false,
"type": "string",
"description": "Адрес электронной почты (учётная запись) руководителя подразделения",
"example": ""user@domain.ru""
},
"Code": {
"required": false,
"type": "string",
"description": "Код подразделения",
"example": ""2""
},
"Organization": {
"required": false,
"type": "object",
"description": "Организация, структура",
"properties": {
""Ext_ID"": {
"type": "string",
"example": ""45M45"",
"description": "ID внешней системы организации"
},
""name"": {
"type": "string",
"example": ""ООО Ромашка"",
"description": "Название организации"
},
""inn"": {
"type": "string",
"example": ""7799555551"",
"description": "ИНН организации"
},
""kpp"": {
"type": "string",
"example": ""779901001"",
"description": "КПП организации"
}
}
},
"HeadDepartmentId": {
"required": false,
"type": "object",
"description": "Организация, структура",
"properties": {
""Ext_ID"": {
"type": "string",
"example": ""45M45"",
"description": "ID внешней системы организации"
},
""name"": {
"type": "string",
"example": ""ООО Ромашка"",
"description": "Название организации"
},
""inn"": {
"type": "string",
"example": ""7799555551"",
"description": "ИНН организации"
},
""kpp"": {
"type": "string",
"example": ""779901001"",
"description": "КПП организации"
}
}
}
}
Example
{
"Ext_ID": 1,
"FullName": "Склад №3",
"Name": "Склад3,",
"manager": "user@domain.ru",
"Code": 2,
"HeadDepartmentId": 3,
"Organization": {
"Name": "ООО Ромашка",
"INN": 7799555551,
"KPP": 779901001,
"Ext_ID": "45M45"
}
}
Responses
Response 200: ОК - Подразделение создано
{
"id": 47,
"headDepartmentId": 1,
"headDepartment": null,
"name": "Склад3",
"fullName": "Склад №3",
"manager": "user@domain.ru",
"code": "2",
"ext_ID": 1,
"clientId": 1,
"organizationID": 15,
"organization": {
"id": 15,
"name": "ООО Ромашка",
"inn": "7799555551",
"kpp": "779901001",
"clientId": 1,
"client": null,
"ext_ID": "45M45",
"buttonDTO": {
"id": 15,
"clientId": 0,
"organizationId": 0,
"userId": null,
"itemId": "15"
},
"fullName": null,
"lawAddress": null,
"address": null,
"bill": null,
"bank": null,
"bik": null,
"phone": null,
"email": null,
"director": null,
"ogrn": null
}
}
Response 400
No token received ( #err-30) - Токен не получен
Response 401
Could not find any client for this token ( #err-40) - Не найден клиент с данным токеном
Response 500
Internal Server Error - Database Failure - Внутренняя ошибка сервера