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

# ActivityDataApiClient

Concrete client for the Guidewire ClaimCenter ActivityDataApi. It extends `HttpClientBase`, resolving its base URL from the `cc.activitydata.api.url.v1` configuration key and Basic-auth credentials from `cc.gwcreds`, and implements `IActivityDataApiClient` by posting a serialized `Activity` payload to create a claim activity synchronously.

## Purpose
- Creates activities against a claim in Guidewire ClaimCenter via a synchronous, blocking POST call.
- Serializes the `Activity` payload while omitting null properties, and translates any failure (transport exception or non-success status) into a thrown `Exception` describing the failure.

## 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.activitydata.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) |
| ActivityDataApiClient(IEnvironmentService, HttpClient, SystemType, string) | `[Obsolete] public ActivityDataApiClient(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` |
| ActivityDataApiClient(IEnvironmentService, HttpClient, IDataClientConfiguration, IReadOnlyPolicyRegistry\<string\>) | `public ActivityDataApiClient(IEnvironmentService environmentService, HttpClient client, IDataClientConfiguration configuration, IReadOnlyPolicyRegistry<string> policyRegistry)` | Primary constructor; delegates directly to `HttpClientBase`'s primary constructor |
| CreateActivityRequest(long, Activity) | `public void CreateActivityRequest(long claimId, Activity activity)` | Serializes `activity` with null values omitted per [SDG-BR-010](../../business-rules.md#sdg-br-010-null-activity-properties-omitted-from-serialized-request), then synchronously POSTs to `activity/claim/{claimId}`; throws per [SDG-BR-011](../../business-rules.md#sdg-br-011-non-success-responses-throw-with-status-and-content) on transport errors or non-success responses |

## 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
- `CreateActivityRequest` blocks the calling thread via `GetAwaiter().GetResult()` rather than awaiting asynchronously.
- The obsolete constructor always disables caching for this client (`UseCache = false`, per `HttpClientBase`'s obsolete overload) and ignores any `baseUrlOverride` value.
- On a caught transport exception, the method wraps it in a new `Exception` with message `"Unknown exception when calling ActivityDataApi. Message: {e.Message}"`, preserving the original as `InnerException`.
- On a non-success HTTP response, the method reads the response content synchronously and throws an `Exception` including the numeric status code and content (or a "No content returned" message if content is null).

## Constraints and usage notes
- `CreateActivityRequest` is synchronous and has no cancellation support; callers on async code paths should be aware it blocks.
- Depends on `HttpClientBase` (documented in this same doc set) for base-address resolution and authentication.

> **Note:** Statements marked with † are derived from dependency library
> documentation via the Legends CLI. They describe inherited behavior from the
> indicated origin library and should be verified if the dependency version changes.

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