entries/timespent

Calculates the sum of the time spent on entries specified by the call parameters.

URL

http://api.staction.com/entries/timespent.format

HTTP Method:

GET

Required Parameters

  • dateBefore: filters the sum by time range, counting only entries that were created before a given date. Format is mm/dd/yyyy.
  • dateAfter: filters the sum by time range, counting only entries that were created after a given date. Format is mm/dd/yyyy.

Optional Parameters

  • projectId: filters time entries that were tagged under the project with the specified ID.
  • userId: filters time entries that were sent by the user with the specified ID.

Examples (using curl)

  • curl -d “developerKey=123&account=paste&email=test@pasteinteractive.com&password=mypassword” http://api.staction.com/entries/timespent.json?dateBefore=01/01/2009&dateAfter=12/10/2008
  • curl -d “developerKey=123&account=paste&email=test@pasteinteractive.com&password=mypassword” http://api.staction.com/entries/timespent.json?dateBefore=01/01/2009&dateAfter=12/10/2008&userId=123&projectId=456

Expected Responses

If the call fails to be executed properly, the API will return an error in the default error format, with a status field set to false, and a reason field explaining why it failed to run, also respecting the format requested.

If the call runs properly, it will return with status set to true, and time_spent set to the number of hours spent in decimal format. As an example, here’s a parsed JSON response, transferred into a multidimensional array for the sake of clarity.

Array
(
    [status] => true
    [time_spent] => 58.25
)