Create

Creates a new timesheet.

ParameterMandatoryDescriptionExamplesMore Info
APIYesThe API areatspending.json
GeneralYesParameters described in overviewuser=user&password=user&version=3.7v3.7 Overview
ActionYesThe action to performaction=create
InputYesJSON stringSee below
JSON InputMandatoryDescriptionExamples
tspJobAndPhaseYesJob and phase number"tspJobAndPhase":"1/00000001.001"
tspStageCodeIf 2 tier job - YesStage code"tspStageCode":"1/00000001.003"
tspTimeDateYesTime and date"tspTimeDate": "2018-07-18"
tspResourceCodeYesResource code"tspResourceCode": "1/RC"
tspChargeCodeNoCharge code"tspChargeCode": "1/CC"
tspHoursNormalYesCharge 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.7&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": ""
    }
  ]
}