The use_staging_database API parameter allows users to control whether their queries target unpublished data in the staging database or published data in the receiver database. This functionality is particularly useful for workflows that require reviewing or testing updates before they are officially published.
The use_staging_database parameter determines the data source for your API queries:
use_staging_database: 1: Queries the staging database to retrieve staging data. This is ideal for scenarios where you need to review or test updates before they are finalized.
use_staging_database: 0: Queries the receiver database to retrieve published data. This is the default setting for accessing finalized and publicly available data.
Use Cases for Querying Unpublished vs. Published Data
Staging Data: If your workflow involves reviewing updates or testing changes before they are published, set use_staging_database to 1. This ensures you are working with the most recent, unpublished updates. Example: A developer testing new product data before it goes live.
Receiver Data: For accessing finalized data that is publicly available, set use_staging_database to 0. This is suitable for production environments where only published data is required.
Example API Queries
Here are examples of how to use the use_staging_database parameter in your API requests:
Querying Unpublished Data: GET /api/data?use_staging_database=1 This retrieves data from the staging database.
Querying Published Data: GET /api/data?use_staging_database=0 This retrieves data from the receiver database.
