11. Time Spent

Interface

It allows you:

  • to insert new daily time (master&details in one json file)

  • to view all entered daily times (master&details in one json file)

  • to update - that means "void"+"insert"

  • to delete - that means "void"

Prerequisites: in order to use this API Method for POST there must be accomplished the following requirements in SocrateCloud:

  • to have an Organization active

  • to have Employees active (users)

Columns that can be used as filters / will be listed only documents in "Completed" or "Closed" document status:

  • Organization

  • DocumentNo

  • Project - project name

  • ProjectPhase - phase name

  • ProjectSubphase - subphase name

  • Email - of user

  • Activity

Actions can be done:

  • list

  • create

  • void

API Methods:

List:

URL: https://api.socratecloud.com/webapi/rest/timespent/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}

Method: GET

Return: JSON object with next format:

{

"data": [

{

"Organization": "Demo SRL",

"Created": "2014-09-09 10:16:01+0300",

"CreatedBy": "SuperUser",

"Updated": "2014-09-09 10:44:56+0300",

"UpdatedBy": "SuperUser",

"Active": true,

"DocumentNo": "1000300",

"Description": "some time spent",

"Project": "Project with phases",

"ProjectPhase": "Phase 1",

"ProjectSubphase": null,

"Email": "some_email@host.ro",

"QtySpent": 60

}

],

"totalRows": 1

}

Create:

URL: https://api.socratecloud.com/webapi/rest/timespent/create/{version}?startRow={0}&endRow={100}&accessToken={access_token}

Method: POST

Return: document no for success or error message (start with "ERROR: "). Document will be in "Completed" status.

Data format:

{

"Organization": "Demo SRL",

"Active": true,

"DateTrx": "2014-09-09 00:00:00+0300",

"Description": "Testare API 2",

"Project": "Project X",

"ProjectPhase": "Phase 3",

"ProjectSubphase": null,

"Email": "email_xyz@host.ro",

"QtySpent": 40

}

Void:

URL: https://api.socratecloud.com/webapi/rest/timespent/void/{version}?startRow={0}&endRow={100}&accessToken={access_token}&DocumentNo={document_no}

Method: POST

Return: document status for success ("Voided") or error message (start with "ERROR: ")