Skip to content

Commit d1b2d19

Browse files
authored
docs: add instructions to get transaction id
1 parent 754347a commit d1b2d19

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,29 @@ private void OnMessage(DetailedResponse<MessageResponse> response, IBMError erro
401401
}
402402
```
403403

404+
## Transaction IDs
405+
Every SDK call will return 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.
406+
407+
```cs
408+
AssistantService service = new AssistantService("{version-date}");
409+
410+
public IEnumerator ExampleGetTransactionId()
411+
{
412+
WorkspaceCollection listWorkspacesResponse = null;
413+
service.ListWorkspaces(
414+
callback: (DetailedResponse<WorkspaceCollection> response, IBMError error) =>
415+
{
416+
var globalTransactionId = response.Headers["x-global-transaction-id"];
417+
Log.Debug("AssistantServiceV1", "Global transaction id: {0}", globalTransactionId);
418+
listWorkspacesResponse = response.Result;
419+
}
420+
);
421+
422+
while (listWorkspacesResponse == null)
423+
yield return null;
424+
}
425+
```
426+
404427
## TLS 1.0 support
405428
Watson services have upgraded their hosts to TLS 1.2. The Dallas location has a TLS 1.0 endpoint that works for streaming. To stream in other regions, use Unity 2018.2 and set **Scripting Runtime Version** in Build Settings to `.NET 4.x equivalent`. To support Speech to Text in earlier versions of Unity, create the instance in the Dallas location.
406429

0 commit comments

Comments
 (0)