Skip to content

IFS OData Provider

Introduction

Services in the OData Provider can be built via different means.

OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. OData APIs are easy to consume. OData metadata, a machine-readable description of the data model of the APIs, enables the creation of powerful generic client proxies and tools.

URL Structure Illustrated

For more information, see Odata Documentation.

IFS OData Provider exposes IFS business entities and business logic through OData endpoints. It is based on Apache OLingo, a java library that implements the OData protocol and is used for the functions below:

  • Parsing of requests into syntax trees
  • Metadata validation
  • Parsing of HTTP request content
  • Generation of JSON results

IFS OData Provider with the help of Apache Olingo translate between the OData protocol and the underlying IFS Business Logic.

FndODataProvider

OData Response

After processing a request, the OData Provider responds using any valid HTTP response code along with the relevant OData Response Body.

OData Response Codes

The HTTP response codes align with the standard HTTP response classes. For example, an error occurring due to incorrect request from the client will fall into the HTTP 4XX series, while errors which occur due to server-side errors will fall into the HTTP 5XX series. Successful requests fall into the category of HTTP 2XX.

For a list of response codes, see Responses and Status Codes.

Note - A debug response (odata-debug=json) will always return HTTP 200 even though the underlying request has failed. The correct response code can be seen in the response body - Certain database side validation failures will still result in an HTTP 500 error.

OData Response Body

The OData Response body data is dependent on the resource which has been requested and the operation performed.

For Error Responses, the structure of the message is as follows.

{
    "error": {
        "code": "MAIN ERROR CODE",
        "message": "MAIN ERROR MESSAGE",
        "details": [
            {
                "code": "DETAIL ERROR CODE",
                "message": "DETAIL ERROR MESSAGE"
            }
        ]
    }
}

For some server side errors like database errors, the details section will have additional information on the errors like the Oracle error which occured.

For errors due to issue in the request, the Main Error Code will say REQUEST_ERROR.

Changes to Error Response Codes and Response Body

Prior to IFS Cloud 23R1 GA, errors due to client request had the HTTP 500 error code. But with 23R1 GA, the behavior was aligned to return HTTP 4XX errors. To revert to the previous error codes, the HTTP header IFS-Legacy-Response-Codes can be set to true. However, it is highly recommended to update your clients to the new error codes.

Projections

Projections are the main mechanism of developing OData services for IFS Cloud. What is defined as a "Projection" in IFS Developer studio gets deployed as an OData service facilitated by IFS OData Provider. Projection is the place where IFS Business entities are modelled in OData context.

Projection in Database

Projections are exposed in the /ifsapplications/projection/ endpoint. Depending on the type of the projection, it can be exposed in the main, int, b2b or a combination of endpoints.