Include/Exclude Fields from API Response


The fields parameter is an inclusive filter that accepts a comma-separated string of field names to include on Provider objects. The _excl_fields parameter is an exclusive filter that accepts a comma-separated string of field names to exclude.


Before we try applying either of these parameters, let's try a basic provider search request:

In the API Response, we see there's a lot of valuable detailed data that Ribbon provides in the response. But searching for the entire Provider object can be time intensive - some providers have tens of thousands of rows of data across the locations and insurances.

Instead, if we know which fields we need, we can narrow the response size to make searches blazingly fast! For this example, let's say we only care about the locations a provider practices at. Let's use the fields parameter to narrow down the response:

You can see this reduces the size of the response by more than half!

Exclude Fields

Similarly, if we care about every field except locations, we can exclude from the API Response with the _excl_fields parameter:

If you try this out, you'll see that locations are nowhere to be found in the response! Both of these methods reduce the response time of requests and allow you to build more delightful user experiences using Ribbon's API.