Clocked Times - GetBric/API GitHub Wiki

Clocked Times are for running timers. You can start and stop a Clocked Time multiple times throughout the day and it will aggregate all of the time when you assign it. When you are finished recording time for the day, set assigned to true and the Clocked Time will convert to a Project Time that will actually record on your timesheet. You will not be allowed to edit a Clocked Time after it has been assigned; however, you can edit the Project Time at any time.

Clocked Time Index

  • Route: /clocked_times
  • Method: GET
  • Allowed Fields:
    • person_id (limit project_times shown by person)
    • project_id (limit project_times shown by project)
    • person_role_id (limit project_times shown by person_role)
  • Expected Response:
{
  "clocked_times": [
    {
      "id": 614,
      "link": "https://api.getbric.com/v1/project_times/614",
      "person": {
        "id": 1062390220,
        "link": "https://api.getbric.com/v1/people/1062390220",
        "first_name": "Sean",
        "last_name": "Connery",
        "email": "[email protected]"
      },
      "project": {
        "id": 1052037200,
        "link": "https://api.getbric.com/v1/projects/1052037200",
        "name": "Homepage Redesign"
      },
      "person_role": {
        "id": 1018350804,
        "link": "https://api.getbric.com/v1/person_roles/1018350804",
        "name": "Designer"
      },
      "day": "2016-04-23",
      "minutes": 1,
      "running?": true,
      "stopwatch_times": [
        {
          "start_time": "2016-04-22T12:09:56.176-04:00",
          "end_time": null,
          "minutes": 1,
          "running?": true
        }
      ],
      "created_at": "2016-04-22T12:09:56.134-04:00",
      "updated_at": "2016-04-22T12:09:56.134-04:00"
    },
    {
      "id": 615,
      "link": "https://api.getbric.com/v1/project_times/615",
      "person": {
        "id": 1062390218,
        "link": "https://api.getbric.com/v1/people/1062390218",
        "first_name": "Glenn",
        "last_name": "Quagmire",
        "email": "[email protected]"
      },
      "project": {
        "id": 1052037200,
        "link": "https://api.getbric.com/v1/projects/1052037200",
        "name": "Website Redesign"
      },
      "person_role": {
        "id": 1018350804,
        "link": "https://api.getbric.com/v1/person_roles/1018350804",
        "name": "Designer"
      },
      "day": "2016-04-23",
      "minutes": 1,
      "running?": true,
      "stopwatch_times": [
        {
          "start_time": "2016-04-22T12:10:14.516-04:00",
          "end_time": null,
          "minutes": 1,
          "running?": true
        }
      ],
      "created_at": "2016-04-22T12:10:14.467-04:00",
      "updated_at": "2016-04-22T12:10:14.467-04:00"
    }
  ]
}

Clocked Time Create

  • Route: /clocked_times
  • Method: POST
  • Required Fields:
    • person_id
  • Allowed Fields:
    • assigned (default value is false. Set to true to generate a Project Time.)
    • person_role_id (must be set in order to assign)
    • project_id (must be set in order to assign)
    • minutes (setting minutes will only work if assigned is set to true. Otherwise, the timers will override what you choose here.)
  • Expected Response:
{
  "clocked_times": {
    "id": 613,
    "link": "https://api.getbric.com/v1/clocked_times/613",
    "person": {
      "id": 1062390218,
      "link": "https://api.getbric.com/v1/people/1062390218",
      "first_name": "Glenn",
      "last_name": "Quagmire",
      "email": "[email protected]"
    },
    "project": {
      "id": 1052037200,
      "link": "https://api.getbric.com/v1/projects/1052037200",
      "name": "Homepage Redesign"
    },
    "person_role": {
      "id": 1018350804,
      "link": "https://api.getbric.com/v1/person_roles/1018350804",
      "name": "Project Manager"
    },
    "day": "2016-04-22",
    "minutes": 1,
    "running?": true,
    "stopwatch_times": [
      {
        "start_time": "2016-04-21T14:19:32.825-04:00",
        "end_time": null,
        "minutes": 1,
        "running?": true
      }
    ],
    "created_at": "2016-04-21T14:19:32.778-04:00",
    "updated_at": "2016-04-21T14:19:32.778-04:00"
  }
}

