Getting Started
Requests & Responses

Requests & Responses

Inputs and outputs

Request & Response objects are, respectively, the inputs and outputs to any rule in Rulebricks. Specifically, they are any object in JSON notation, as previewed at the end of the last section.

Let’s look at those one more time:

Request Object

{
  "industry": "Financial technology",
  "company_size": 4400,
  "location": {
    "city": "San Francisco",
    "state": "California",
    "country": "United States"
  },
  "date_form_completed": "2022-11-23"
}

Result Object

{
  "score": 90
}

Inputs

To begin configuring any rule in Rulebricks, you require a Request Object. Rulebricks uses the attributes available in the JSON object provided to initialize the columns of an empty decision table. Most applications will document examples of objects their platform outputs from various API endpoints and integrations on their website, but we’re working on direct integrations with tools like Zapier to automatically grab these for you and configure a table.

The fresh decision table initialized in Rulebricks using this request object might look like:

Conditions

Industry industryCompany Size company_sizeLocation City location.cityLocation State location.stateLocation Country location.countryDate Form Completed date_form_completed

Something that isn’t shown here is that the table also figures out what kind of data is in each column, determining whether it contains text, numbers, dates, or lists.

From here, you’re able to hide columns you’d like to ignore, rename columns to make information more meaningful, add ****data transformations to columns, and set default values for information that is missing from future request objects.

Outputs

To receive any information from a rule, you require a Response Object. Just like the request object, Rulebricks will initialize columns to match any attributes you provide in this object. Unlike the request object, the response object doesn’t come from anywhere– you have to create it, and you’re free to add or remove any fields to the response based on what you'd like your rule to actually decide on.

Also like the request object, you’re able to configure each column to return a default value when no rows of conditions matching data are found. You’re also able to return computed data in results– which is an advanced piece of functionality but can enable you to return computed outputs for a particular column based on a matched result in the table, and/or any item in the request data.