Task APIs

This article explains all the APIs related to the Task object.

Task is any job assigned to a person. The following APIs are used to perform different operations on Tasks.

Get all the tasks

GET /xTask

Retrieves all the tasks. For example, 

Request

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

Response:

{
"Id": "8320fb07077a2935",
"xApplicationLookup": {
"__ObjectName": "xApplication",
"__Self": "https://corehr-api.hrcloud.com/v1/cloud/xApplication/8320fb07077a2935",
"Id": "8320fb07077a2935",
"xCode": "coreHr",
"xImageUrl": null,
"xName": People,
},
"xApprovalStatus": "Approved",
"xAssigneeName": "Department Employee Group"
"xComment": "Postman test API Task 4b"
"xCompletedBy": null
"xCreatedBy": {
"__ObjectName": "xUser",
"__Self": "https://corehr-api.hrcloud.com/v1/cloud/xUser/6bbc95c8e04195751b93a27da1121454",
"Id": "6bbc95c8e04195751b93a27da1121454",
"xFullName": "New API Testing",
},
"xCreatedOn": "2019-08-19T09:56:16.5834862Z",
"xDueDate": "2019-08-21T00:00:00Z",
"xEmployeeGroupLookup": {
"__ObjectName": "xEmployeeGroup",
"__Self": "https://corehr-api.hrcloud.com/v1/cloud/xEmployeeGroup/517308d6e0d39f58",
"Id": "517308d6e0d39f58",
"xCreatedOn": "2019-06-26T04:39:23.997Z",
"xDescription": null,
"xIsActive": true,
"xName": "Department Employee Group",
},
"xIsAssignedToMe": false,
"xRecordStatus": "Active",
"xRelatedEntityDetailsLookup": {
"__ObjectName": "xRelatedEntityDetails",
"__Self": "https://corehr-api.hrcloud.com/v1/cloud/xRelatedEntityDetails/cb54493edf2bec2994ddbc5fe41a11b6",
"Id": "cb54493edf2bec2994ddbc5fe41a11b6",
"xName": "T1 T1 T1",
},
"xStatus": "Incomplete",
"xStatusText": "Incomplete",
"xSubject": "Postman API Task 4b",
"xType": "Plain",
"xUpdatedBy": {
"__ObjectName": "xUser",
"__Self": "https://corehr-api.hrcloud.com/v1/cloud/xUser/6bbc95c8e04195751b93a27da1121454",
"Id": "6bbc95c8e04195751b93a27da1121454",
"xFullName": "New API Testing",
},
"xUpdatedOn": "2019-08-19T09:56:19.1818448",
},
...
]

Get a particular task by Id

GET /xTask/:taskId

Retrieve a particular task using its Id.

Request:

GET https://corehr-api.hrcloud.com/v1/cloud/xTask/49fd50d7a91114b3

Response:

{
"Id": "0d8b50b027d819d58dbb9cefb5e75ca2",
"xApplicationLookup": {
"__ObjectName": "xApplication",
"__Self": "https://corehr-api.local.neogov.net/v1/cloud/xApplication/8320fb07077a2935",
"Id": "8320fb07077a2935",
"xCode": "coreHr",
"xImageUrl": null,
"xName": "People"
},
"xApprovalStatus": "Approved",
"xAssigneeName": "Department Employee Group",
"xComment": "Postman test API Task 4b",
"xCompletedBy": null,
"xCreatedBy": {
"__ObjectName": "xUser",
"__Self": "https://corehr-api.local.neogov.net/v1/cloud/xUser/6bbc95c8e04195751b93a27da1121454",
"Id": "6bbc95c8e04195751b93a27da1121454",
"xFullName": "New API Testing"
},
"xCreatedOn": "2019-08-19T09:56:16.5834862Z",
"xDueDate": "2019-08-21T00:00:00Z",
"xEmployeeGroupLookup": {
"__ObjectName": "xEmployeeGroup",
"__Self": "https://corehr-api.local.neogov.net/v1/cloud/xEmployeeGroup/517308d6e0d39f58",
"Id": "517308d6e0d39f58",
"xCreatedOn": "2019-06-26T04:39:23.997Z",
"xDescription": null,
"xIsActive": true,
"xName": "Department Employee Group"
},
"xIsAssignedToMe": false,
"xRecordStatus": "Active",
"xRelatedEntityDetailsLookup": {
"__ObjectName": "xRelatedEntityDetails",
"__Self": "https://corehr-api.local.neogov.net/v1/cloud/xRelatedEntityDetails/cb54493edf2bec2994ddbc5fe41a11b6",
"Id": "cb54493edf2bec2994ddbc5fe41a11b6",
"xName": "T1 T1 T1"
},
"xStatus": "Incomplete",
"xStatusText": "Incomplete",
"xSubject": "Postman API Task 4b",
"xType": "Plain",
"xUpdatedBy": {
"__ObjectName": "xUser",
"__Self": "https://corehr-api.local.neogov.net/v1/cloud/xUser/6bbc95c8e04195751b93a27da1121454",
"Id": "6bbc95c8e04195751b93a27da1121454",
"xFullName": "New API Testing"
},
"xUpdatedOn": "2019-08-19T09:56:19.1818448Z"
}

