Solved

Call REST API from Postman to change object state


Userlevel 1
Badge +3
  • Do Gooder (Employee)
  • 12 replies

Hi Everybody,

Anyone can help me with a problem, I was releasing a Purchase Order using Rest API with postman.

The operation is:

https://cmbgse2062.corpnet.ifsworld.com:48080/int/ifsapplications/projection/v1/PurchaseOrderHandling.svc/PurchaseOrderSet(OrderNo='100006')/IfsApp.PurchaseOrderHandling.PurchaseOrder.Release

 

Any time calling this operation I got the error below:

{

    "error": {

        "code": "ODP_DESERIALIZATION_ERROR",

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

    }

}

I'm missing something?

Could you test this in your environment if it works?

 

Thanks in advance,

Alexandre Bicalho.

 

icon

Best answer by Rifki Razick 7 May 2021, 11:56

Hi,

I’m assuming you are doing a POST call which is required since this is an action. Now a possible reason for the deserialization error could be the lack of a payload in your request body. For state changes you need to specify an empty payload like so:

{}

 

View original

3 replies

Userlevel 2
Badge +3

Hi,

I’m assuming you are doing a POST call which is required since this is an action. Now a possible reason for the deserialization error could be the lack of a payload in your request body. For state changes you need to specify an empty payload like so:

{}

 

Userlevel 1
Badge +3

Hi @Rifki Razick,

I specify the payload in the Body?

When I did it, I receive the message below:
 

{
    "error": {
        "code": "ODP_MISSING_PRECONDITION",
        "message": "A precondition is missing in the request."
    }
}

 

 

Userlevel 1
Badge +3

Hi @Rifki Razick,

I found the problem,.

I put in the body {} as you suggested and the parameter in header below:

Now, works OK.

 

Many thanks for you sugestion.

 

BR/

Reply