0
votes

Hi im trying to do a PUT request for a Employee Time Activity but im not having much luck. I keep getting errors like project task cannot be found in the system. But the project task does exist and when I enter the same details directly in the form it works fine.

Does anybody have a example JSON body of creating a new employee activity record that can help me?

Below is my current body

{
"Employee": {
    "value": "MATTMCD"
},
"Items": [
    {
        "ActivityDate": {
            "value": "2020-03-02T00:00:00"
        },
        "ActivityTime": {
            "value": "2020-03-01T22:00:00"
        },
        "CostCode": {
            "value": "0000"
        },
        "Billable": {
            "value": true
        },
        "LabourItem": {
            "value": "LABOUR-MAT"
        },
        "Project": {
            "value": "PR00000001"
        },
        "ProjectTask": {
            "value": "TESTTASK"
        },
        "Description": {
            "value": "Labour Matt"
        },
        "TimeSpent": {
            "value": "01:30"
        }
    }
]

}

1
did you sample a Get of a Time Activity first ? This usually gives me an indication how to form my json for Put. As usually they're "almost" the same. - Rick

1 Answers

0
votes

I ended up just using the activity screen to enter time activities. This gave me some flexibility with the dates as well which I needed instead of having to enter a time entry for the current week.