0

I'm new in Redhat Business Central and exploring. I have created the application and deployed it successfully. I have a problem when I send a POST to the server.

I'm getting an error "Error unmarshalling input". I have attached the screen shoot of my objects and rule

enter image description here

enter image description here

enter image description here

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
mrobi
  • 17
  • 10
  • Seems you are missing the opening curly braces before 'commands' array. – Abhijit Humbe May 07 '20 at 13:20
  • the object looks like this ```{ "commands":[ { "insert":{ "object":{ "com.myspace.demo.Applicant":{ "idType":01 } } } }, { "fire-all-rules":{ } } ] }``` the curl braces is there just that is missing from my screenshoot – mrobi May 07 '20 at 14:16
  • Try adding "X-KIE-ContentType:JSON" in header. Through swagger you cant add additional headers so try executing it through REST clients like postman or through curl command from commandline. – Abhijit Humbe May 07 '20 at 15:02
  • @Abhijit Humbe I took your advice tried it on postman and i'm still getting the same error – mrobi May 07 '20 at 18:27
  • I'm a bit iffy on this unquoted '01' value. Is it supposed to be an octal? Numbers with leading zeroes are traditionally (and in Java) octals. – Roddy of the Frozen Peas May 07 '20 at 21:24
  • @mrobi if possible share exception snip from server log – Abhijit Humbe May 08 '20 at 11:12

1 Answers1

0

Try by Adding "lookup" : null, in the starting of the request. So now th request will look like

{
  "lookup" : null,
  "commands" : [ 

My Request was like this

{
  "lookup" : null,
  "commands" : [ 
    {
    "insert" : 
      {
          "out-identifier":"Name_of_container",
          "return-object":"true",
      "object" :{

          "class_name":
          {
              "obj1":"val1",
              "obj2":"val2",
          }
      }
      }
    },
    {
    "fire-all-rules" : {}
    } ]
}
Dharman
  • 30,962
  • 25
  • 85
  • 135
Vaibhav
  • 1
  • 1