Construct the Policy Audit API client¶
Resolve endpoint, caller identity, and NTLM credentials for the Policy Audit API.
| Field | Value |
|---|---|
| Operation ID | OP-001 |
| Trigger | A caller instantiates ApiCall. |
| Inputs | None. |
| Outputs | Initialized JsonHttpClient stored inside ApiCall. |
| Primary components | ApiCall.ApiCall() |
| Entry point | Business\SAIF.Business.Policy.Audit.ApiCalls\ApiCall.cs |
Steps¶
- Create a
ClientInfoobject and stamp it with application IDPremiumAudit(BR-AAC-001). - Copy
EnvironmentService.MachineNameandEnvironmentService.UserId()intoClientInfoso outbound requests carry machine and user identity (BR-AAC-002). - Read environment setting
policyauditapi.policyauditapiurland use the returned value to construct the baseUrifor the HTTP client (BR-AAC-003). - Read secure setting
gwcommon.gw_lg_pc_pr_serviceby hashingPolicyAuditAPIas aSystemType.WebAppsubject and passing that hash intoGetSecureConfigSetting(BR-AAC-004). - Split the secure-setting value on
|, use the first two elements to constructNtlmAuthenticator, and createJsonHttpClientwith that authenticator (BR-AAC-005).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["new ApiCall()"]) --> Info[Build ClientInfo]
Info --> Config[Read base URL and secure credentials]
Config --> Client[Create NTLM-authenticated JsonHttpClient]
Client --> Done([Client ready])
Failure and edge-case behavior¶
- If the base URL setting is missing or malformed,
new Uri(apiUrl)fails during construction. - If the secure setting does not produce a two-part
username|passwordstring, NTLM authenticator construction cannot complete.
Related documentation¶
Sources¶
Business\SAIF.Business.Policy.Audit.ApiCalls\ApiCall.cs