Orchestrator
2021.10
バナーの背景画像
Orchestrator API ガイド
最終更新日 2024年4月19日

ロボットの要求

ロボットのステータスを取得する

注: LicenseKey パラメーターの値を抽出する場合は、/odata/Robots(Id) エンドポイントに GET 要求を送信する必要があります。

ID に基づいて取得する

以下の例では、ID が 749 のロボットの現在のステータスを表示できます。

GET

https://{yourDomain}/odata/Sessions?$top=10&$filter=Robot/Id eq 749&$select=State

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions(State)",
    "@odata.count": 1,
    "value": [
        {
            "State": "Available"
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions(State)",
    "@odata.count": 1,
    "value": [
        {
            "State": "Available"
        }
    ]
}

名前に基づいて取得する

以下の例では、名前が DocBot のロボットの現在のステータスを表示できます。

GET

https://{yourDomain}/odata/Sessions?$top=10&$filter=Robot/Name eq 'DocBot'&$select=State

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions(State)",
    "@odata.count": 1,
    "value": [
        {
            "State": "Available"
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions(State)",
    "@odata.count": 1,
    "value": [
        {
            "State": "Available"
        }
    ]
}

ロボットの情報をそのステートに従って取得する: 例 1

以下の例では、ステータスが「利用可能」で、過去 2 分間にハートビートを送信した最初の 10 台のロボットを要求します。該当するロボットの情報だけが表示されます。ハートビートを確認するには、ReportingTime パラメーターを使用して現在の時刻から 2 分を引きます。ご存じのように、ロボットが過去 2 分間にハートビートを送信していない場合、「応答なし」としてフラグが付けられます。

GET

https://{yourDomain}/odata/Sessions?$top=10&$filter=State eq 'Available' and ReportingTime gt 2018-03-05T03:48:04.147Z&$select=Robot&$expand=Robot

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions(Robot)",
    "@odata.count": 2,
    "value": [
        {
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "MBOBOC",
                "Name": "DocBot",
                "Username": "UIPATH\\MADALINA.BOBOC",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "doc_env,WR_env,Group1",
                "Id": 749,
                "ExecutionSettings": null
            }
        },
        {
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "midragomir",
                "Name": "mr-Rob",
                "Username": "uipath\\mircea.dragomir",
                "Description": "Alerts",
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "",
                "Id": 902,
                "ExecutionSettings": null
            }
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions(Robot)",
    "@odata.count": 2,
    "value": [
        {
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "MBOBOC",
                "Name": "DocBot",
                "Username": "UIPATH\\MADALINA.BOBOC",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "doc_env,WR_env,Group1",
                "Id": 749,
                "ExecutionSettings": null
            }
        },
        {
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "midragomir",
                "Name": "mr-Rob",
                "Username": "uipath\\mircea.dragomir",
                "Description": "Alerts",
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "",
                "Id": 902,
                "ExecutionSettings": null
            }
        }
    ]
}

ロボットの情報をそのステートに従って取得する: 例 2

以下の例では、ステータスが「切断」である上位 10 台のロボットを検索して、ロボットの情報を展開します。

GET

