ReadByKey
The ReadByKey API is used to read a model by its Natural Key fields. The developer can invoke the read API using:
http://<instanceurl>/oms/api/v1/{ResourceName}/{keyobject}
{ResourceName} is the name that you used to create the model API. Both GET and POST versions are supported.
The developer will need to provide the required key fields in the JSONObject. If an optional filter field value is not provided in the request then that will be checked as "IS NULL" in the query.
Sample URL: /oms/api/v1/ZBKS.Enterprise/%7B%22Name%22%3A%22Progress%20Retailer%7D
The KeyObject above is the encoded value {"Name":"Progressive Retailer"}
Sample JSON response:
{
"TypeName"
:
"Retailer"
,
"Description"
:
"Progressive Retailer Value Chain"
,
"Name"
:
"ProgressiveRetailer"
,
"Active"
:
true
,
"StartDayOfWeek"
:
"SUNDAY"
}
Along with the key filter fields, the developer can optionally provide the level(s) and MDFs to fetch. If no explicit level or MDFs are provided, all levels and MDF fields provided in the definition section will be retrieved.For ModelLink fields, the user will need to provide all the Natural Keys for that model link in an object. Similarly, Platform will provide all NKs for ModelLink fields in the response. SysIds are never accepted or returned.
KeyObject parameters from swagger documentation