Skip to main content

Hi Team,

 

I'm trying to post work task from POSTMAN using https://XXXXXXXX/int/ifsapplications/projection/v1/WorkTaskServices.svc/ReceiveWorkTask

 

Following is the body 

 

{

"ReceiveWorkTask": {

"TaskSeq": null,

"OrderNo": null,

"WoNo": "201074",

"Site": "1",

"Company": "10",

"OrganizationSite": "1",

"OrganizationId": "1300",

"PriorityId": "1",

"WorkTypeId": "1",

"Description": "It is a Text",

"CreatedDate": "2023-10-01T01:01:01Z",

"PreparedBy": "ifsapp",

"ReportedBy": "ifsapp",

"ReportedDate": "2023-10-01T01:01:01Z",

"PlannedStart": "2023-10-01T01:01:01Z",

"PlannedFinish": "2023-10-01T01:01:01Z",

"ExcludeFromScheduling": true,

"CustomerNo": "1010",

"CurrencyCode": "USD",

"PreAccountingId": "1",

"NoteId": "1",

"ChangedDate": "2023-10-01T01:01:01Z"

}

}

 

I get the below error,

 

{

    "error": {

        "code": "ODP_DESERIALIZATION_ERROR",

        "message": "Error while de-serializing contents."

    }

 

Please let me know what am i missing here?

 

Best Regards,

Hi @Dharshankumaar Mahendran 

 

We are using IFS10. I can’t reach the WorkTaskServices handling. 

 

Maybe WorkTaskHandling can help you. 

 

If you provide the JSON content inside the URL which is below. I can check your handling.

https://url:port/int/ifsapplications/projection/v1/WorkTaskServices.svc/$openapi?V3


@Dharshankumaar Mahendran 

Some points you can check.

  • Can you post your header information?
  • Did you correctly use the If-Match header to indicate which id you wanted to update
    • generally you HAVE to do a GET first, copy the If-Match and use it to PATCH the record
    • Make sure its correctly encoded
  • Sometimes you have to add two extra header lines so it can convert everything correctly 
  • If you have issues @dsj has written a nice tool how you can add debug messages to your request. (by adding the ?odata-debug-json query parameter) 

Example request with header (This is a PATCH example)

You will notice a couple of things:

  • Correctly use the If-Match (Make sure its correctly encoded!!! (eg. no \ signs)
  • add the extra headers
    • Accept: application/json;odata.metadata=full;IEEE754Compatible=true
      Content-Type: application/json;IEEE754Compatible=true
  • Add the query parameter to debug the request - ?odata-debug-json

 

PATCH /main/ifsapplications/projection/v1/ScheduleOfWorkProductionRecordHandling.svc/ScheduleOfWorkSet(ProjectId='1051',SchOfWorkType='FOR',SchOfWorkNo=1,VersionId='1')/SchOfWorkItemArray(ProjectId='1051',SchOfWorkType='FOR',SchOfWorkNo=1,VersionId='1',ItemNo=1)?odata-debug=json HTTP/1.1
Host:-cfg.ifs.cloud
If-Match: W/"Vy8iQUFBWFpnQUJlQUFEbW9FQUFMOjIwMjMwOTI5MTcyNDU3Ig=="
Accept: application/json;odata.metadata=full;IEEE754Compatible=true
Content-Type: application/json;IEEE754Compatible=true
Content-Length: 196

{
"WorkRecordSelection": "CumulativeQuantity",
"CurrentQuantity": "-0.3",
"RecordDate": "2023-09-29",
"RecordPerson": "test",
"CompleteRecording": false,
"Note": "test"
}
 

Reply