https://{yourDomain}/odata/Sessions?$top=10&$filter=State eq 'Disconnected'&$expand=Robot

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions",
    "@odata.count": 2,
    "value": [
        {
            "State": "Disconnected",
            "ReportingTime": "2018-01-15T18:47:07.93Z",
            "Info": null,
            "IsUnresponsive": false,
            "Id": 718,
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "DESKTOP-PMFQGCB",
                "Name": "Stan",
                "Username": "Alex",
                "Description": null,
                "Type": "Unattended",
                "Password": null,
                "RobotEnvironments": "doc_env,a_invoke_env,Group1",
                "Id": 759,
                "ExecutionSettings": null
            }
        },
        {
            "State": "Disconnected",
            "ReportingTime": "2018-01-18T18:14:14.34Z",
            "Info": null,
            "IsUnresponsive": false,
            "Id": 730,
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "DESKTOP-PMFQGCB",
                "Name": "!~#$%^&*()_+=-",
                "Username": "dragomirmir",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "WR_env",
                "Id": 771,
                "ExecutionSettings": null
            }
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Sessions",
    "@odata.count": 2,
    "value": [
        {
            "State": "Disconnected",
            "ReportingTime": "2018-01-15T18:47:07.93Z",
            "Info": null,
            "IsUnresponsive": false,
            "Id": 718,
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "DESKTOP-PMFQGCB",
                "Name": "Stan",
                "Username": "Alex",
                "Description": null,
                "Type": "Unattended",
                "Password": null,
                "RobotEnvironments": "doc_env,a_invoke_env,Group1",
                "Id": 759,
                "ExecutionSettings": null
            }
        },
        {
            "State": "Disconnected",
            "ReportingTime": "2018-01-18T18:14:14.34Z",
            "Info": null,
            "IsUnresponsive": false,
            "Id": 730,
            "Robot": {
                    "LicenseKey": null,
                "MachineName": "DESKTOP-PMFQGCB",
                "Name": "!~#$%^&*()_+=-",
                "Username": "dragomirmir",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "WR_env",
                "Id": 771,
                "ExecutionSettings": null
            }
        }
    ]
}

ロボットの情報をその ID に従って取得する

以下の例では、ID が 216 のロボットの詳細を取得します。このロボットはスマート カード認証を使用していることに注意してください。

GET

https://{yourDomain}/odata/Robots(216)

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Robots/$entity",
    "LicenseKey": "fc157179-3724-4bb0-acd2-8261bef82d01",
    "MachineName": "CAPETRINA",
    "MachineId": 15,
    "Name": "Gustavee",
    "Username": "uipath\\john.smith",
    "ExternalName": null,
    "Description": null,
    "Type": "Development",
    "HostingType": "Standard",
    "ProvisionType": "Manual",
    "Password": null,
    "CredentialStoreId": null,
    "UserId": 45,
    "Enabled": true,
    "CredentialType": null,
    "RobotEnvironments": "",
    "IsExternalLicensed": false,
    "LimitConcurrentExecution": false,
    "Id": 216,
    "ExecutionSettings": {
        "ResolutionHeight": 0,
        "ResolutionDepth": 0,
        "FontSmoothing": false,
        "AutoDownloadProcess": false
    }
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Robots/$entity",
    "LicenseKey": "fc157179-3724-4bb0-acd2-8261bef82d01",
    "MachineName": "CAPETRINA",
    "MachineId": 15,
    "Name": "Gustavee",
    "Username": "uipath\\john.smith",
    "ExternalName": null,
    "Description": null,
    "Type": "Development",
    "HostingType": "Standard",
    "ProvisionType": "Manual",
    "Password": null,
    "CredentialStoreId": null,
    "UserId": 45,
    "Enabled": true,
    "CredentialType": null,
    "RobotEnvironments": "",
    "IsExternalLicensed": false,
    "LimitConcurrentExecution": false,
    "Id": 216,
    "ExecutionSettings": {
        "ResolutionHeight": 0,
        "ResolutionDepth": 0,
        "FontSmoothing": false,
        "AutoDownloadProcess": false
    }
}

特定のプロセスを実行可能なロボットをすべて取得する

以下の例では、/odata/Robots/UiPath.Server.Configuration.OData.GetRobotsForProcess に要求を送信します。これにより、ID が input_output_arguments_example のパッケージを実行できるロボットをその場で確認できます。

GET

