Timesheet API - Version 1.0


Making a request

To make a API request, authorization token must be attached to headers.


Sample call:

curl -H "Content-Type: application/json" -H 'Authorization: Token <auth_token>' -X GET https://< SUBDOMAIN >.agbucket.com/api/1.0/<REQUEST_API/


Timesheet, GET

Fetches existing timesheet records.

  • URL
    • /api/1.0/timesheet/ 
  • URL Params
    • Optional
      • startdate=[iso-formatted date]
      • enddate=[iso-formatted date]
      • project_ids=[comma separated list]
      • user_id=[ comma separated list]
      • user_ext=[comma separated list] 
  • Success Response
    • Code: 200
    • Response example
{
  "count": 8,
  "next": null,
  "previous": null,
  "results": [
    {
      "task": 1,
      "employee": 9,
      "hours": "2.00",
      "note": "",
      "date": "2010-01-01",
      "id": 28405
    },
  • Sample Call
/api/1.0/timesheet/?startdate=2018-01-01&amp;enddate=2018-0103&amp;project_ids=1,2,3&amp;user_ext=externalid1,externalid2 


Timesheet, POST (Create)

Creates new timesheet record(s).

  • URL
    • /api/1.0/timesheet/
  • Data Params
    • Accepts single object or array of objects
    • Required
      • employee=[integer]
        • Internal Silverbucket employee id, this or employee_external is required
      • employee_external=[string]
        • Internal Silverbucket employee external, this or employee id is required
      • hours=[numeric]
      • date=[iso-formatted date]
      • task=[integer]
        • Silverbucket task id, this or project id is required
      • project=[integer]
        • Silverbucket project id, this or task id is required. If project id is defined records will be marked to project’s default task
    • Optional
      • note=[string]
      • hourly_rate=[integer]
  • Success Response
    • Code: 201
    • Response example
{
  "data": [
    {
      "task": 1,
      "employee": 1,
      "hours": "1.00",
      "note": "This is a note",
      "hourly_rate": 25,
      "date": "2010-01-01",
      "id": 28558
    }
  }
}
  • Sample Call
    • /api/1.0/timesheet/
    • Content
[{
  "employee": 1,
  "hours": 20,
  "note": "My Note 1",
  "task": 1,
  "date": "2010-01-01"
},
{
  "employee_external": "exti1",  // Employee ID can be omitted and use external ID instead
  "hours": 20,
  "note": "My Note 2",
  "project": 1, // Task ID can be omitted and use project ID instead
  "date": "2010-01-05"
}]


Timesheet, DELETE

Removes single timesheet record.

  • URL
    • /api/1.0/timesheet/{id}/
  • URL Params
    • Required
      • id=[integer]
        • Internal timesheet record id
  • Success Response
    • Code: 204
  • Sample Call
    • /api/1.0/timesheet/1/


Timesheet, PATCH

Update single timesheet record.

  • URL
    • /api/1.0/timesheet/{id}/
  • URL Params
    • Required
      • id=[integer]
        • Internal timesheet record id
  • Data Params
    • Updated field(s)
  • Success Response
    • Code: 200
    • Response
{
  "data": [
    {
      "task": 1,
      "employee": 1,
      "hours": "3.00",
      "note": "This is a note",
      "date": "2010-01-01",
      "id": 28558
    }
  }
}
  • Sample Call
    • /api/1.0/timesheet/1/
    • Sample Content
{
  "hours": 3.00
}


Timesheet, PUT

Update single timesheet record completely.

  • URL
    • /api/1.0/timesheet/{id}/
  • URL Params
    • Required
      • id=[integer]
        • Internal timesheet record id
  • Data Params
    • Required
      • employee=[integer]
        • Internal Silverbucket employee id
      • hours=[numeric]
      • date=[iso-formatted date]
      • task=[integer]
        • Silverbucket task id
    • Optional
      • note=[string]
  • Success Response
    • Code: 200
    • Response
{
  "task": 1,
  "employee": 1,
  "hours": "3.00",
  "note": "This is a note",
  "date": "2010-01-01",
  "id": 28558
}
  • Sample Call
    • /api/1.0/timesheet/1/
    • Sample Content
{
  "note": "Updated note",
  "task": 2,
  "hours": "6.00",
  "date": "2010-01-01",
  "employee": 1,
}