Clocked Time Show

  • Route: /clocked_times/id
  • Method: GET
  • Expected Response:
{
  "clocked_times": {
    "id": 613,
    "link": "https://api.getbric.com/v1/clocked_times/613",
    "person": {
      "id": 1062390218,
      "link": "https://api.getbric.com/v1/people/1062390218",
      "first_name": "Glenn",
      "last_name": "Quagmire",
      "email": "[email protected]"
    },
    "project": {
      "id": 1052037200,
      "link": "https://api.getbric.com/v1/projects/1052037200",
      "name": "Homepage Redesign"
    },
    "person_role": {
      "id": 1018350804,
      "link": "https://api.getbric.com/v1/person_roles/1018350804",
      "name": "Project Manager"
    },
    "day": "2016-04-22",
    "minutes": 1,
    "running?": true,
    "stopwatch_times": [
      {
        "start_time": "2016-04-21T14:19:32.825-04:00",
        "end_time": null,
        "minutes": 1,
        "running?": true
      }
    ],
    "created_at": "2016-04-21T14:19:32.778-04:00",
    "updated_at": "2016-04-21T14:19:32.778-04:00"
  }
}

Clocked Time Update

  • Route: /clocked_times/id
  • Method: PATCH
  • Allowed Fields:
    • start (allowed values: true or false, set to true to start the timer)
    • stop (allowed values: true or false, set to true to stop the timer)
    • assigned (allowed values: true or false. Setting to true will stop a running timer.)
    • person_id
    • person_role_id
    • project_id
    • minutes (setting minutes will only work if assigned is set to true. Otherwise, the timers will override what you choose here.)
  • Expected Response:
{
  "clocked_times": {
    "id": 613,
    "link": "https://api.getbric.com/v1/clocked_times/613",
    "person": {
      "id": 1062390218,
      "link": "https://api.getbric.com/v1/people/1062390218",
      "first_name": "Glen",
      "last_name": "Quagmire",
      "email": "[email protected]"
    },
    "project": {
      "id": 1052037200,
      "link": "https://api.getbric.com/v1/projects/1052037200",
      "name": "Homepage Redesign"
    },
    "person_role": {
      "id": 1018350804,
      "link": "https://api.getbric.com/v1/person_roles/1018350804",
      "name": "Project Manager"
    },
    "day": "2016-04-22",
    "minutes": 7,
    "running?": true,
    "stopwatch_times": [
      {
        "start_time": "2016-04-21T14:27:00.528-04:00",
        "end_time": null,
        "minutes": 1,
        "running?": true
      },
      {
        "start_time": "2016-04-21T14:19:32.825-04:00",
        "end_time": "2016-04-21T14:25:26.974-04:00",
        "minutes": 6,
        "running?": false
      }
    ],
    "created_at": "2016-04-21T14:19:32.778-04:00",
    "updated_at": "2016-04-21T14:25:27.123-04:00"
  }
}

Clocked Time Destroy

  • Route: /clocked_times/id
  • Method: DELETE
  • Expected Response:
{
  "clocked_times": {
    "id": 613,
    "link": "https://api.getbric.com/v1/clocked_times/613",
    "person": {
      "id": 1062390218,
      "link": "https://api.getbric.com/v1/people/1062390218",
      "first_name": "Glenn",
      "last_name": "Quagmire",
      "email": "[email protected]"
    },
    "project": {
      "id": 1052037200,
      "link": "https://api.getbric.com/v1/projects/1052037200",
      "name": "Homepage Redesign"
    },
    "person_role": {
      "id": 1018350804,
      "link": "https://api.getbric.com/v1/person_roles/1018350804",
      "name": "Project Manager"
    },
    "day": "2016-04-22",
    "minutes": 6,
    "running?": false,
    "stopwatch_times": [],
    "created_at": "2016-04-21T14:19:32.778-04:00",
    "updated_at": "2016-04-21T14:25:27.123-04:00"
  }
}