https://{yourDomain}/odata/Robots/UiPath.Server.Configuration.OData.GetRobotsForProcess(processId='input_output_arguments_example')

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
  "@odata.context": "https://{yourDomain}/odata/$metadata#Robots",
  "@odata.count": 2,
  "value": [
    {
      "LicenseKey": null,
      "MachineName": "DESKTOP-ASBD",
      "MachineId": 129,
      "Name": "Stan",
      "Username": "Alex",
      "Description": null,
      "Version": null,
      "Type": "Unattended",
      "HostingType": "Standard",
      "Password": null,
      "RobotEnvironments": "doc_env,a_invoke_env,Group1",
      "Id": 759,
      "ExecutionSettings": null
    },
    {
      "LicenseKey": null,
      "MachineName": "Doc",
      "MachineId": 1066,
      "Name": "DocBot",
      "Username": "uipath\\documentation",
      "Description": null,
      "Version": "18.3.0.558",
      "Type": "NonProduction",
      "HostingType": "Standard",
      "Password": null,
      "RobotEnvironments": "doc_env",
      "Id": 1684,
      "ExecutionSettings": null
    }
  ]
}{
  "@odata.context": "https://{yourDomain}/odata/$metadata#Robots",
  "@odata.count": 2,
  "value": [
    {
      "LicenseKey": null,
      "MachineName": "DESKTOP-ASBD",
      "MachineId": 129,
      "Name": "Stan",
      "Username": "Alex",
      "Description": null,
      "Version": null,
      "Type": "Unattended",
      "HostingType": "Standard",
      "Password": null,
      "RobotEnvironments": "doc_env,a_invoke_env,Group1",
      "Id": 759,
      "ExecutionSettings": null
    },
    {
      "LicenseKey": null,
      "MachineName": "Doc",
      "MachineId": 1066,
      "Name": "DocBot",
      "Username": "uipath\\documentation",
      "Description": null,
      "Version": "18.3.0.558",
      "Type": "NonProduction",
      "HostingType": "Standard",
      "Password": null,
      "RobotEnvironments": "doc_env",
      "Id": 1684,
      "ExecutionSettings": null
    }
  ]
}

ロボット ログをロボット名に従って取得する

以下の例では、DocBot という名前のロボットのロボット ログを表示できます。

GET

