When generating a qualityRTC invite, you can have query parameters included such as region or account. You can also use these invites to add any additional fields you might need.
This is something you can configure using the Options JSON field of the invite:
JSON format
{
"fields": [
// array of optional fields
],
"queryParams": {
// query params tuples
}
}
You can place in the options either the fields or the queryParams or both as needed.
Adding optional fields
You can add custom optional fields to the network test which the user will need to fill in. This is useful if you’d like to collect additional information about the user, such as the location of the test (home or office), network type, etc.
The fields will be placed in the log and in the webhook.
"fields": [
{
"name": "<field name>",
"label": "<field label>",
"variant": "<text|select>",
"required": <true|false>
},
.
.
.
]
fields is an array where each element is structured with the following information:
- name – the name of the field. This is how you will see the field in the log and on the webhook
- label – the label to show on the field for the user
- variant – type of field. Currently, text and select are supported
- required – is this field mandatory to fill out or not
Per the variant of the field you may or may not need to add additional values to it.
Text field
Text fields are simple text entries that the user can fill out.
There are no additional configuration for such fields necessary.
Selection field
"fields": [
{
"name": "<field name>",
"label": "<field label>",
"variant": "select",
"required": <true|false>,
"options": [
{
"label": "<instruction>",
"value": "none"
},
{
"label": "<label to show>",
"value": "<value if selected>"
},
.
.
.
]
},
.
.
.
]
The options now include an array of selection alternatives.
Each selection has a label and a value. The label is displayed to the user while the value is what will be placed in the log and the webhook if this option is selected.
You can add a first selection with a value of “none” which will place the label as an instruction to the user.
{
"fields": [
{
"name": "work",
"label": "Work",
"variant": "select",
"required": true,
"options": [
{
"label": "Select work place...",
"value": "none"
},
{
"label": "Working from home",
"value": "Working from home"
},
{
"label": "Working remotely",
"value": "Working remotely"
}
]
}
]
}
Adding query parameters
"queryParams": {
"<key1>": "<value1>",
"<key2>": "<value2>"
.
.
.
}
Each key represents a query parameter and value its value.
"queryParams": {
"account": "acme"
}