- Überblick
- Erste Schritte
- Konzepte
- Verwenden der UiPath CLI
- Anleitungen
- CI/CD-Rezepte
- Befehlsreferenz
- Überblick
- Exitcodes
- Globale Optionen
- UIP-codierter Agent
- UIP-Coded
- UIP-Kontextgrundlage
- UIP-Dokumentation
- UIP-Funktion
- UIP-Leitplanken
- uip llm-configuration
- uip llm-gateway
- UIP Maestro-Erstellung
- UIP Maestro-Registrierung
- UIP-Modellhub
- uip ont
- Aktivitäten finden
- get-standard-xaml
- Analysieren
- Analyseregeln-Liste
- Erstellen
- Bereinigung
- data-fabric-entities installieren
- data-fabric-entities-Liste
- Dateien differenzieren
- Get-Library-Object-Repository
- Get-Object-Repository
- Init
- Instanzenliste
- Packen
- Pakete überprüfen
- Pakete installieren
- Paketversionen
- Veröffentlichen
- Remote
- restore
- Ausführen, Debuggen & Ausführung enthält
- Einstellungen
- Studio-Start
- Vorlagensuche
- Testdaten-Add-Entität
- Testdaten-Warteschlange hinzufügen
- Testdaten-Hinzufügevariante
- TM
- UIA
- Überprüfen
- Workflow-Beispiele abrufen
- Workflow-Beispiele
- uip resources
- UIP-Aufgaben
- Anhang
- benutzerdefiniertes Feld
- Defects
- Ausführungen
- Exportaufträge
- Migration
- Objektbeschriftung
- Packen
- perf-szenario
- Perf-Szenario-Lastgruppen
- Ausführungsdaten für perf-szenario
- Perf-Szenario-Bericht
- Projekt
- Projektberechtigungen
- Aufforderungen
- Melden
- Anforderungen
- Ergebnis
- Ausführen
- Zeitpläne
- Scopes
- Testfallprotokoll
- Testfälle
- Testsätze
- Testschrittprotokoll
- Benutzer
- Warten
- UIP-Ablaufverfolgungen
- Feedback zu UIP-Ablaufverfolgungen
- Migration
- Referenz und Support
uip api
Syntax and options for `uip api`, which calls a UiPath REST endpoint with the signed-in session and keeps the access token out of the output.
uip api calls a UiPath REST endpoint that no other uip command covers. It uses the signed-in session: the CLI adds the base URL, the organization, the tenant, and the access token, sends the request, and returns the response in the standard envelope.
The access token is added inside the CLI process and never appears in the output. Use uip api instead of copying the token from uip login refresh into another HTTP client.
Zusammenfassung
uip api <path> [--method <method>] [--level <level>] [--input <file>] [--header <header...>] [--folder-key <folder-key>] [--output-file <file>]
uip api <path> [--method <method>] [--level <level>] [--input <file>] [--header <header...>] [--folder-key <folder-key>] [--output-file <file>]
This command honors the global options (--output, --output-filter, --log-level, --log-file, --profile). Exit codes follow the standard contract.
Argumente
| Argument | Beschreibung |
|---|---|
<path> | Required. The service path under the tenant URL or the organization URL, for example orchestrator_/odata/Folders. It can include a query string. A leading / is optional. |
The CLI builds the request URL from the session and the path:
--level | Anforderungs-URL |
|---|---|
tenant | <base-url>/<organization>/<tenant>/<path> |
organization | <base-url>/<organization>/<path> |
Optionen
| Markieren | Beschreibung |
|---|---|
--method <method> | HTTP method: GET, POST, PUT, PATCH, or DELETE. Defaults to GET. |
--level <level> | The URL that the path is under: tenant or organization. Defaults to tenant. |
--input <file> | File sent as the request body. The CLI sends it with Content-Type: application/json, unless --header sets another content type. Not accepted with GET. |
--header <header...> | One or more extra headers, each as 'Name: value' (space-separated). Authorization, Cookie, and Host cannot be set. |
--folder-key <folder-key> | Folder key, sent as the X-UIPATH-FolderKey header. |
--output-file <file> | Write the response body to this file instead of returning it in Data.Body. |
The CLI sends Accept: application/json unless --header sets another Accept value.
--header takes every value that follows it, up to the next option. Pass <path> before --header.
What the command refuses
The access token goes only to the host of the signed-in session, under the signed-in organization and tenant. The command fails with ValidationError (exit code 3, ErrorCode: invalid_argument) and sends no request in these cases:
- The path is a full URL, such as
https://example.com/x, or starts with//. - The path leaves the tenant URL or the organization URL through
..segments. --headersetsAuthorization,Cookie, orHost, or a value is not in the'Name: value'form.--inputis passed with theGETmethod, or the input file does not exist.--level tenantis in effect and the session has no tenant selected. Runuip login tenant set <tenant-name>, or pass--level organization.
The command does not follow redirects. A redirect response is reported as a failure, with the target in Data.Location.
In Git Bash on Windows, leave out the leading / of the path. Git Bash rewrites an argument that starts with / into a Windows path.
Beispiele
# GET a tenant-level endpoint (single quotes keep the shell from expanding $top)
uip api 'orchestrator_/odata/Folders?$top=1'
# GET a tenant-level endpoint (single quotes keep the shell from expanding $top)
uip api 'orchestrator_/odata/Folders?$top=1'
# GET in the context of a folder
uip api 'orchestrator_/odata/Releases?$top=1' \
--folder-key 11111111-2222-3333-4444-555555555555
# GET in the context of a folder
uip api 'orchestrator_/odata/Releases?$top=1' \
--folder-key 11111111-2222-3333-4444-555555555555
# POST a JSON file to an organization-level endpoint, with an extra header
uip api example_/api/items \
--level organization \
--method POST \
--input ./body.json \
--header 'x-example-header: demo'
# POST a JSON file to an organization-level endpoint, with an extra header
uip api example_/api/items \
--level organization \
--method POST \
--input ./body.json \
--header 'x-example-header: demo'
# Save the response body to a file
uip api 'orchestrator_/odata/Folders' --output-file ./folders.json
# Save the response body to a file
uip api 'orchestrator_/odata/Folders' --output-file ./folders.json
# Extract one value from the response body
uip api 'orchestrator_/odata/Folders?$top=1' \
--output-filter "Body.value[0].DisplayName" --output plain
# Extract one value from the response body
uip api 'orchestrator_/odata/Folders?$top=1' \
--output-filter "Body.value[0].DisplayName" --output plain
Datenform (--output json)
{
"Result": "Success",
"Code": "ApiResponse",
"Data": {
"StatusCode": 200,
"Body": {
"value": [
{ "DisplayName": "Finance" }
]
}
}
}
{
"Result": "Success",
"Code": "ApiResponse",
"Data": {
"StatusCode": 200,
"Body": {
"value": [
{ "DisplayName": "Finance" }
]
}
}
}
StatusCode— the HTTP status code of the response.Body— the response body. It is parsed JSON when the response content type is JSON, text for any other content type, andnullwhen the response has no body. The keys inBodyare kept as the service sent them.
With --output-file, the body is written to the file and Data describes the file instead:
{
"Result": "Success",
"Code": "ApiResponse",
"Data": {
"StatusCode": 200,
"OutputFile": "./folders.json",
"Bytes": 1532
}
}
{
"Result": "Success",
"Code": "ApiResponse",
"Data": {
"StatusCode": 200,
"OutputFile": "./folders.json",
"Bytes": 1532
}
}
OutputFile— the path passed to--output-file.Bytes— the size of the written body, in bytes.
Fehlerverhalten
A response with a status code outside the 200–299 range is a failure. The envelope carries the response in Data, so a script can read the service's own error:
{
"Result": "Failure",
"ErrorCode": "not_found",
"Message": "The service answered HTTP 404 to GET.",
"Instructions": "<what the status means and what to check>",
"Retry": "RetryWillNotFix",
"Data": {
"StatusCode": 404,
"Body": { "message": "Not found" }
}
}
{
"Result": "Failure",
"ErrorCode": "not_found",
"Message": "The service answered HTTP 404 to GET.",
"Instructions": "<what the status means and what to check>",
"Retry": "RetryWillNotFix",
"Data": {
"StatusCode": 404,
"Body": { "message": "Not found" }
}
}
Data.StatusCodeandData.Body— the status code and the body of the failed response. On failure, the body is returned inData.Bodyeven when--output-fileis passed, and no file is written.Data.Location— theLocationheader of the response, when it has one.
Result, ErrorCode, and the exit code follow the status code:
| Antwort | Result | ErrorCode | Code beenden |
|---|---|---|---|
| HTTP 401 | AuthenticationError | authentication_required | 2 |
| HTTP 403 | AuthenticationError | permission_denied | 2 |
| HTTP 400 or 422 | ValidationError | invalid_argument | 3 |
| HTTP 404 | Failure | not_found | 1 |
| HTTP 429 | Failure | rate_limited | 1 |
| HTTP 500–599 | Failure | server_error | 1 |
| Any other failed response, including a redirect | Failure | Depends on the status code | 1 |
When there is no signed-in session, the command fails with AuthenticationError (exit code 2) and sends no request.
Zugehörig
uip login— authenticate and pick the tenant thatuip apicalls.uip login status— check which organization and tenant the session targets.- Scripting patterns — branch on the exit code,
ErrorCode, andRetry.