Skip to content

Commit e678236

Browse files
authored
Merge pull request #617 from watson-developer-cloud/docs/transaction-id
docs: add instructions to get transaction id
2 parents 754347a + f558c51 commit e678236

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 returns a response with a transaction ID in 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+
public void ExampleGetTransactionId()
409+
{
410+
AssistantService service = new AssistantService("{version-date}");
411+
service.ListWorkspaces(
412+
callback: (DetailedResponse<Workspace> response, IBMError error) =>
413+
{
414+
if(error != null)
415+
{
416+
Log.Debug("AssistantServiceV1", "Transaction Id: {0}", error.ResponseHeaders["x-global-transaction-id"]);
417+
}
418+
else
419+
{
420+
Log.Debug("AssistantServiceV1", "Transaction Id: {0}", response.Headers["x-global-transaction-id"]);
421+
}
422+
}
423+
);
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)