---
title: WorkerDataApiClient
summary: API reference for WorkerDataApiClient.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.Guidewire
reference_type: package
---

# WorkerDataApiClient

Concrete client for the Guidewire ClaimCenter WorkerDataApi. It extends `HttpClientBase`, resolving its base URL from the `cc.workerdata.api.url.v1` configuration key and Basic-auth credentials from `cc.gwcreds`, and implements `IWorkerDataApiClient` by retrieving an injured worker, that worker's claims, and claims matching arbitrary search criteria.

## Purpose
- Retrieves an injured worker record and the claims associated with a worker id, short-circuiting to `null` for a missing/placeholder worker id rather than calling the API.
- Searches for claims matching arbitrary criteria (worker identity, policy, claim number, and related fields) via `FindClaimsSearchCriteria`.

## Context
- Namespace: `SAIF.Data.Guidewire.Clients`
- Assembly/package: `SAIF.Data.Guidewire` (packaged in `SAIF.SAIFCode.Core`)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| UrlKey | `protected override string UrlKey => "cc.workerdata.api.url.v1"` | Environment configuration key used to resolve this client's base URL, per [SDG-BR-001](../../business-rules.md#sdg-br-001-base-url-resolved-from-environment-configuration) |
| AuthKey | `protected override string AuthKey => "cc.gwcreds"` | Environment secure-configuration key used to resolve Basic auth credentials, per [SDG-BR-002](../../business-rules.md#sdg-br-002-basic-credentials-read-from-secure-configuration) |
| WorkerDataApiClient(IEnvironmentService, HttpClient, SystemType, string) | `[Obsolete] public WorkerDataApiClient(IEnvironmentService environmentService, HttpClient client, SystemType systemType, string baseUrlOverride = "")` | Obsolete constructor; forwards to `HttpClientBase`'s obsolete overload, which builds a `DataClientConfiguration` with `UseCache = false` and ignores `baseUrlOverride` |
| WorkerDataApiClient(IEnvironmentService, HttpClient, IDataClientConfiguration, IReadOnlyPolicyRegistry\<string\>) | `public WorkerDataApiClient(IEnvironmentService environmentService, HttpClient client, IDataClientConfiguration configuration, IReadOnlyPolicyRegistry<string> policyRegistry)` | Primary constructor; delegates directly to `HttpClientBase`'s primary constructor |
| GetWorker(string) | `public Task<Claimant> GetWorker(string workerId)` | Returns `null` without calling the API when `workerId` is `null` or `"0"`, per [SDG-BR-015](../../business-rules.md#sdg-br-015-null-or-0-worker-id-short-circuits-lookup); otherwise performs a cached, ensure-success GET of `worker/{workerId}`, throwing per [SDG-BR-011](../../business-rules.md#sdg-br-011-non-success-responses-throw-with-status-and-content) on a non-success response |
| GetClaims(string) | `public Task<ClaimSummaries> GetClaims(string workerId)` | Returns `null` without calling the API when `workerId` is `null` or `"0"`, per [SDG-BR-015](../../business-rules.md#sdg-br-015-null-or-0-worker-id-short-circuits-lookup); otherwise performs a cached, ensure-success GET of `claims/{workerId}`, throwing per [SDG-BR-011](../../business-rules.md#sdg-br-011-non-success-responses-throw-with-status-and-content) on a non-success response |
| FindClaims(FindClaimsSearchCriteria) | `public Task<ClaimSummaries> FindClaims(FindClaimsSearchCriteria criteria)` | Serializes `criteria` and performs a cached POST of `claim/search` with the JSON body, returning matching claim summaries |

## Inherited public members
| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| Client | `protected HttpClient Client { get; }` | Returns the underlying `HttpClient`, initializing Basic auth on first access† | `SAIF.Data.Guidewire` — `HttpClientBase` |
| GetAsync(string, bool, CancellationToken) | `protected Task<string> GetAsync(string url, bool ensureSuccess = false, CancellationToken cancellationToken = default)` | Issues an uncached GET and returns the raw response body† | `SAIF.Data.Guidewire` — `HttpClientBase` |
| GetAsyncCached\<T\>(string, bool, CancellationToken) | `protected Task<T> GetAsyncCached<T>(string url, bool ensureSuccess = false, CancellationToken cancellationToken = default)` | Executes a cached GET through the configured Polly policy and deserializes the body as `T`† | `SAIF.Data.Guidewire` — `HttpClientBase` |
| GetAsyncCached\<T\>(string, string, bool, CancellationToken) | `protected Task<T> GetAsyncCached<T>(string url, string body, bool ensureSuccess = false, CancellationToken cancellationToken = default)` | Executes a cached POST with a JSON body through the configured Polly policy and deserializes the response as `T`† | `SAIF.Data.Guidewire` — `HttpClientBase` |

## Behavioral notes
- Both `GetWorker` and `GetClaims` pass `ensureSuccess: true` to `GetAsyncCached<T>`, meaning a non-success HTTP status causes `HttpClientBase` to call `EnsureSuccessStatusCode()`, raising an `HttpRequestException`, per [SDG-BR-011](../../business-rules.md#sdg-br-011-non-success-responses-throw-with-status-and-content).
- `FindClaims` does not pass `ensureSuccess: true`, so a non-success response from `claim/search` does not throw and may instead yield a deserialization failure or default value depending on the response body.
- The `"0"` worker id value is treated the same as `null`, per [SDG-BR-015](../../business-rules.md#sdg-br-015-null-or-0-worker-id-short-circuits-lookup), presumably representing an unset/placeholder Guidewire worker reference*.
- The obsolete constructor always disables caching for this client and ignores any `baseUrlOverride` value.

## Constraints and usage notes
- Depends on `HttpClientBase` (documented in this same doc set) for base-address resolution, authentication, and the cached GET/POST helpers.
- Depends on `FindClaimsSearchCriteria` (documented in this same doc set) as the search payload contract for `FindClaims`.

> **Note:** Statements marked with `†` are derived from dependency library
> documentation via the Legends CLI. Statements marked with `*` were inferred
> from code structure or contextual evidence.

## Sources
- `Data/SAIF.Data.Guidewire/Clients/WorkerDataApiClient.cs`
- `Data/SAIF.Data.Guidewire/Clients/HttpClientBase.cs`
