Get Example
get_exampleRetrieve a runnable request example for a UniFi endpoint in a specified language and mode, including placeholders for host, site ID, and API key.
Instructions
Get a runnable request for one endpoint, in one language, as published by Ubiquiti.
Returns a heading naming the endpoint, language and mode, followed by a single code block. The request shape is authoritative; host addresses, site ids and API keys are placeholders to fill in. Bodies show the schema's default values, not a worked example — combine with get_endpoint or get_field_schema when the payload matters. If the requested language and mode pair does not exist, the reply lists the pairs that do instead of failing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"slug": "<slug>"
},
"name": "get_example"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'local' addresses the console directly (https://<console-ip>/proxy/…); 'remote' goes through the UniFi cloud API (api.ui.com). Defaults to 'local', except for the cloud-only applications — site-manager, mobility and carrier-fabric — which have no local form and default to 'remote'. | |
| slug | Yes | Endpoint identifier, app-qualified or bare when unambiguous. | |
| language | No | One of curl, go, nodejs, python, ansible. | curl |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |