Create Timesheet

Create Timesheet

  <th>
    Type
  </th>

  <th>
    Description
  </th>
</tr>
  <td>

  </td>

  <td>
    [IN]

     Parameters described in Overview
  </td>
</tr>

<tr>
  <td>
    Company
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     The users default company number for the companies list
  </td>
</tr>

<tr>
  <td>
    Action
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     Identifier for the list requested
  </td>
</tr>

<tr>
  <td>
    Input
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     data array containing optional parameters
  </td>
</tr>

<tr>
  <td>
    tspending\_jobandphase
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     job phase input data array parameter
  </td>
</tr>

<tr>
  <td>
    tspending\_resourcecode
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     resource code data array input parameter
  </td>
</tr>

<tr>
  <td>
    tspending_chargecode 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     charge code input data array parameter.  If not supplied, Synergist API will attempt to use the associated resource default charge code.
  </td>
</tr>

<tr>
  <td>
    tspending_workflowcode 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [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.
  </td>
</tr>

<tr>
  <td>
    tspending_taskdesc 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     workflow input data array parameter – this parameter becomes mandatory if the associated jobphase has task descriptions – blank string is acceptable
  </td>
</tr>

<tr>
  <td>
    tspending_timedate 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     date of timesheet entry (dd/mm/yyyy) input data array parameter
  </td>
</tr>

<tr>
  <td>
    tspending_hoursnormal 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     normal time (hours) input data array parameter
  </td>
</tr>

<tr>
  <td>
    tspending_hoursotime1 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     overtime (hours) input data array parameter
  </td>
</tr>

<tr>
  <td>
    tspending_hoursotime2 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     overtime (hours) input data array parameter
  </td>
</tr>

<tr>
  <td>
    tspending_materialcode 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     material code input data array parameter
  </td>
</tr>

<tr>
  <td>
    tspending_matquantity 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     material quantity input data array parameter
  </td>
</tr>

<tr>
  <td>
    tspending_workdone 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [IN]

     work done description input data array parameter
  </td>
</tr>

<tr>
  <td>
    variable_timesheetpendingusername 

    [OPTIONAL]
  </td>

  <td>
    String
  </td>

  <td>
    [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.
  </td>
</tr>

<tr>
  <td>
    Response
  </td>

  <td>
    XML/JSON
  </td>

  <td>
    [OUT]

      An XML tree / JSON string containing the success or error response plus any unique identification fields
  </td>
</tr>
Parameter

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": ""
        }
    ]
}