Inject content into the payloads
Your client application can inject the following content into the payloads:
Client data
You can inject a map of key-value pairs from the XaaS APIs, through the client_data
field, as follows:
Service | API message |
---|---|
ASRaaS | RecognitionInitMessage |
NLUaaS | InterpretRequest |
DLGaaS | StartRequest |
TTSaaS | SynthesisRequest |
NTTSaaS | SynthesisRequest |
NRaaS | RecognitionInit |
This data is stored in the clientData
field of the request.
If the client_data
field is provided in the XaaS request, it will be included in all the event logs related to this request.
User ID
You can inject a user ID from the XaaS APIs, through the user_id
field, as follows:
Service | API Message |
---|---|
ASRaaS | RecognitionInitMessage |
NLUaaS | InterpretRequest |
DLGaaS | StartRequest, ExecuteRequest, and StopRequest |
TTSaaS | SynthesisRequest |
NTTSaaS | SynthesisRequest |
NRaaS | RecognitionInit |
The user ID will be included in the userid
field under data. To generate the userid
value, the appid
and user_id
fields are concatenated and separated by a colon, as follows: appid:user_id
. This value is then hashed using SHA256 and provided as a 64-character hexadecimal string.
If the user_id
field is provided in the XaaS request, it will be included in all the event logs related to this request.
Client-provided request ID
You can inject your own request ID in the event logs by setting the x-client-request-id
header in the gRPC metadata for a request in the client application. This field can be used for tracing purposes.
The header value will get logged in the clientRequestid
field of the data field structure for all the event logs generated for that request.
For example, the sample code shows how the x-client-request-id
header is specified in the metadata for the Execute request in the client application. This header value then gets included in the clientRequestid
field of all the event logs related to this Execute request.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.