VoiceML: <Label>¶
The <Label>
action allows you to set metadata on the current call. This can be useful for persisting data for reporting or diagnosis purposes.
You can access call labels using the Enfonica Console or the Calls API.
The labels against a call can contain a maximum or 50 keys, and a maximum combined length of keys and values of 10 KiB. If you attempt to use the <Label>
action in violation of these constraints, no values will be set and call execution will continue to the next action.
Attributes¶
The <Label>
action supports the following attributes.
Attribute | Allowed Values | Default |
---|---|---|
Key (required) | string | none |
Key¶
The Key
attribute is required and specifies the label's key.
Body¶
The body of an action is the content nested within the action. The following is supported for <Label>
.
Type | Description |
---|---|
plain text | The value to set against the label. An empty value will remove the key from the call's labels. |
Example¶
Example 1: Set a label¶
The following sets the label customer_id
to value 540
.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Label Key="customer_id">540</Label>
</Response>
Example 2: Remove a label¶
The following removes the label customer_id
.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Label Key="customer_id"></Label>
</Response>