Creates a new timesheet.
Parameter | Mandatory | Description | Examples | More Info |
---|---|---|---|---|
API | Yes | The API area | tspending.json | |
General | Yes | Parameters described in overview | see overview | Structure of an API call |
Action | Yes | The action to perform | action=create | |
Input | Yes | JSON string | See below |
JSON Input | Mandatory | Description | Examples |
---|---|---|---|
tspJobAndPhase | Yes | Job and phase number | "tspJobAndPhase":"1/00000001.001" |
tspStageCode | If 2 tier job - Yes | Stage code | "tspStageCode":"1/00000001.003" |
tspTimeDate | Yes | Time and date | "tspTimeDate": "2018-07-18" |
tspResourceCode | Yes | Resource code | "tspResourceCode": "1/RC" |
tspChargeCode | No | Charge code | "tspChargeCode": "1/CC" |
tspHoursNormal | Yes | Charge code | "tspHoursNormal": 2 |
Note:
In order to create a pending time sheet in Synergist, it is vital to pass all the required parameters. The required parameters may include stages if you are using 2-tier jobs. To validate each parameter you will need to call the relevant lookup lists for the parameter in question. For instance, the 'Charge code list' in this section of the API should be used to validate a charge code before the 'create' endpoint is called. Each of these lists will also require their own parameters since the returned values are filtered to conform with Synergist business rules. In the case of charge codes, the user name being passed will define which charge codes are valid for the user/company.
Example request:
http://<SERVER>/jsonapi/tspending.json?user=user&password=user&version=3.9&action=create&input=
{
"data": [
{
"tspJobAndPhase": "3/00001114.001",
"tspTimeDate": "2019-07-12",
"tspResourceCode": "3/U",
"tspChargeCode": "3/CC",
"tspHoursNormal":2
}
]
}
Example response:
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"totalrows": 1,
"totalpages": 1,
"responsemessage": "",
"pagerows": 0,
"pagenumber": 1,
"success": true,
"data": [
{
"tspUuid": "F9896E8E3EBAD047A0C346C8929BA0DD",
"tspTimeStampModified": 1563179052,
"tspRecordVersionNumber": 0,
"tspApprovalStatus": "W",
"tspChargeCode": "3/CC",
"tspComplete": "",
"tspDiaryInternal": 0,
"tspEntryNo": 14822,
"tspHoursNormal": 2,
"tspHoursOtime1": 0,
"tspHoursOtime2": 0,
"tspJobAndPhase": "3/00001114.001",
"tspMaterialCode": "",
"tspMatQuantity": 0,
"tspTaskDescription": "",
"tspTimeDate": "2019-07-12",
"tspWorkDone": "",
"tspStageCode": "",
"tspApprovalStatusName": "Unsubmitted",
"tspChargeCodeDescription": "Charge code",
"tspApproverNotes": "",
"tspCompleteStages": false,
"tspCopy": "Y",
"tspDelete": "Y",
"tspEdit": "Y",
"tspMaterials": 0,
"tspMovestages": false,
"tspSubmit": "N",
"tspSubmitterNotes": "",
"tspTimerElapsedNormal": 0,
"tspTimerElapsedOt1": 0,
"tspTimerElapsedOt2": 0,
"tspTimerStatusNormal": "",
"tspTimerStatusOt1": "",
"tspTimerStatusOt2": "",
"tspPhaseDescription": "",
"tspJobPhaseNumberSimple": "1114.001",
"tspClientCode": "3/C113",
"tspJobClientName": "613 AW Test",
"tspPhaseJobDescription1stline": "478 AW Test",
"tspStageCurrentDescription": "",
"tspMatDescription": "",
"tspStageDescription": ""
}
]
}