Configuration
Enabling Transaction Publishing
Transactions are not published by default. To enable publishing, configure the following environment variables for SFApi service:
Statistics__SendStatisticsData=true
Statistics__TransactionCountingSystemUrl=<tcs-url>
Additionally, you must choose one authentication method (see below).
Authentication
When configuring Statistics__Authentication, you have two options:
CRM Authentication
Set the following environment variables:
Statistics__SendStatisticsData=true
Statistics__TransactionCountingSystemUrl=<tcs-url>
Statistics__Authentication__CrmToken=<your-token>
OAuth Client Credentials Authentication
Set the following environment variables:
Statistics__SendStatisticsData=true
Statistics__TransactionCountingSystemUrl=<tcs-url>
Statistics__Authentication__OAuth__TokenEndpoint=<token-endpoint-url>
Statistics__Authentication__OAuth__Audience=<audience>
Statistics__Authentication__OAuth__ClientId=<client-id>
Statistics__Authentication__OAuth__ClientSecret=<client-secret>
Session ID Header
Endpoints that create and send Transactions accept an optional header X-Session-Id.
| Property | Description |
|---|---|
| Format | Must be a valid GUID string |
| Purpose | Used as the SessionId for all transactions created by the endpoint |
| Default | If no value is provided or the value is not a valid GUID, the SessionId will be set to the auto-generated TransactionId |
Example Usage
POST /api/v1/Detect HTTP/1.1
X-Session-Id: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json
{ ... }
This header allows you to group multiple related API calls under a single session for tracking and analytics purposes.
Advanced Configuration
For more fine-grained control, the following configuration options are also available:
| Parameter | Default | Description |
|---|---|---|
Statistics__TransactionsPublishBatchSize | 1000 | Maximum number of transactions to send in a single batch |
Statistics__TransactionsPublishTimeoutMs | 5000 | Timeout for publishing requests (in milliseconds) |
Statistics__TransactionsPublishIntervalMs | 5000 | Interval between publish attempts (in milliseconds) |
Statistics__TransactionsPublishRetryBackoffMs | 3000 | Backoff time before retrying after a failed publish (in milliseconds) |