Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview: The goal of TimeTrackingService is used to track the time activities across the different line of businesses and help them out them to use this service as per their time entry needs.

TTS swagger page is available in SCED from the following location:

https://ncdtimetrackingserviceapp01.azurewebsites.net/swagger/index.html

TTS supports the following API endpoints:

  1. GetAccumulatedTimes: It will return the time spent in hours for all the users and work items.

Type: GET

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/GetAccumulatedTimes

Response:

Code Block
languagejson
{
  "usersTime": [
    {
      "workitem": 0,
      "username": "string",
      "accumulatedtime": 0
    }
  ],
  "workflowsTime": [
    {
      "workitem": 1000001,
      "username": "571879ae-52c5-4644-84a3-b13f7391a13f",
      "accumulatedtime": 0.01
    }
  ]
}

2. AddStartTimeEntry: It will add the new time entry with start time only based on work item and user.

Type: POST

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/AddStartTimeEntry?ItemId=1000001&userId=571879ae-52c5-4644-84a3-b13f7391a13f&sessionid=test%20&userDisplayName=Maloth%2C%20Raju

Response:

Code Block
languagejson
{
  "itemid": 1000001,
  "workitemname": null
}

3. AddCloseTimeEntry: It will update the time entry with end time based on end time null, work item id and user.

Type: POST

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/AddCloseTimeEntry?ItemId=1000001&userId=571879ae-52c5-4644-84a3-b13f7391a13f&sessionid=test&AuditReason=Submit&TimeToReduce=0&userDisplayName=Maloth%2C%20Raju

Response:

Code Block
languagejson
{

  "itemid": 0,

  "workitemname": null

}

4. GetWorkItemAccumulateTime: It will return the whole time spent based on work item id.

Type: GET

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/GetWorkItemAccumulateTime?workItemId=1000001

Response:

Code Block
languagejson
[

  {

    "id": 0,

    "userid": "571879ae-52c5-4644-84a3-b13f7391a13f",

    "userdisplayname": "Maloth, Raju",

    "workitemid": 1000001,

    "autocapturedtime": 40365.28,

    "actualtime": null,

    "comments": null,

    "updatedby": null,

    "updatedat": null

  },

  {

    "id": 0,

    "userid": "7d3f0e65-87b6-420b-a633-96d5e144a6d7",

    "userdisplayname": "Remo, Alex",

    "workitemid": 1000001,

    "autocapturedtime": 16461.62,

    "actualtime": null,

    "comments": null,

    "updatedby": null,

    "updatedat": null

  }

]

5. SubmitWorkItemTimes: It will submit the work items based on request body

Type: POST

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/SubmitWorkItemTimes

Request_Body:

Code Block
languagejson
[

  {

    "id": 0,

    "userid": "571879ae-52c5-4644-84a3-b13f7391a13f",

    "userdisplayname": "Maloth, Raju",

    "workitemid": 1000001,

    "autocapturedtime": 10,

    "actualtime": 20,

    "comments": "test",

    "updatedby": "Maloth, Raju",

    "updatedat": "2023-02-06T22:31:36.958Z"

  }

]

Response:

Code Block
languagejson
[

  {

    "id": 85,

    "userid": "571879ae-52c5-4644-84a3-b13f7391a13f",

    "userdisplayname": "Maloth, Raju",

    "workitemid": 1000001,

    "autocapturedtime": 10,

    "actualtime": 20,

    "comments": "test",

    "updatedby": "Maloth, Raju",

    "updatedat": "2023-02-06T22:40:03.9622209Z"

  }

]

6. GetWorkItemAdjustedTimes: It will return the time spend based on work item id.

Type:GET

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/GetWorkItemAdjustedTimes?workItemId=1000001

Response:

Code Block
languagejson
[

  {

    "id": 85,

    "userid": "571879ae-52c5-4644-84a3-b13f7391a13f",

    "userdisplayname": "Maloth, Raju",

    "workitemid": 1000001,

    "autocapturedtime": 10,

    "actualtime": 20,

    "comments": "test",

    "updatedby": "Maloth, Raju",

    "updatedat": "2023-02-06T22:40:03.9622209Z"

  }

]

7. GetWorkItemEntry: It will return all the time entries based on UserId.

Type: GET

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/GetWorkItemEntry?userId=571879ae-52c5-4644-84a3-b13f7391a13f

Response:

Code Block
languagejson
[

  {

    "workitemid": 1000001,

    "activity": 20,

    "activitydate": "2022-10-27",

    "hourtype": 1,

    "comments": "Comments",

    "status": 1,

    "timeentryid": 4,

    "hours": 0,

    "minutes": 0,

    "lastupdateddatetime": "2022-10-28T22:42:44.207103Z"

  }

]

8. SubmitAdminTimeSpent: It will insert/update the time entry based on request body.

Type: POST

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/SubmitAdminTimeSpent

Request_Body:

Code Block
languagejson
{

  "timeEntryId": 201,

  "itemId": 1000001,

  "userId": "571879ae-52c5-4644-84a3-b13f7391a13f",

  "sessionId": "test",

  "userDisplayName": "Maloth, Raju",

  "startTime": 1673300011,

  "endTime": 1673301011,

  "activityId": 20,

  "hourTypeId": 1,

  "activityDate": "2023-02-06T22:52:42.055Z",

  "isAdmin": true

}

Response:

Code Block
languagejson
{

  "httpStatusCode": 200,

  "message": "Request Processed Successfully",

  "data": null

}

9. DeleteTimeEntry: It will delete the time entry based on time entry id.

Type:DELETE

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/DeleteTimeEntry?timeEntryId=257

Response:

Code Block
languagejson
{

  "httpStatusCode": 200,

  "message": "Request Processed Successfully",

  "data": null

}

10. UpdateTimeEntryStatus: It will update the time entry based on Time Entry Id and Status Id.

Type: PUT

URL: https://ncdtimetrackingserviceapp01.azurewebsites.net/api/UpdateTimeEntryStatus?timeEntryId=201&timeEntryStatusId=2&timeentryidcrsm=0

Response:

Code Block
languagejson
{

  "httpStatusCode": 200,

  "message": "Request Processed Successfully",

  "data": null

}