Position

This article discusses all the APIs related to Position object.

Position refers to the job profile of a person in the organization. 

Get all Positions 

GET /xPosition

Retrieves all the existing positions.

For example, 

GET https://corehr-api.hrcloud.com/v1/cloud/xPosition

Response:

[
{
"Id": "8f72612cca4b41d4d4f34503a5cfabad",
"xDescription": null,
"xPositionCode": "22bbbbcc-a6ad-428f-95e1-8756fa9e3432",
"xPositionTitle": "Quality Assurance Engineer",
"xRecordStatus": "Active"
},
{
"Id": "8f72612cca4b41d4d491f036bf5e4977",
"xDescription": null,
"xPositionCode": "6e6c82a7-7547-44f0-8e85-45c450b49a0e",
"xPositionTitle": "Manager, Client Services-FNL",
"xRecordStatus": "Active"
},
{
"Id": "8f72612cca4b41d4b59217de43195f3a",
"xDescription": null,
"xPositionCode": "ab19bce8-2cb3-427f-aa68-9aec79b0cf76",
"xPositionTitle": "President",
"xRecordStatus": "Active"
},
...
]

Get a Position by Id

GET /xPosition/:positionId

Retrieves a specific position given the position Id.

For example, 

GET https://corehr-api.hrcloud.com/v1/cloud/xPosition/397f34629fa8ae95

Response:

{
"Id": "397f34629fa8ae95",
"xDescription": null,
"xPositionCode": "PAYAD",
"xPositionTitle": "Payroll Admin",
"xRecordStatus": "Active"
}

Create a new position record

POST /xPosition

Creates a new position with the input fields. Following input parameters are used to create a new position. Please note that an Id field is automatically assigned to the position object on creation. 

Name Type Description Mandatory
xPositionCode String Alpha-numeric code of position Yes
xPositionTitle String Title of the position Yes
xRecordStatus String Active or Inactive Yes
xDescription String Description for the position No

For example, 

POST https://corehr-api.hrcloud.com/v1/cloud/xPosition

Input fields:

{
"xPositionTitle": "Payroll Manager",
"xPositionCode": "PAYM",
"xRecordStatus": "Active"
}

Response:

[
{
"Id": "ef622dc7ecd95f7cdd8de6cbcca4273e",
"xDescription": null,
"xPositionCode": "PAYM",
"xPositionTitle": "Payroll Manager",
"xRecordStatus": "Active"
}
]

Update an existing Position

PUT /xPosition

Update a position using the specified ID (or field in the method), and parameters. For example,

Request :

PUT https://corehr-api.hrcloud.com/v1/cloud/xPosition

Input parameters:

[
{
"Id": "41d975bccb58d6ecabc59983cb8ce6ab",
"xDescription": "Technical Documentation",
"xPositionCode": "8db5278f-ec42-4d74-b8d4-964c61123832",
"xPositionTitle": "Tech writer",
"xRecordStatus": "Active"
}
]

Response:

[
{
"Id": "41d975bccb58d6ecabc59983cb8ce6ab",
"xDescription": "Technical Documentation",
"xPositionCode": "8db5278f-ec42-4d74-b8d4-964c61123832",
"xPositionTitle": "Tech writer",
"xRecordStatus": "Active"
},
]

Please note that you can also update multiple records in the same way. For example,

Request:

PUT https://corehr-api.hrcloud.com/v1/cloud/xPosition

Input parameters:

[
{
"Id": "6d66ddef63e786dc4b220012decfc3c1",
"xDescription": "Automation testing",
"xPositionCode": "8db5278f-ec42-4d74-b8d4-964c61123632",
"xPositionTitle": "Q&A",
"xRecordStatus": "Active"
},
{
"Id": "41d975bccb58d6ecabc59983cb8ce6ab",
"xDescription": "Technical Documentation",
"xPositionCode": "8db5278f-ec42-4d74-b8d4-964c61123832",
"xPositionTitle": "Tech writer",
"xRecordStatus": "Active"
},
]

Alternatively, you can also use any of the other unique fields of the position object to update a record. In that case, the Id field is not required in the input parameters. Instead the Identifier field is provided in the URL. For example,

Request:

PUT https://corehr-api.hrcloud.com/v1/cloud/xPosition?Identifier=xPositionCode

Input parameters:

[
{
"xDescription": "Technical Documentation - Remote",
"xPositionCode": "8db5278f-ec42-4d74-b8d4-964c61123832",
"xPositionTitle": "Tech writer",
"xRecordStatus": "Active"
}
]