Timers

GET api/v2/Timers

Description: Returns a paged list of all running timers and the 10 most recent paused timers for the current week. Example: https://api.totalsynergy.com/api/v2/Timers Response:

{
  "totalItems": 1,
  "items": [
    {
      "id": null,
      "startDate": "2016-08-02T06:57:32.1788558Z",
      "endDate": null,
      "userName": "SynergyUser",
      "text": "Api documentation",
      "isRunning": true,
      "groupId": "36803fa8-b782-401c-8a9e-5f8b923cc188",
      "duration": 7220,
      "durationDisplay": "2 hour 1 min",
      "details": "02 Aug 2016",
      "organisationId": 470,
      "organisationName": "Fabrikam - OZ",
      "organisationSlug": "fabrikam",
      "projectId": 1050,
      "projectName": "21 Waratah Street - Residence redevelopment",
      "stageId": 0,
      "stageName": null,
      "taskId": 0,
      "taskName": null,
      "isToday": true
    }
  ],
  "currentPage": 0,
  "pageSize": 10,
  "totalPages": 1,
  "hasNext": true
}
                        

Try it out

Loading...
200
        {Response body}
			
Method
GET
Request Headers
'Content-Type': 'application/json' token
URL
http://some url here.com

POST api/v2/Timers

Description: Create a new timer. Supplying no parameters will create a timer without any details.
Optional Parameters:
Text string value - Description of the timer
Duration long value - Starting time of the timer
ProjectId long value - Project to assign the timer to
TaskId long value - Task to assign the timer to
StageId long value - Stage to assign the timer to
OrganisationId long value - Organisation to assign the timer to
GroupId string value - Timer group to add the timer to
Example: https://api.totalsynergy.com/api/v2/Timers?Text=Testing&Duration=50 Example Request:

{
  "text" : "Testing",
  "duration" : 50
}
                        
Response:

{
  "id": null,
  "startDate": "2016-08-02T23:23:17.9866374Z",
  "endDate": null,
  "userName": "SynergyUser",
  "text": "Testing",
  "isRunning": true,
  "groupId": "af7f7a12-2df8-4d33-8026-659a68aa4f9c",
  "duration": 50,
  "durationDisplay": "1 min",
  "details": "03 Aug 2016",
  "organisationId": 0,
  "organisationName": null,
  "organisationSlug": null,
  "projectId": 0,
  "projectName": null,
  "stageId": 0,
  "stageName": null,
  "taskId": 0,
  "taskName": null,
  "isToday": true
}
                        

PUT api/v2/Timers/Update

Description: Update a timer.
Required Parameters:
GroupId string value - Timer group to update
Optional Parameters:
Text string value - Description of the timer
Duration long value - Starting time of the timer
ProjectId long value - Project to assign the timer to
TaskId long value - Task to assign the timer to
StageId long value - Stage to assign the timer to
OrganisationId long value - Organisation to assign the timer to
Example Request:

{
  "text" : "UpdatedText",
  "groupId" : "af7f7a12-2df8-4d33-8026-659a68aa4f9c9"
}
                        
Example: https://api.totalsynergy.com/api/v2/Timers/Update?GroupId=af7f7a12-2df8-4d33-8026-659a68aa4f9c9&Text=UpdatedText Response:

{
  "id": null,
  "startDate": "2016-08-02T23:23:17.9866374Z",
  "endDate": null,
  "userName": "AdamHannigan",
  "text": "UpdatedText",
  "isRunning": true,
  "groupId": "af7f7a12-2df8-4d33-8026-659a68aa4f9c",
  "duration": 373,
  "durationDisplay": "6 mins",
  "details": "03 Aug 2016",
  "organisationId": 0,
  "organisationName": "",
  "organisationSlug": "",
  "projectId": 0,
  "projectName": "",
  "stageId": 0,
  "stageName": "",
  "taskId": 0,
  "taskName": "",
  "isToday": true
}
                        

POST api/v2/Timers/Start

Description: Start a timer.
Required Parameters:
GroupId string value - Timer group to start
Example: https://api.totalsynergy.com/api/v2/Timers/Start?GroupId=af7f7a12-2df8-4d33-8026-659a68aa4f9c9 Response:

{
  "id": null,
  "startDate": "2016-08-02T23:23:17.9866374Z",
  "endDate": null,
  "userName": "SynergyUser",
  "text": "UpdatedText",
  "isRunning": true,
  "groupId": "af7f7a12-2df8-4d33-8026-659a68aa4f9c",
  "duration": 0,
  "durationDisplay": "< 1 min",
  "details": "03 Aug 2016",
  "organisationId": 0,
  "organisationName": null,
  "organisationSlug": null,
  "projectId": 0,
  "projectName": null,
  "stageId": 0,
  "stageName": "",
  "taskId": 0,
  "taskName": "",
  "isToday": true
}
                        

