Remove the support to GET operations on Query API call

Oracle Health Insurance plans to remove the support for GET operations on Query API calls.

This change applies to all Oracle Health Insurance components.
Date of deprecation: 2023-01-05

What is Deprecated?

The ability to call the Query API GET operation is deprecated.

This is replaced by the ability to call the Query API POST operation.

This deprecation affects the Collection Resource API, meaning that a GET call on http://[hostName]:[portNumber]/[api-context-root]/generic/{resource name} is also deprecated.

Release 4.23.1

In release 4.23.1 the GET operation on Query API calls is only available when the system property ohi.service.queryapi.get.support has value true. This property has value false on installation. When property ohi.service.queryapi.get.support has value false, a GET operation on Query API calls returns HTTP code 405.

Suggestion actions

Replace the use of the GET operation on the Query API calls with a POST operation and send the parameters (e.g. q, order by) as part of the request’s body. Below there are some examples of searches comparing the use of GET and POST.

Table 1. Retrieving a collection resource
With GET With POST

HTTP Method

GET

POST

URI

http://[hostName]:[portNumber]/[api-context-root]/generic/persons

http://[hostName]:[portNumber]/[api-context-root]/generic/persons/search

JSON Body

N/A

{
    "resource": {
    }
}
Table 2. Searching for a person using two filters
With GET With POST

HTTP Method

GET

POST

URI

http://[hostName]:[portNumber]/[api-context-root]/generic/persons?q=dateOfBirth.eq('1900-01-01').and.name.eq('Doe')

http://[hostName]:[portNumber]/[api-context-root]/generic/persons/search

JSON Body

N/A

{
    "resource": {
        "q": "dateOfBirth.eq('1900-01-01').and.name.eq('Doe')"
    }
}
Table 3. Searching for a person using two filters, specifying an order by criteria, limit and offset for pagination purposes
With GET With POST

HTTP Method

GET

POST

URI

http://[hostName]:[portNumber]/[api-context-root]/generic/persons?q=dateOfBirth.eq('1900-01-01').and.name.eq('Doe')&orderBy=code:desc&limit=10&offset=0

http://[hostName]:[portNumber]/[api-context-root]/generic/persons/search

JSON Body

N/A

{
    "resource": {
        "q": "dateOfBirth.eq('1900-01-01').and.name.eq('Doe')",
        "orderBy": "code:desc",
        "limit": 10,
        "offset": 0
    }
}
Table 4. Searching via Dynamic Logic
With GET With POST
String response = initCallOut(WebTarget.class)
        .path("generic/messages")
        .queryParam("q","code.eq('OHI-DYLO-001')")
        .request("application/json")
        .buildGet()
        .invoke()
        .readEntity(String.class)
String response = initCallOut(WebTarget.class)
        .path("generic/messages/search")
        .request()
        .buildPost(Entity.json(jsonPayload))
        .invoke()
        .readEntity(String.class)

Where jsonPayload is a String representing:

{
    "resource": {
        "q": "code.eq('OHI-DYLO-001')"
    }
}

The page links associated to the query response also have a structure change in a future release: the "searchResource" element will be renamed to "body". See an example below:

Table 5. Change in the Response
Currently In a future release
{
"searchResource": {
    "resource": {
        "offset": "50",
        "name": "activities"
    }
  }
}
{
"body": {
    "resource": {
        "offset": "50",
        "name": "activities"
    }
  }
}