How to map variables in POST payload to the BOD doc.?

Wayne Liu
Wayne Liu Member, Staff Posts: 1

Hi,

I am configuring an API using POST method in ION API Connection Point.

In request body, how do I map the data in payload to the BOD doc.?

FOr example, the payload is like following.

{  "systemCriteria": [    {      "type": "EntityTypeId",      "value": "Item",      "operator": "Equal"    }  ],  "dataCriteria": [    {      "fieldTypeId": "ItemNumber",      "value": "A-10105",
      "operator": "Equal"    }  ],  "dataCriteriaOperator": "string"}

I don't want to hardcode the "A-10105" in the payload, I want to take it from the BOD doc.

How to do it?

Is there any training course / documentation on this?

Thanks

Wayne

Best Answer

  • Brandon Watson
    Brandon Watson Member, Infor Partner Posts: 25
    Answer ✓

    Hello Wayne - Below is the direct URL to the documentation that details how to use IonApiRef and XPath to pull in values from the BOD. You will have a JSON Target with XML Source, it sounds like. Below is the documentation from that example. You will add the IonApiRef section and then an XPath to the value you need. There are many online XPath Validators that can help you identify the exact path needed.

    JSON target with XML source - XPath"customer":
    { "name": {"IonApiRef": "SalesOrder/SalesOrderHeader/CustomerParty/Name"}, "city": {"IonApiRef": "SalesOrder/SalesOrderHeader/CustomerParty/Location[@type=”Office”]/Address/CityName"}}

    https://docs.infor.com/inforos/2024.x/en-us/useradminlib_cloud/default.html?helpcontent=iontechconceag_cloud_osm/uef1520244362154.html

Answers