Get Organization Units
Get Organization Units from Position Green Platform by an external id (PrettyId) or ID of the Organization Unit. Additionally, includeSubunits parameter allows to get all sub-organizations of provided PrettyId or ID.
Properties of Organization Unit object
Property | Data Type | Description |
id | Guid | Id of the Organization Unit |
globalId | Guid | Global Id of the Organization Unit |
yearId | Guid | Id of year assigned to the Organization Unit |
prettyId | string | Pretty Id of the Organization Unit |
parentId | Guid | Parent Id of Organization Unit |
organizationId | Guid | Id of Tenant where the Organization Unit belongs |
GET/OrganizationUnit
Check the Organizational unit section on our swagger UI page.
This API endpoint will return Organization Units in 3 specific ways:
- All Organization Units of Tenant - if there is no request parameters provided;
- Specific Organization Unit - if Id or PrettyId is provided;
- Specific Organization Unit with all sub-units - if Id or PrettyId is provided and IncludeSubunits is set to true;
Example of response:
{ "totalCount": 2, "items": [ { "id": "346788a-fd74-fd74-fd74-fd74a1c08e8b", "globalId": "1234567-fd74-abcd-fd74-930fa1c18e8b", "name": "Organization Unit Name", "yearId": "3825cdbb-3795-4f0b-9854-21d9e3a0b50a", "prettyId": "Org Pretty Id", "parentId": null, "organizationId": "dfc751db-59ca-4ae7-878f-65fe1af0017e" }, { "id": "2ca630f1-07d5-4ee4-9d29-ec95766732ec", "globalId": "8034bedf-1b7a-4e5e-96c7-0379622c6add", "name": "Org sub-unit Name", "yearId": "3825cdbb-3795-4f0b-9854-21d9e3a0b50a", "prettyId": "Org sub-unit Pretty Id", "parentId": "346788a-fd74-fd74-fd74-fd74a1c08e8b", "organizationId":"dfc751db-59ca-4ae7-878f-65fe1af0017e" } ] }
Create a new Organization Unit
Create a new Organization Unit in Position Green Platform
Parameter | Required | Type | Description |
---|---|---|---|
name | Yes | string | Name of the Organization Unit |
parentId | No | Guid | Id of Parent (optional) |
prettyId | Yes | string | |
complexData (array of) | No | JSONObject[] | Complex data of the Organization Unit (eg. { "name": "culture", "data": "en", "type": "String" }) |
name | Yes | string | Name of data complex element |
data | Yes | object | Data of the element |
type | Yes | enum | Possible values: [ String, Number, Date, Bool] |
supervisor | No | JSONObject | Supervisor of the Organization Unit |
firstName | Yes | string | First name of the supervisor |
lastName | Yes | string | Last name of the supervisor |
Yes | string | Email of the supervisor |
POST/OrganizationUnit
Check the Organizational unit section on our swagger UI page.
This API endpoint will create a new Organization Unit in active year and return summary of the created entity.
Example of response in case of successful:
{ "id": "9620bd7d-8eb3-49a9-9ea2-19463d5aadd7", "globalId": "9620bd7d-8eb3-49a9-9ea2-19463d5aadd7", "name": "New organization", "yearId": "d338b2e8-eecc-476a-ba56-1853494a7ec9", "prettyId": "NewOrg 1", "parentId": "346788a-fd74-fd74-fd74-fd74a1c08e8b", "organizationId": "dfc751db-59ca-4ae7-878f-65fe1af0017e", "complexData": [ { "name": "culture", "data": "en", "type": "String" } ], "supervisor": { "id": "6320ea4c-f274-4d0d-a249-3d23c15d0468", "firstName": "FirstName", "lastName": "lastName", "email": "lastName@example.pl" } }
Update Organization Unit
Update Organization Unit in Position Green Platform.
Parameter | Required | Type | Description |
---|---|---|---|
name | Yes | string | Name of the Organization Unit |
parentId | No | Guid | Id of Parent (optional) |
prettyId | Yes | string | |
complexData (array of) | No | JsonObject[] | Complex data of the Organization Unit (eg. { "name": "culture", "data": "en", "type": "String" }) |
name | Yes | string | Name of data complex element |
data | Yes | object | Data of the element |
type | Yes | enum | Possible values: [ String, Number, Date, Bool ] |
supervisor | No | JSONObject | Supervisor of the Organization Unit |
firstName | Yes | string | First name of the supervisor |
lastName | Yes | string | Last name of the supervisor |
Yes | string | Email of the supervisor |
PUT/OrganizationUnit/{id}
Check the Organizational unit section on our swagger UI page.
This API endpoint will update Organization Unit and return summary of the updated entity.
Example of response in case of successful:
{ "id": "9620bd7d-8eb3-49a9-9ea2-19463d5aadd7", "globalId": "9620bd7d-8eb3-49a9-9ea2-19463d5aadd7", "name": "Updated organization", "yearId": "d338b2e8-eecc-476a-ba56-1853494a7ec9", "prettyId": "UpdOrgPretty 1", "parentId": "346788a-fd74-fd74-fd74-fd74a1c08e8b", "organizationId": "dfc751db-59ca-4ae7-878f-65fe1af0017e", "complexData": [ { "name": "culture", "data": "en", "type": "String" } ], "supervisor": { "id": "6320ea4c-f274-4d0d-a249-3d23c15d0468", "firstName": "FirstName", "lastName": "lastName", "email": "lastName@example.pl" } }
Delete Organization Unit
Delete an Organization Unit
DELETE/OrganizationUnit/{orgUnitId}
Check the Organizational unit section on our swagger UI page.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article