Configuring Objects in Birst from REST Data Sources
After creating a connection, you can create the different sources through the API.
- Navigate to Modeler Connect.
- Select the REST connector from the Connector section or click the existing REST connection from the Connections panel.
-
From the connection, click +Create New
Object.
-
Complete these fields:
- Object Name
- The name of the object.
- Resource
- This indicates the Resource portion of the URL syntax. HTTP | HTTPS://<Endpoint>/<Resource>?<Query>
- Query Parameters
- his indicates the Query portion of the URL syntax. HTTP | HTTPS://<Endpoint>/<Resource>?<Query>
- Pagination
- Select the Pagination type and specify any additional information.
-
For additional advanced settings, click More
Options.
- Header
- You can create REST call headers at the object level. If more than one header is necessary, use the following syntax: <header name1>=<header value1>&<header name2>=<header value2>
- Request Type
- Birst supports three Request Types for APIs. Select your Request Type and specify any additional
information.
- GET requires no additional information.
- POST - raw requires the POST body.
- POST - x-www-form-urlencoded requires the Key/Value pairs.
- Dynamic Parameters
- Dynamic Parameters are useful in cases when you need to call an
endpoint multiple times in order to gather all possible values for a given
API resource. For example, the API may only provide a resource that lists
all products belonging to a specific category. In order to create a source
in Birst that contains the list of products across all categories sold, you
must call that resource for each per product category. Birst allows you to
use a column from another source of the same REST connector to iterate
through all possible values of that column and populate the current source
with the result of each separate resource call. If the syntax for the API is
categories(category number)/products, in order for us to iterate through all
categories, the API call with the correct category number must be
supplied.Note: Repository variables can be used similarly to dynamic parameters.
- From More Options, click Configure Dynamic Parameters.
- Specify the Parameter
Name. This name is used in the URL. In this example, we
will use it in the Resource
field.
- Specify the Object Name.
Pick from the list of sources in the REST connector.
- Specify the Column Name. Pick a column from the list of available in columns in your selected source.
- Specify the Test Value. This is only used for preview. The test value has no impact when importing sources.
- Click + Add Dynamic Parameters to create any additional parameters.
- Click Done.
- Update your settings with the parameter or parameters. In this
example, we updated the Resource field to use the Category ID. When using parameters
in Birst, use the following syntax M[NameofParameter].Our example API
syntax is categories(#)/products; the resource should be
Categories(M[parameter_name])/products.
- Click Save.
Related topics
- REST Object Pagination
- Manage Variables