POST api/v2/Timers/Stop

Description: Stop a timer.
Required Parameters:
GroupId string value - Timer group to stop
Example: https://api.totalsynergy.com/api/v2/Timers/Stop?GroupId=af7f7a12-2df8-4d33-8026-659a68aa4f9c9 Response:

{
  "id": null,
  "startDate": "2016-08-02T23:23:17.9866374Z",
  "endDate": "2016-08-02T23:32:55.8250791Z",
  "userName": "AdamHannigan",
  "text": "UpdatedText",
  "isRunning": false,
  "groupId": "af7f7a12-2df8-4d33-8026-659a68aa4f9c",
  "duration": 67,
  "durationDisplay": "1 min",
  "details": "03 Aug 2016",
  "organisationId": 0,
  "organisationName": null,
  "organisationSlug": null,
  "projectId": 0,
  "projectName": null,
  "stageId": 0,
  "stageName": "",
  "taskId": 0,
  "taskName": "",
  "isToday": true
}
                        

GET api/v2/Timers/GetPagedTimers

Description: Returns a paged list of paused timers within a date constraint.
Required Parameters:
Page int value - Page of timers to retrieve
Optional Parameters:
Date Date value - Timers after a given date (format - ddd MMM d yyyy HH:mm:ss)
Example: https://api.totalsynergy.com/api/v2/Timers/GetPagedTimers?page=1 Response:

                                 {
  "totalItems": 34,
  "items": [
    {
      "id": null,
      "startDate": "2016-08-02T23:23:17.9866374Z",
      "endDate": "2016-08-02T23:32:55.8250791Z",
      "userName": "AdamHannigan",
      "text": "UpdatedText",
      "isRunning": false,
      "groupId": "af7f7a12-2df8-4d33-8026-659a68aa4f9c",
      "duration": 67,
      "durationDisplay": "1 min",
      "details": "03 Aug 2016",
      "organisationId": 0,
      "organisationName": null,
      "organisationSlug": null,
      "projectId": 0,
      "projectName": null,
      "stageId": 0,
      "stageName": "",
      "taskId": 0,
      "taskName": "",
      "isToday": true
    },
    ......8 more timer objects.......
    {
      "id": null,
      "startDate": "2016-07-03T08:32:16.6765564Z",
      "endDate": "2016-07-03T08:34:16.5971091Z",
      "userName": "AdamHannigan",
      "text": "New Timers UI",
      "isRunning": false,
      "groupId": "5f3ab51e-bbe2-4546-a856-f413149f7f86",
      "duration": 120,
      "durationDisplay": "2 mins",
      "details": "03 Jul 2016",
      "organisationId": 0,
      "organisationName": "Interns R Us",
      "organisationSlug": "internsrus",
      "projectId": 1031,
      "projectName": "",
      "stageId": 0,
      "stageName": null,
      "taskId": 0,
      "taskName": null,
      "isToday": false
    }
  ],
  "currentPage": 1,
  "pageSize": 10,
  "totalPages": 4,
  "hasNext": true
}
                        

DELETE api/v2/Timers/Delete

Description: Delete a timer.
Required Parameters:
GroupId string value - Timer group to delete
Example: https://api.totalsynergy.com/api/v2/Timers/Delete?GroupId=af7f7a12-2df8-4d33-8026-659a68aa4f9c9 Response:

                                 {
  "id": null,
  "startDate": "0001-01-01T00:00:00",
  "endDate": null,
  "userName": null,
  "text": null,
  "isRunning": false,
  "groupId": "af7f7a12-2df8-4d33-8026-659a68aa4f9c",
  "duration": 0,
  "durationDisplay": null,
  "details": null,
  "organisationId": 0,
  "organisationName": null,
  "organisationSlug": null,
  "projectId": 0,
  "projectName": null,
  "stageId": 0,
  "stageName": null,
  "taskId": 0,
  "taskName": null,
  "isToday": false
}
                        

GET api/v2/Timers/ProjectSummary

Description: Get a list of the users current projects available for timer use. Example: https://api.totalsynergy.com/api/v2/Timers/ProjectSummary Response:

[
  {
    "id": 1029,
    "name": "",
    "number": "",
    "display": "  ",
    "organisationId": 8,
    "organisation": "Contractors Contracts",
    "group": null,
    "groupId": 0
  },
  {
    "id": 1164,
    "name": "",
    "number": "",
    "display": "  ",
    "organisationId": 470,
    "organisation": "Fabrikam - OZ",
    "group": null,
    "groupId": 0
  }
]