Create a new task 

POST /xTask/Portal

Creates a plain task with the following input parameters.

Field Type Description Is Mandatory
applicationCode String Alpha-numeric code for application for which the task is being created. It can take one of the following values- coreHr, onboard, benefits, offboard. Yes
title String Title of the task Yes
description String Description of the task, if any No
relatedToEmployeeIds Array of string Array Id of related employee Id Yes
assigneeType String Type of assignee. Valid values in (Employee, Manager, ManagersManager, HrAdmin, HrUser, HrOperation, ItUser, ItOperation, SpecificEmployee, SpecificGroup, Hierarchy) Yes
assignedEmployeeGroupId String Id of employee group. Could be retrieve via GET https:/corehr-api.hrcloud.com/v1/cloud/xEmployeeGroup Yes
assignedEmployeeId String Id of assigned employee Yes
taskType String Type of task. Must be 'task' only.  Yes
isOptionalToComplete Boolean If the task is optional or mandatory. No
isRequiredSignature Boolean Requires signature to complete the task.  
fixedDueDate DateTime the due date of the task Yes, when applicationCode is coreHR or benefits
relativeDueDate TimeOffset { timeUnit(Day, Week, Month, Year), direction(Before, After), offset } Relative DueDate for StartDate or SeparationDate to complete task Yes,When applicationCode is onboard or offboard
hierarchyLevel int Level of upper hierarchy level. From 1 to 9 Yes,When assigneeType is Hierarchy

An Id field is assigned to each record on creation.

For example, 

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

Input Parameters:

{
"applicationCode": "coreHr",
"taskTitle": "New Task API",
"taskDescription": "New Task API Description"
"relatedToEmployeeIds": ["8405669111f97c14571b1b33455aa7ba", "8405669111f97c1466376ea5d4af10aa"]
"assigneeType": "SpecificGroup"
"assignedEmployeeGroupId": "517308d6e0d39f58"
"taskType": "Task"
"fixedDueDate": "2019-08-21T00:00:00"
"relativeDueDate": {"timeUnit": "Day",
"direction": "After",
"offset": 10}
}

Response:

[
    {
       "Id": "ed6da578aa0def13a26126651155964a",
       "xApplicationLookup": {
           "__ObjectName": "xApplication",
           "__Self": "https://corehr-api.hrcloud.com/v1/cloud/xApplication/8320fb07077a2935",
           "Id": "8320fb07077a2935",
           "xCode": "coreHr",
           "xImageUrl": null,
           "xName": "People"
       },
       "xApprovalStatus": "Approved",
       "xAssigneeName": "Admin1",
      "xComment": "New Task API Description",
       "xCompanyName": "HR Cloud HC",
       "xCompletedBy": null,
       "xCreatedBy": {
           "__ObjectName": "xUser",
           "__Self": "https://corehr-api.hrcloud.com/v1/cloud/xUser/1a070ae0729cf3d6d791f9ab13a02e94",
           "Id": "1a070ae0729cf3d6d791f9ab13a02e94",
           "xFullName": "Shruti Kukkar"
       },
       "xCreatedOn": "2020-02-04T17:24:09.6235875Z",
       "xDueDate": "2019-08-21T00:00:00Z",
       "xEmployeeDepartmentName": "Human Resource - New York",
       "xEmployeeDivisionName": null,
       "xEmployeeEmail": "shruti1807@gmail.com",
       "xEmployeeGroupLookup": {
           "__ObjectName": "xEmployeeGroup",
           "__Self": "https://corehr-api.hrcloud.com/v1/cloud/xEmployeeGroup/2d980f113f6c30c6",
           "Id": "2d980f113f6c30c6",
           "xCreatedOn": "2018-07-04T18:10:41.297Z",
           "xDescription": "This group consists of all the employees who are administrators.",
           "xIsActive": true,
           "xName": "Admin1"
       },
       "xEmployeeLocationName": "Sample Location Name",
       "xEmployeePositionName": "Sample Position Name",
       "xEmploymentStatus": "Active",
       "xEmploymentType": null,
       "xIsAssignedToMe": true,
      "xIsOptionalToComplete": false,
       "xLastReminderSent": null,
       "xRelatedEntityDetailsLookup": {
           "__ObjectName": "xRelatedEntityDetails",
           "__Self": "https://corehr-api.hrcloud.com/v1/cloud/xRelatedEntityDetails/c6fd3fdd41d1e59cf32f9e8f8869fdbd",
           "Id": "c6fd3fdd41d1e59cf32f9e8f8869fdbd",
           "xName": "Shruti Kukkar"
       },
       "xShouldAcknowledgeBySignature": false,
       "xStatus": "Incomplete",
       "xStatusText": "Incomplete",
       "xSubject": "New Task API",
       "xType": "Plain",
       "xUpdatedBy": {
           "__ObjectName": "xUser",
           "__Self": "https://corehr-api.hrcloud.com/v1/cloud/xUser/1a070ae0729cf3d6d791f9ab13a02e94",
           "Id": "1a070ae0729cf3d6d791f9ab13a02e94",
           "xFullName": "Shruti Kukkar"
       },

        "xUpdatedOn": "2020-02-04T17:24:10.2486596Z"
   }

]