From 510f08223c1f8becfa2b53ee39bd7a1111647b27 Mon Sep 17 00:00:00 2001 From: Gregory Klein Date: Thu, 27 Aug 2026 11:49:23 -0400 Subject: [PATCH 1/2] Add optional fulcra_userid argument to FulcraAPI.data_updates() --- fulcra_api/core.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fulcra_api/core.py b/fulcra_api/core.py index e58c279..bc34a22 100644 --- a/fulcra_api/core.py +++ b/fulcra_api/core.py @@ -488,10 +488,7 @@ def get_id_token_claims(self) -> dict: Returns: A dict containing all JWT claims from the ID token. """ - if ( - self.fulcra_credentials is None - or self.fulcra_credentials.id_token is None - ): + if self.fulcra_credentials is None or self.fulcra_credentials.id_token is None: raise Exception( "Authorization must occur before retrieving ID token claims." ) @@ -1401,6 +1398,7 @@ def data_updates( self, start_time: str | datetime.datetime, end_time: str | datetime.datetime, + fulcra_userid: str | None, ) -> dict: """ Retrieve a summary of the data that was updated during the specified @@ -1413,6 +1411,7 @@ def data_updates( Params: start_time: The start of the time range (inclusive), as an ISO 8601 string or `datetime` object. end_time: The end of the range (exclusive), as an ISO 8601 string or `datetime` object. + fulcra_userid: Optional Fulcra user ID to get updates for Returns: A dict with two keys: @@ -1434,6 +1433,10 @@ def data_updates( "start_time": start_time, "end_time": end_time, } + + if fulcra_userid is not None: + params["fulcra_userid"] = fulcra_userid + resp = self.fulcra_api("/data/v1/updates", query=params) return json.loads(resp) From dce6764344cc95c910d78557de87ce70e8d394f5 Mon Sep 17 00:00:00 2001 From: Gregory Klein Date: Thu, 27 Aug 2026 11:49:57 -0400 Subject: [PATCH 2/2] Add --user-id option to data-updates command --- fulcra_api/cli/commands.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/fulcra_api/cli/commands.py b/fulcra_api/cli/commands.py index 436ec16..9b99453 100644 --- a/fulcra_api/cli/commands.py +++ b/fulcra_api/cli/commands.py @@ -807,10 +807,19 @@ def user_info(fulcra_api: FulcraAPI): @click.command( "data-updates", short_help="Return data/file updates that occurred during a period" ) +@click.option( + "--user-id", + type=str, + default=None, + is_eager=True, + help="Fulcra user ID to query data updates for (requires an active datashare from that user).", +) @time_range @pass_fulcra_api @requires_auth -def data_updates(fulcra_api: FulcraAPI, start_time: datetime, end_time: datetime): +def data_updates( + fulcra_api: FulcraAPI, start_time: datetime, end_time: datetime, user_id: str | None +): """Return a summary of the data that was updated across TIME_RANGE. TIME_RANGE: Two start & end date arguments in ISO8601 format or a single interval argument relative to the current time ("1 week", "2 days", "3h", etc.) @@ -819,7 +828,9 @@ def data_updates(fulcra_api: FulcraAPI, start_time: datetime, end_time: datetime the number of records processed for each) and any uploaded files that changed. """ try: - resp = fulcra_api.data_updates(start_time, end_time) + resp = fulcra_api.data_updates( + start_time=start_time, end_time=end_time, fulcra_userid=user_id + ) except HTTPError as exc: raise click.ClickException(exc) from exc