Position Green API - Organisational Units

Modified on Thu, 10 Apr at 8:11 AM

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


PropertyData TypeDescription

id

Guid

Id of the Organization Unit

globalIdGuidGlobal Id of the Organization Unit
yearIdGuid

Id of year assigned to the Organization Unit

prettyIdstringPretty Id of the Organization Unit

parentId


Guid
Parent Id of Organization Unit
organizationIdGuidId 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


ParameterRequiredTypeDescription
nameYesstringName of the Organization Unit
parentIdNoGuidId of Parent (optional)
prettyIdYesstring
complexData (array of)NoJSONObject[]

Complex data of the Organization Unit (eg. { "name": "culture", "data": "en", "type": "String" })

nameYesstringName of data complex element
dataYesobject

Data of the element

typeYesenum

Possible values: [ String, Number, Date, Bool]

supervisorNoJSONObjectSupervisor of the Organization Unit
firstNameYesstringFirst name of the supervisor
lastNameYesstringLast name of the supervisor
email

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.


ParameterRequiredTypeDescription

name

YesstringName of the Organization Unit
parentIdNo

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" })

 nameYesstringName of data complex element
dataYesobjectData of the element
 type

Yes


enumPossible values: [ String, Number, Date, Bool ]
supervisor

No

JSONObjectSupervisor of the Organization Unit
firstNameYesstringFirst name of the supervisor
lastNameYes

string


Last name of the supervisor
email

Yes


stringEmail 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

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article