Create Timesheet

Create Timesheet

ParameterTypeDescription
[IN] Parameters described in Overview
CompanyString[IN] The users default company number for the companies list
ActionString[IN] Identifier for the list requested
InputString[IN] data array containing optional parameters
tspending_jobandphaseString[IN] job phase input data array parameter
tspending_resourcecodeString[IN] resource code data array input parameter
tspending_chargecode [OPTIONAL]String[IN] charge code input data array parameter. If not supplied, Synergist API will attempt to use the associated resource default charge code.
tspending_workflowcode [OPTIONAL]String[IN] Stage input data array parameter – this parameter becomes mandatory if the associated jobphase belongs to a 2-tier job – blank string is acceptable for non 2-tier jobs.
tspending_taskdesc [OPTIONAL]String[IN] workflow input data array parameter – this parameter becomes mandatory if the associated jobphase has task descriptions – blank string is acceptable
tspending_timedate [OPTIONAL]String[IN] date of timesheet entry (dd/mm/yyyy) input data array parameter
tspending_hoursnormal [OPTIONAL]String[IN] normal time (hours) input data array parameter
tspending_hoursotime1 [OPTIONAL]String[IN] overtime (hours) input data array parameter
tspending_hoursotime2 [OPTIONAL]String[IN] overtime (hours) input data array parameter
tspending_materialcode [OPTIONAL]String[IN] material code input data array parameter
tspending_matquantity [OPTIONAL]String[IN] material quantity input data array parameter
tspending_workdone [OPTIONAL]String[IN] work done description input data array parameter
variable_timesheetpendingusername [OPTIONAL]String[IN] Username as an alternative to tspending_resourcecode. If a valid username is supplied, the resource code is established using this, meaning that tspending_resourcecode is not required.
ResponseXML/JSON[OUT] An XML tree / JSON string containing the success or error response plus any unique identification fields

Description

Calling the timesheets API with an action of create retrieves a response. If the chargecode is provided as parameter, at least one of the time (hours fields), tspending_hoursnormal, tspending_hoursotime1 or tspending_hoursotime2 must also be provided. If material code is provided as a parameter, the qty (quantity parameter) must also be provided.

Return Values

Response – Success or error response.

The structure of the response is:

<timesheetpendings morepages="False" totalpages="1" totalrows="1">
<timesheetpending tspending_uuid="D0C0EF681CBDCE4CAE08714559C286E9">
<tspending_timestampmodified>1425572436</tspending_timestampmodified>
<tspending_approvalstatus>W</tspending_approvalstatus>
<tspending_chargecode>1/SCAN</tspending_chargecode>
<tspending_entryno>498</tspending_entryno>
<tspending_hoursnormal>9</tspending_hoursnormal>
<tspending_jobandphase>1/00000638.001</tspending_jobandphase>
<tspending_materialcode/>
<tspending_matquantity>0</tspending_matquantity>
<tspending_timedate>2015-01-26</tspending_timedate>
<tspending_workdone>test xml work done test hours submitted</tspending_workdone>
<tspending_workflowcode/>
<variable_approvalstatusname__tspending_approvalstatus>Unsubmitted
</variable_approvalstatusname__tspending_approvalstatus>
<chargecodes_description__tspending_chargecode>
PR work</chargecodes_description__tspending_chargecode>
<variable_timesheetpendingcopy__tspending_entryno>Y</variable_timesheetpendingcopy__tspending_entryno><variable_timesheetpendingdelete__tspending_entryno>Y
</variable_timesheetpendingdelete__tspending_entryno
><variable_timesheetpendingedit__tspending_entryno>Y
</variable_timesheetpendingedit__tspending_entryno>
<variable_timesheetpendingmaterials__tspending_entryno>0
</variable_timesheetpendingmaterials__tspending_entryno>
<variable_timesheetpendingsubmit__tspending_entryno>Y
</variable_timesheetpendingsubmit__tspending_entryno>
<variable_timesheettimerelapsednormal__tspending_entryno>0
</variable_timesheettimerelapsednormal__tspending_entryno>
<variable_timesheettimerstatusnormal__tspending_entryno/>
<variable_phasenumbersimple__tspending_jobandphase>638.001
</variable_phasenumbersimple__tspending_jobandphase>
<variable_clientcode__tspending_jobandphase>1/27yellow</variable_clientcode__tspending_jobandphase>
<variable_clientname__tspending_jobandphase>27 Yellow</variable_clientname__tspending_jobandphase>
<variable_jobdescription1stline__tspending_jobandphase>Create new logo and site for launch</variable_jobdescription1stline__tspending_jobandphase>
<variable_phasedescription1stline__tspending_jobandphase>Create new logo and site for launch</variable_phasedescription1stline__tspending_jobandphase>
<variable_stagecurrentdescription__tspending_jobandphase/>
<resources_resourcename__tspending_materialcode/>
<workflow_workflowdescription__tspending_workflowcode/>
</timesheetpending>
</timesheetpendings>
{
    "responsecode": 1,
    "responsestatus": "OK",
    "errorcode": 0,
    "errormessage": "",
    "totalrows": 1,
    "totalpages": 1,
    "responsemessage": "",
    "pagerows": 0,
    "pagenumber": 1,
    "success": true,
    "data": [
       {
            "tspending_uuid": "5F8E69F3B31F0D49AA97993B5B1C8F84",
            "tspending_timestampmodified": 1425572162,
            "tspending_approvalstatus": "W",
            "tspending_chargecode": "1/ART",
            "tspending_entryno": 497,
            "tspending_hoursnormal": 1.1,
            "tspending_jobandphase": "1/00000638.001",
            "tspending_materialcode": "",
            "tspending_matquantity": 0,
            "tspending_timedate": "2015-01-26",
            "tspending_workdone": "",
            "tspending_workflowcode": "",
            "variable_approvalstatusname__tspending_approvalstatus": "Unsubmitted",
            "chargecodes_description__tspending_chargecode": "Artwork",
            "variable_timesheetpendingcopy__tspending_entryno": "Y",
            "variable_timesheetpendingdelete__tspending_entryno": "Y",
            "variable_timesheetpendingedit__tspending_entryno": "Y",
            "variable_timesheetpendingmaterials__tspending_entryno": 0,
            "variable_timesheetpendingsubmit__tspending_entryno": "Y",
            "variable_timesheettimerelapsednormal__tspending_entryno": 0,
            "variable_timesheettimerstatusnormal__tspending_entryno": "",
            "variable_phasenumbersimple__tspending_jobandphase": "638.001",
            "variable_clientcode__tspending_jobandphase": "1/27yellow",
            "variable_clientname__tspending_jobandphase": "27 Yellow",
            "variable_jobdescription1stline__tspending_jobandphase": "Create new logo and site for launch",
            "variable_phasedescription1stline__tspending_jobandphase": "Create new logo and site for launch",
            "variable_stagecurrentdescription__tspending_jobandphase": "",
            "resources_resourcename__tspending_materialcode": "",
            "workflow_workflowdescription__tspending_workflowcode": ""
        }
    ]
}