https://{yourDomain}/odata/RobotLogs?$top=100&$skip=200&$filter=RobotName eq 'DocBot'

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#RobotLogs",
    "@odata.count": 202,
    "value": [
        {
            "Level": "Info",
            "WindowsIdentity": "UIPATH\\john.smith",
            "ProcessName": "TestingSequence_DOC",
            "TimeStamp": "2019-10-14T13:55:18.2473626Z",
            "Message": "TestingSequence_DOC execution started",
            "JobKey": "e49c0012-ee01-45e4-884c-0ce1f2aa6fbb",
            "RawMessage": "{\r\n  \"message\": \"TestingSequence_DOC execution started\",\r\n  \"level\": \"Information\",\r\n  \"logType\": \"Default\",\r\n  \"timeStamp\": \"2019-10-14T13:55:18.2473626+00:00\",\r\n  \"fingerprint\": \"972a32c3-95d9-4264-ae5d-af589bf4f0b5\",\r\n  \"windowsIdentity\": \"UIPATH\\\\petrina.calota\",\r\n  \"machineName\": \"LAPTOP-IN7198N3\",\r\n  \"processName\": \"TestingSequence_DOC\",\r\n  \"processVersion\": \"1.1.7024.37929\",\r\n  \"jobId\": \"e49c0012-ee01-45e4-884c-0ce1f2aa6fbb\",\r\n  \"robotName\": \"G\",\r\n  \"machineId\": 229978,\r\n  \"organizationUnitId\": 67543,\r\n  \"fileName\": \"Main\"\r\n}",
            "RobotName": "DocBot",
            "MachineId": 229978,
            "Id": 0
        },
        {
            "Level": "Info",
            "WindowsIdentity": "UIPATH\\john.smith",
            "ProcessName": "TestingSequence_DOC",
            "TimeStamp": "2019-10-14T13:57:21.4985672Z",
            "Message": "TestingSequence_DOC execution ended",
            "JobKey": "e49c0012-ee01-45e4-884c-0ce1f2aa6fbb",
            "RawMessage": "{\r\n  \"message\": \"TestingSequence_DOC execution ended\",\r\n  \"level\": \"Information\",\r\n  \"logType\": \"Default\",\r\n  \"timeStamp\": \"2019-10-14T13:57:21.4985672+00:00\",\r\n  \"fingerprint\": \"e973b4f2-deec-4290-978b-3a8af0769b35\",\r\n  \"windowsIdentity\": \"UIPATH\\\\petrina.calota\",\r\n  \"machineName\": \"LAPTOP-IN7198N3\",\r\n  \"processName\": \"TestingSequence_DOC\",\r\n  \"processVersion\": \"1.1.7024.37929\",\r\n  \"jobId\": \"e49c0012-ee01-45e4-884c-0ce1f2aa6fbb\",\r\n  \"robotName\": \"G\",\r\n  \"machineId\": 229978,\r\n  \"organizationUnitId\": 67543,\r\n  \"totalExecutionTimeInSeconds\": 123,\r\n  \"totalExecutionTime\": \"00:02:03\",\r\n  \"fileName\": \"Main\"\r\n}",
            "RobotName": "DocBot",
            "MachineId": 229978,
            "Id": 0
        }
  ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#RobotLogs",
    "@odata.count": 202,
    "value": [
        {
            "Level": "Info",
            "WindowsIdentity": "UIPATH\\john.smith",
            "ProcessName": "TestingSequence_DOC",
            "TimeStamp": "2019-10-14T13:55:18.2473626Z",
            "Message": "TestingSequence_DOC execution started",
            "JobKey": "e49c0012-ee01-45e4-884c-0ce1f2aa6fbb",
            "RawMessage": "{\r\n  \"message\": \"TestingSequence_DOC execution started\",\r\n  \"level\": \"Information\",\r\n  \"logType\": \"Default\",\r\n  \"timeStamp\": \"2019-10-14T13:55:18.2473626+00:00\",\r\n  \"fingerprint\": \"972a32c3-95d9-4264-ae5d-af589bf4f0b5\",\r\n  \"windowsIdentity\": \"UIPATH\\\\petrina.calota\",\r\n  \"machineName\": \"LAPTOP-IN7198N3\",\r\n  \"processName\": \"TestingSequence_DOC\",\r\n  \"processVersion\": \"1.1.7024.37929\",\r\n  \"jobId\": \"e49c0012-ee01-45e4-884c-0ce1f2aa6fbb\",\r\n  \"robotName\": \"G\",\r\n  \"machineId\": 229978,\r\n  \"organizationUnitId\": 67543,\r\n  \"fileName\": \"Main\"\r\n}",
            "RobotName": "DocBot",
            "MachineId": 229978,
            "Id": 0
        },
        {
            "Level": "Info",
            "WindowsIdentity": "UIPATH\\john.smith",
            "ProcessName": "TestingSequence_DOC",
            "TimeStamp": "2019-10-14T13:57:21.4985672Z",
            "Message": "TestingSequence_DOC execution ended",
            "JobKey": "e49c0012-ee01-45e4-884c-0ce1f2aa6fbb",
            "RawMessage": "{\r\n  \"message\": \"TestingSequence_DOC execution ended\",\r\n  \"level\": \"Information\",\r\n  \"logType\": \"Default\",\r\n  \"timeStamp\": \"2019-10-14T13:57:21.4985672+00:00\",\r\n  \"fingerprint\": \"e973b4f2-deec-4290-978b-3a8af0769b35\",\r\n  \"windowsIdentity\": \"UIPATH\\\\petrina.calota\",\r\n  \"machineName\": \"LAPTOP-IN7198N3\",\r\n  \"processName\": \"TestingSequence_DOC\",\r\n  \"processVersion\": \"1.1.7024.37929\",\r\n  \"jobId\": \"e49c0012-ee01-45e4-884c-0ce1f2aa6fbb\",\r\n  \"robotName\": \"G\",\r\n  \"machineId\": 229978,\r\n  \"organizationUnitId\": 67543,\r\n  \"totalExecutionTimeInSeconds\": 123,\r\n  \"totalExecutionTime\": \"00:02:03\",\r\n  \"fileName\": \"Main\"\r\n}",
            "RobotName": "DocBot",
            "MachineId": 229978,
            "Id": 0
        }
  ]
}
注:

Elasticsearch を使用して保存されたロボット ログへの GET 要求では、最初の 10,000 件のエントリのみが取得されます。これは Elasticsearch の制限によるものです。SQL を使用している場合は発生しません。

