Widget requests
The web app builds every request in one place, the file frontend/src/lib/utils/widgetRequest.ts, and the FINOS Workspace API sends it to the backend from the routes under /app/data-connectors. The same builder serves widgets, the option lookups of the parameter bar, forms, the Agent's data and option requests, and the URL of an iframe widget's page. This page lists what a backend receives for the definition of a widget, as widgets.json describes it. Each table below comes from running that code on the cases that it names. Requests that a widget sends explains how the app builds a request.
How values are written
| Parameter | Value | Query | Header | Body | Path |
|---|---|---|---|---|---|
| text | "a b" | a b | a b | "a b" | a%20b |
| tabs | "a" | a | a | "a" | a |
| number | 12.5 | 12.5 | 12.5 | 12.5 | 12.5 |
| number, stored as text | "12.5" | 12.5 | 12.5 | 12.5 | 12.5 |
| boolean | true | true | true | true | true |
| date | "2024-01-31" | 2024-01-31 | 2024-01-31 | "2024-01-31" | 2024-01-31 |
| endpoint, with a text value | "a" | a | a | "a" | a |
| endpoint, with a number value | 7 | 7 | 7 | 7 | 7 |
| multiSelect or multiple, as a list | ["a","b"] | a,b | a,b | ["a","b"] | not possible |
| multiSelect or multiple, as a comma-separated text | "a,b" | a,b | a,b | ["a","b"] | not possible |
Values that are not sent
| Value of a parameter | Sent |
|---|---|
| undefined | no |
| null | no |
| an empty string | no |
| an empty list | no |
| 0 | yes |
| false | yes |
Problems
When the app cannot build a request, the widget shows these messages in place of its content. An iframe widget shows them in place of the page, a form shows them in a toast, and the Agent receives them as the error of its call.
| Problem | What the widget shows |
|---|---|
| A path placeholder has no value | `name` needs a value |
| A path placeholder names no parameter | `{other}` names no param |
| A path placeholder takes several values | `name` fills a path placeholder, which takes one value |
| A body parameter on a GET widget | `name` goes in the body, which needs the method POST |
| A header name that cannot be sent | `Host` cannot be sent as a header |
| A header value that is not printable ASCII | `X-Name` is sent as a header, so its value must be printable ASCII of at most 1,024 characters |
| A number that is not a number | `name` is not a number |
| A boolean that is not true or false | `name` is not true or false |
Rules for definitions
The contract enforces these rules, and the schema states each of them.
- Body params are sent only with "method": "POST"
- A widget kept from the Copilot (disableRetrievalForCopilot) cannot opt in to an MCP tool
- theme: query params the FINOS Workspace adds to this type's requests
- theme and raw: query params the FINOS Workspace adds to this type's requests
- data.rawDataKey and data.rawType describe the rows of raw=true: they need "raw": true
- This type's params go in the query, not the body or header
Header parameters
A header parameter's paramName has 1 to 64 characters from the HTTP token set. Three groups of names are not allowed, and names are compared without regard to case. The first group contains the names that a browser forbids page script to set: accept-charset, accept-encoding, access-control-request-headers, access-control-request-method, connection, content-length, cookie, date, dnt, expect, host, keep-alive, origin, referer, set-cookie, te, trailer, transfer-encoding, upgrade and via and every name that starts with proxy- or sec-. The second group contains the names that FINOS Workspace sets itself: authorization, content-type, accept, x-microsoft-id-token, x-okta-id-token, x-workspace-identity and x-workspace-user. The third group contains every header that the backend connection's credentials use. A header value consists of printable ASCII and has at most 1,024 characters.
Credentials belong to the backend connection and never to parameters, because the dashboard saves a parameter's value and the UI shows it. The contract refuses a parameter whose name matches one of the connection's query credentials.
Example
A POST widget with a path parameter, a query parameter, a header and a body field
Widget definition
{
"endpoint": {
"url": "https://backend.example/teams/{team}/report",
"method": "POST"
},
"params": [
{
"paramName": "team",
"type": "endpoint",
"label": "Team"
},
{
"paramName": "period",
"type": "text",
"label": "Period",
"value": "month"
},
{
"paramName": "X-Region",
"type": "text",
"label": "Region",
"value": "eu",
"in": "header"
},
{
"paramName": "filters",
"type": "text",
"label": "Filters",
"value": "active",
"in": "body"
}
],
"storage": {
"params": {
"team": "platform"
}
}
}Request of the widget
POST https://backend.example/teams/platform/report?period=month&theme=dark
X-Region: eu
Content-Type: application/json
{"filters":"active"}Definition of the endpoint parameter that loads the choices
{
"paramName": "team",
"type": "endpoint",
"optionsEndpoint": "https://backend.example/teams/search",
"optionsMethod": "POST",
"optionsParams": {
"active": true
}
}Request for its choices
POST https://backend.example/teams/search
Content-Type: application/json
{"active":true}