Skip to content

Commit ccf26b7

Browse files
committed
docs(Global transaction Id): Update readme to describe how to get the global transaction id on API c
1 parent 2f6b069 commit ccf26b7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,28 @@ void Example()
216216
## Discovery V2
217217
Discovery v2 is only available on Cloud Pak for Data.
218218

219+
## Transaction IDs
220+
Every call from the SDK will receive a response which will contain a transaction ID, accessible via the x-global-transaction-id header. This transaction ID is useful for troubleshooting and accessing relevant logs from your service instance.
221+
222+
```cs
223+
AssistantService service = new AssistantService("{version-date}");
224+
DetailedResponse<WorkspaceCollection> listWorkspacesResult = null;
225+
226+
try
227+
{
228+
listWorkspacesResult = service.ListWorkspaces();
229+
230+
// Global transaction id on successful api call
231+
listWorkspacesResult.Headers.TryGetValue("x-global-transaction-id", out object globalTransactionId);
232+
}
233+
catch(Exception e)
234+
{
235+
// Global transaction on failed api call is contained in the error message
236+
Console.WriteLine("error: " + e.Message);
237+
}
238+
```
239+
240+
219241
## Documentation
220242
Click [here][dotnet-standard-sdk-documentation] for documentation by release and branch.
221243

0 commit comments

Comments
 (0)