使用する $top パラメーターと $skip パラメーターが 10,000 件の制限を超えると、次のエラー メッセージが表示されます。「Elasticsearch では、max_result_window インデックス設定によりページネーションの深さが制限されています。skip + take が 10000 より小さいことをご確認ください。」
Elasticsearch を使用して保存されるロボット ログへの要求をパラメーター化する場合にサポートされている条件と動詞の組み合わせは、RobotName eqJobKey eqMachineId eqLevel geTimeStamp gt のみです。

ロボットの情報を編集する

以下の例では、ID が 749 のロボットの種類と名前を変更し、実行設定の構成を変更します。要求ヘッダーに X-UIPATH-OrganizationUnitId を配置し、要求本文にロボット ID とマシン名を配置することを忘れないでください。
注:

Robots エンドポイントに PUT 要求を送信する際は、以下を考慮してください。

  • ロボットのユーザー名とパスワードは、同じユーザー名と、null または空のパスワードを送信した場合には更新されません。
  • 新しいユーザー名を null または空のパスワードとともに送信すると、ロボットの資格情報が更新され、新しいユーザー名が使用されます。

PUT

https://{yourDomain}/odata/Robots(749)

要求ヘッダー

キー

値 (Value)

認可

Bearer

X-UIPATH-OrganizationUnitId

コンテナー フォルダーの ID です。

たとえば、36886 です。

要求本文

{
  "LicenseKey": "8ec4t984-b2d7-44f2-b5be-0a64ee9a487b",
  "MachineName": "MBOBOC",
  "Name": "DocBot",
  "Type": "Development",
  "Id": 749,
  "Username": "UIPATH\\JustAnotherRobot",
  "ExecutionSettings":{
        "TracingLevel":"Information",
        "StudioNotifyServer":true,
        "LoginToConsole":false,
        "ResolutionWidth":0,
        "ResolutionHeight":0,
        "ResolutionDepth":0,
        "FontSmoothing":false,
        "AutoDownloadProcess":false
    }
}{
  "LicenseKey": "8ec4t984-b2d7-44f2-b5be-0a64ee9a487b",
  "MachineName": "MBOBOC",
  "Name": "DocBot",
  "Type": "Development",
  "Id": 749,
  "Username": "UIPATH\\JustAnotherRobot",
  "ExecutionSettings":{
        "TracingLevel":"Information",
        "StudioNotifyServer":true,
        "LoginToConsole":false,
        "ResolutionWidth":0,
        "ResolutionHeight":0,
        "ResolutionDepth":0,
        "FontSmoothing":false,
        "AutoDownloadProcess":false
    }
}

応答コード

200 OK

ロボットを削除する

1 つのロボットを削除する

特定のロボットを削除するには、odata/Robots({robot_id}) エンドポイントに対して DELETE 要求を実行します。

DELETE

https://{yourDomain}/odata/Robots(79)

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

204 No Content

複数のロボットを削除する

複数のロボットを同時に削除するには、/Robots/UiPath.Server.Configuration.OData.DeleteBulk エンドポイントに対して POST 要求を実行します。

POST

https://{yourDomain}/odata/Robots/UiPath.Server.Configuration.OData.DeleteBulk

要求ヘッダー

キー

値 (Value)

認可

Bearer

要求本文

{
    "robotIds": [119, 120]
}{
    "robotIds": [119, 120]
}

応答コード

204 No Content

自身の Unattended ロボットのパスワードを更新する

以下のエンドポイントを呼び出してユーザー ID を入力すると、自身の Unattended ロボットのパスワードが更新されます (ここでは、ユーザー ID を 88 としています)。この操作には、ユーザーに対する編集権限は不要です。

注: 別のロボットのパスワードを更新する場合は、各ユーザーの ID を使用して同じエンドポイントに PUT 要求を送信します。

PATCH

https://{yourDomain}/odata/Users(88)

要求ヘッダー

キー

値 (Value)

認可

Bearer

要求本文

{
"UnattendedRobot": 
   {
    "Password": "newUnattendedRobotP@ss"
    }
}{
"UnattendedRobot": 
   {
    "Password": "newUnattendedRobotP@ss"
    }
}

応答コード

200 OK

Was this page helpful?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
UiPath ロゴ (白)
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.