Hyperon API

There are two ways of connecting to Hyperon with REST API or as a Java library. This page discusses REST API, which can be used fromany tech stack. Hyperon comes with a lightweight yet powerful API that allows you to:

Execution API is a separate component that you could scale up on demand and bring more instances to handle your traffic. Each call is stateless, so it doesn't matter which instance will serve the request.

To calculate the rules, you call "/execution/invoke" method.

Sample call

{
  "ctx": {
     "properties": [
         {             "key":"coverage.code",
           "value":"BI"
         },
{
            "key":"option.code",
            "value":"SILVER"
         }
        ]
  },
  "elements": [
     {
        "code":"demo.motor.coverage.position",
        "type":"PARAMETER"
     },
 {         "code":"demo.motor.coverage.limits",
        "type":"PARAMETER"
     }
    ]

The call consists of two parts: 

"ctx" - The business context of the call. Inthis part, you provide all the data needed to evaluate the rules in a key-valueformat. This format supports "." notation so you can pass the objectstructure that will be rebuilt on the Hyperon side, and you can reference datain the object-like structure. 

"elements" - The evaluation part of thecall. In this part, you point out which rules you would like to evaluate. Youcan enumerate as many of them as you need to be executed at once. 

Response

{
 "result": [
   {
     "element": {
       "code": "demo.motor.coverage.position",
       "type": "PARAMETER",
       "attributeCode": null,
       "profileCode": null
     },
     "resultValue": [
       {
         "fields": [
           {
             "key": "position",
             "value": 1
           }
         ]
       }
     ]
   },
   {
     "element": {
       "code": "demo.motor.coverage.limits",
       "type": "PARAMETER",
       "attributeCode": null,
       "profileCode": null
     },
     "resultValue": [
       {
         "fields": [
           {
             "key": "limit1",
             "value": 50000
           },
           {
             "key": "limit2",
             "value": 100000
           }
         ]
       }
     ]
   }
 ]
}

For each element pointed out in the request, Hyperon will return a separate section. The designer of the rule decides what will be returned. It could be anything from a simple number, string, array, or more complex object type

Security 

Authentication methods available for REST API:

  • basic
  • JWT token

The module can be configured to terminate SSL. Bydefault, it is plain HTTP communication because, in most deployments, there isa Load Balancer that also terminates SSL.