OpenAPI: How do I add fields to the Reporting API Custom viewTemplate?
How do I add fields on Reporting API Custom viewTemplate?
Follow these steps:
- Create a custom viewTemplate.
- Patch the custom viewTemplate by calling this API endpoint:
https://openapi.ariba.com/api/procurement-reporting-view/v2/prod/viewTemplates/<nameofCustomViewTemplate>/patch?realm=<RealmName>
On the body part, specify: (note the real field example mixed in the code)
{
"selectAttributes": [
"Attributes1",
"Attributes2",
"Attributes3",
"cus_Attributes1",
"cus_Attributes2",
"StartDate",
"UniqueId"
],
"filterExpressions": [
{
"name": "FilterName",
"field": "filterExpression1",
"op": ">=",
"defaultValue": "YYYY-MM-DDTHH:MI:SSZ"
},
{
"name": "createdDateTo",
"field": "TimeCreated",
"op": "<=",
"defaultValue": "2019-05-31T00:00:00Z"
},
{
"name": "StatusInList",
"field": "StatusString",
"op": "IN",
"defaultValue": [
"Submitted"
]
}
]
}
- Only the custom viewTemplate can be modified/patched. The OOTB viewTemplate cannot be modified.
- Invoke the Metadata API end point to bring back the available Select Fields and Filter Expressions.
- Notice that on custom view, duplicate fields are not allowed.
Core Procurement > Procurement REST APIs
Purchasing
Spend Visibility
Strategic Contracts > Strategic Contracts - REST API
Strategic Sourcing > Strategic Sourcing - REST API