SerializationError when sending json

This thread is now closed to new comments.
Some of the links provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
Highlighted
Partner Karthik
3 Posts
Partner
Karthik
Partner

3Posts

0Kudos

0Solutions

SerializationError when sending json

I am trying to send some timesheet data to our sandbox company file but we are getting Serialization error. We are are using VB.net and RestSharp to PUT the JSON to MyOb RightAccount Live. Below are the details. What am I doing wrong.  Attached it the screenshot with the headers.

URL - https://ar2.api.myob.com/accountright/820d07c0-9799-4adb-b632-b6e43578fcae/Payroll/Timesheet/60fb36d...

JSON

{"Employee":{"UID":"60fb36dd-f750-4fed-8d29-82e8fe17f0c4"},"StartDate":"2017-06-04T00:00:00Z","EndDate":"2017-06-10T00:00:00Z","Lines":[{"PayrollCategory":{"UID":"40715d86-f023-41ab-9922-f44fff7ed2fa"},"Entries":[{"Date":"2017-06-05T00:00:00Z","Hours":8.00},{"Date":"2017-06-06T00:00:00Z","Hours":8.00},{"Date":"2017-06-07T00:00:00Z","Hours":8.00},{"Date":"2017-06-08T00:00:00Z","Hours":8.00}]}]}

Error Received from MYOB

"{" & vbCrLf & " "Errors": [" & vbCrLf & " {" & vbCrLf & " "Name": "SerializationError"," & vbCrLf & " "Message": null," & vbCrLf & " "AdditionalDetails": "Error converting value \"{\"Employee\":{\"UID\":\"60fb36dd-f750-4fed-8d29-82e8fe17f0c4\"},\"StartDate\":\"2017-06-04T00:00:00Z\",\"EndDate\":\"2017-06-10T00:00:00Z\",\"Lines\":[{\"PayrollCategory\":{\"UID\":\"40715d86-f023-41ab-9922-f44fff7ed2fa\"},\"Entries\":[{\"Date\":\"2017-06-05T00:00:00Z\",\"Hours\":8.00},{\"Date\":\"2017-06-06T00:00:00Z\",\"Hours\":8.00},{\"Date\":\"2017-06-07T00:00:00Z\",\"Hours\":8.00},{\"Date\":\"2017-06-08T00:00:00Z\",\"Hours\":8.00}]}]}\" to type 'MYOB.AccountRight.API.Version2.Contracts.Timesheet'. Path '', line 1, position 446."," & vbCrLf & " "ErrorCode": 50," & vbCrLf & " "Severity": "Error"" & vbCrLf & " }" & vbCrLf & " ]," & vbCrLf & " "Information": "Warning, error messages have not been finalised in this release and may change"" & vbCrLf & "}"

Capture.jpg
Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post