当前位置: 首页 > article >正文

UiPath API接口说明

Swagger网址

私有云网址(企业版)

https://企业/swagger/index.html

公有云网址(社区版)

https://cloud.uipath.com/linan/LinanZhang/orchestrator_/swagger/index.html#/

在这里插入图片描述

常见问题

  1. Swagger页面测试请求时报错“You are not authenticated!”

    解决:先登录OC,再打开Swagger

在这里插入图片描述

Parameters

filter 根据值来筛选

如果希望根据Title来搜索可以在输入$filter中输入如下(value用单引号括起来):

title eq 'Fin_Commercial_OneStopShop_001_KADD'

在这里插入图片描述

请求地址

https://uipathoc.ab.cn/odata/Processes?$Filter=title eq 'ClassicFolder'

top 显示返回的结果集数量

如果只希望返回2条结果,可以输入如下

在这里插入图片描述

请求地址

https://uipathoc.ab.cn/odata/Releases**?$top=2**

Account

获取token

方法:POST

请求地址:https://uipathoc.ab.cn/api/Account/Authenticate

请求体:

tenancyName:租户名(BCC所有的租户名均为null)

username:用户名

password:用户密码

{
  "tenancyName": null,
  "usernameOrEmailAddress": "zhanglinan",
  "password": "your_password"
}

响应体:

result:token

{
    "result": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkQ0NzJDRTcwNzdBOTE5Mjc3MzExRTA5Q0I2RkEyODE4NkREMDNGNkIiLCJ0eXAiOiJKV1QiLCJ4NXQiOiIxSExPY0hlcEdTZHpFZUNjdHZvb0dHM1FQMnMifQ.eyJuYmYiOjE2NjA4ODg4MjksImV4cCI6MTY2MDg5MjcyOSwiaXNzIjoiaHR0cHM6Ly91aXBhdGhvYy5hYi1pbmJldi5jbi9pZGVudGl0eSIsImF1ZCI6WyJJZGVudGl0eVNlcnZlckFwaSIsIk9yY2hlc3RyYXRvckFwaVVzZXJBY2Nlc3MiXSwiY2xpZW50X2lkIjoiNGQ3ZjJiZjItOTA5My00OTU5LTlkNTItYjRhNjYwZjE0ODVmIiwic3ViIjoiZWJjZjBiZDQtN2ViOS00NmZkLWIyMDMtNzkyMDdkYjE5NTkxIiwiYXV0aF90aW1lIjoxNjYwODg5MTI5LCJpZHAiOiJsb2NhbCIsIkFzcE5ldC5JZGVudGl0eS5TZWN1cml0eVN0YW1wIjoiNVIzRE1NSUJLN1FSTkJXMlFPU1hHUUlQRUFXSE1WVEciLCJwcnRfaWQiOiJkZGM0YTM3YS00N2M5LTQxZDEtOGRkZi05ZGViNmNiNGNmNjUiLCJob3N0IjoiRmFsc2UiLCJmaXJzdF9uYW1lIjoibGluYW4iLCJsYXN0X25hbWUiOiJ6aGFuZyIsInBydF9hZG0iOiJGYWxzZSIsInByZWZlcnJlZF91c2VybmFtZSI6InpoYW5nbGluYW4iLCJuYW1lIjoiemhhbmdsaW5hbiIsInNjb3BlIjpbImVtYWlsIiwib3BlbmlkIiwicHJvZmlsZSIsInRlbmFudCIsIklkZW50aXR5U2VydmVyQXBpIiwiT3JjaGVzdHJhdG9yQXBpVXNlckFjY2VzcyJdLCJhbXIiOlsicHdkIl19.YhDrcPhEFTHcXXQdnvAywYKPa0ng6wWbVqEO_g9qQs72dA_puvWk-KDZUrWbhzOfLGdoKi29ao23fm9c-C8r1o9LEYYSBYFjWAUNGiJ9-KWSQs1fs-CrKdk0iVd71pOeDN4-P7c6wTzfZ7pqBU6BofyXyugw0oWuDIoGHQorbtE4ZIcot3y9YD866zyK9wNaHRKEC_rS3_AoQrEvQBlu5sxI7wXFTpAxNeexZDI9JuYLDWKsI3qQ9nj_ioFpB1Ruukmng3Uc4bbJNdxdWmAXnO8ASeG1bc68Lf-H015pn9fXu4HabDzstDmrkXTvhTIVo4kXy14ooJnHxdEjREnhoA",
    "targetUrl": null,
    "success": true,
    "error": null,
    "unAuthorizedRequest": false,
    "__abp": true
}

Users

获取用户信息

方法:GET

请求地址:https://uipathoc.ab.cn/odata/Users

请求头:Authorization:Bearer+空格+token

响应体:

{
  "@odata.context": "https://uipathoc.ab.cn/odata/$metadata#Users",
  "@odata.count": 1,
  "value": [
    {
      "Name": "linan",
      "Surname": "zhang",
      "UserName": "zhanglinan",
      "Domain": null,
      "DirectoryIdentifier": null,
      "FullName": "linan zhang",
      "EmailAddress": "",
      "IsEmailConfirmed": false,
      "LastLoginTime": "2022-09-06T13:56:57.073Z",
      "IsActive": true,
      "CreationTime": "2022-08-17T08:36:29.45Z",
      "AuthenticationSource": "local",
      "Password": null,
      "IsExternalLicensed": false,
      "RolesList": [
        "Allow to be Folder Administrator",
        "Allow to be Automation User",
        "Robot"
      ],
      "LoginProviders": [],
      "TenantId": 1,
      "TenancyName": null,
      "TenantDisplayName": null,
      "TenantKey": null,
      "Type": "DirectoryUser",
      "ProvisionType": "Manual",
      "LicenseType": null,
      "Key": "ebcf0bd4-7eb9-46fd-b203-79207db19591",
      "MayHaveUserSession": true,
      "MayHaveRobotSession": false,
      "MayHaveUnattendedSession": false,
      "BypassBasicAuthRestriction": false,
      "MayHavePersonalWorkspace": false,
      "RestrictToPersonalWorkspace": false,
      "Id": 98,
      "RobotProvision": null,
      "UnattendedRobot": null,
      "NotificationSubscription": {
        "Queues": true,
        "Robots": true,
        "Jobs": true,
        "Schedules": true,
        "Tasks": true,
        "QueueItems": true,
        "Insights": false,
        "CloudRobots": true
      },
      "UpdatePolicy": null
    }
  ]
}

Processes(包)

获取包

方法:GET

请求地址:https://uipathoc.ab.cn/odata/Processes

请求头:Authorization:Bearer+空格+token

请求体:如果不做限制,则返回本用户权限范围内的所有包。

响应体:

{
  "@odata.context": "",
  "@odata.count": 1,
  "value": [
    {
      "IsActive": false,
      "SupportsMultipleEntryPoints": true,
      "MainEntryPointPath": "001_01_KADDDeductionReport\\Fin_Commercial_OneStopShop_001_01_02_KADDDeductionReportWeekly.xaml",
      "RequiresUserInteraction": true,
      "IsAttended": false,
      "TargetFramework": "Legacy",
      "Title": "Fin_Commercial_OneStopShop_001_KADD",
      "Version": "1.0.29",
      "Key": "Fin_Commercial_OneStopShop_001_KADD:1.0.29",
      "Description": "Fin_Commercial_OneStopShop_001_KADD",
      "Published": "2022-09-06T08:29:28.9333333Z",
      "IsLatestVersion": false,
      "OldVersion": null,
      "ReleaseNotes": null,
      "Authors": "admin",
      "ProjectType": "Process",
      "Tags": "VisualBasic VB UiPathStudioProcess",
      "IsCompiled": false,
      "Id": "Fin_Commercial_OneStopShop_001_KADD",
      "Arguments": {
        "Input": null,
        "Output": null
      }
    }
  ]
}

Folders(文件夹)

获取文件夹

方法:GET

请求地址:https://uipathoc.ab.cn/odata/Folders

请求头:Authorization:Bearer+空格+token

响应体:

{    
	"@odata.context":   "https://uipathoc.ab.cn/odata/$metadata#Folders",
	    "@odata.count":  7,
	    "value":  [        {            
		"Key":   "9615a084-86a8-452a-8080-6d347bd60a26",
		            "DisplayName":   "Fin_Commercial_OneStopShop",
		            "FullyQualifiedName":   "ABI/Fin/Commercial/Fin_Commercial_OneStopShop",
		            "FullyQualifiedNameOrderable": "ABI�Fin�Commercial�Fin_Commercial_OneStopShop",
		            "Description":  null,
		            "ProvisionType":   "Automatic",
		            "PermissionModel":   "FineGrained",
		            "ParentId":  24,
		            "ParentKey":   "2cb9bb8c-daef-4f44-bc39-09537158d632",
		            "IsActive":  true,
		            "FeedType":   "Processes",
		            "Id":  88        
	}    ]
}

Release(流程)

Release是流程,默认一个包有一个主流程,但可以设置多个入口点,包+入口点唯一确定1个流程。

【技巧】先返回所有结果集,观察键值,再通过filter找到需要触发的流程

获取多个流程

方法:GET

请求地址:https://uipathoc.ab.cn//odata/Releases

请求头:Authorization:Bearer+空格+token

请求体:如果不做限制,则返回本用户权限范围内的所有流程。

响应体:

OrganizationUnitFullyQualifiedName:文件夹名

Name:OC流程名

ProcessKey:包名

*OrganizationUnitFullyQualifiedName + Name唯一确定1个流程*

{
	"@odata.context": "https://uipathoc.ab.cn/odata/$metadata#Releases",
	"@odata.count": 1,
	"value": [{
		"Key": "b76cf2e6-4724-45c3-ac57-1f9c8dca560c",
		"ProcessKey": "DL_MRP_RPA_004_POCreate",
		"ProcessVersion": "1.0.14",
		"IsLatestVersion": false,
		"IsProcessDeleted": false,
		"Description": "PO Create",
		"Name": "DL_MRP_RPA_004_POCreate",
		"EnvironmentId": null,
		"EnvironmentName": "",
		"EntryPointId": 10423,
		"InputArguments": null,
		"ProcessType": "Process",
		"SupportsMultipleEntryPoints": true,
		"RequiresUserInteraction": true,
		"IsAttended": false,
		"IsCompiled": false,
		"AutoUpdate": false,
		"FeedId": "bfd8d74f-73c9-4cdb-ab50-a12c4d359e85",
		"JobPriority": "Normal",
		"CreationTime": "2023-01-20T05:43:27.817Z",
		"OrganizationUnitId": 122,
		"OrganizationUnitFullyQualifiedName": "ABI/DL/MRP/DL_MRP_RPA",
		"TargetFramework": "Legacy",
		"Id": 788,
		"Arguments": {
			"Input": "[]",
			"Output": "[]"
		},
		"ProcessSettings": null
	}]
}

获取单个流程

方法:GET

请求地址:https://uipathoc.ab.cn/odata/Releases({key})(key为Release的id)

请求地址示例:https://uipathoc.ab.cn/odata/Releases(788)

响应体:

{
    "@odata.context": "https://uipathoc.ab.cn/odata/$metadata#Releases/$entity",
    "Key": "b76cf2e6-4724-45c3-ac57-1f9c8dca560c",
    "ProcessKey": "DL_MRP_RPA_004_POCreate",
    "ProcessVersion": "1.0.14",
    "IsLatestVersion": false,
    "IsProcessDeleted": false,
    "Description": "PO Create",
    "Name": "DL_MRP_RPA_004_POCreate",
    "EnvironmentId": null,
    "EnvironmentName": "",
    "EntryPointId": 10423,
    "InputArguments": null,
    "ProcessType": "Process",
    "SupportsMultipleEntryPoints": true,
    "RequiresUserInteraction": true,
    "IsAttended": false,
    "IsCompiled": false,
    "AutoUpdate": false,
    "FeedId": "bfd8d74f-73c9-4cdb-ab50-a12c4d359e85",
    "JobPriority": "Normal",
    "CreationTime": "2023-01-20T05:43:27.817Z",
    "OrganizationUnitId": 122,
    "OrganizationUnitFullyQualifiedName": null,
    "TargetFramework": "Legacy",
    "Id": 788,
    "Arguments": {
        "Input": "[]",
        "Output": "[]"
    },
    "ProcessSettings": {
        "ErrorRecordingEnabled": false,
        "Duration": 40,
        "Frequency": 500,
        "Quality": 100,
        "AutoStartProcess": false,
        "AlwaysRunning": false
    }
}

Job(作业)

Job是作业,作业是流程的实例。

开始作业

方法:POST

请求地址:https://uipathoc.ab.cn/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

请求头:
X-UIPATH-OrganizationUnitId: 文件夹ID

Authorization:Bearer+空格+token

请求体(完整参数请参考Swagger页面):

ReleaseKey:Release的Key

RuntimeType:运行类型,如果设置为attended会报错。

{"startInfo": {
    "ReleaseKey": "b76cf2e6-4724-45c3-ac57-1f9c8dca560c",
    "JobsCount": 1,
    "JobPriority": "Normal",
    "Strategy": "ModernJobsCount",
    "ResumeOnSameContext": false,
    "RuntimeType": "Unattended"
}
}

响应体:

{
    "@odata.context": "https://uipathoc.ab.cn/odata/$metadata#Jobs",
    "value": [
        {
            "Key": "38a4b511-7d9b-4e06-aebb-86693d4af12c",
            "StartTime": null,
            "EndTime": null,
            "State": "Pending",
            "JobPriority": "Normal",
            "Source": "Manual",
            "SourceType": "Manual",
            "BatchExecutionKey": "b8c9a01e-014b-4a83-9ea3-42f8eecbf0dc",
            "Info": null,
            "CreationTime": "2023-02-03T06:41:00.06Z",
            "StartingScheduleId": null,
            "ReleaseName": "DL_MRP_RPA_004_POCreate",
            "Type": "Unattended",
            "InputArguments": null,
            "OutputArguments": null,
            "HostMachineName": null,
            "HasMediaRecorded": false,
            "PersistenceId": null,
            "ResumeVersion": null,
            "StopStrategy": null,
            "RuntimeType": "Unattended",
            "RequiresUserInteraction": true,
            "ReleaseVersionId": null,
            "EntryPointPath": "Business\\DL_MRP_RPA_004_POCreate.xaml",
            "OrganizationUnitId": 122,
            "OrganizationUnitFullyQualifiedName": null,
            "Reference": "",
            "ProcessType": "Process",
            "ProfilingOptions": null,
            "ResumeOnSameContext": false,
            "LocalSystemAccount": "",
            "OrchestratorUserIdentity": null,
            "Id": 170708
        }
    ]
}

http://www.kler.cn/a/430402.html

相关文章:

  • 数据库模型全解析:从文档存储到搜索引擎
  • 代码随想录day38 动态规划6
  • Android修改开机动画路径
  • LabVIEW四旋翼飞行器姿态监测系统
  • 9. C 语言 循环控制结构详解
  • 【51单片机】02LED流水灯实验
  • Next.js优化教程:优化脚本加载
  • Unity3D 为什么要避免使用SetActive详解
  • windows将文件推给Android真机/实机
  • Docker魔法:用docker run -p轻松开通容器服务大门
  • 双向链表的模拟实现 —— LinkedList
  • java全栈day12-后端Web实战(IOC+DI)
  • 在商业智能BI系统中,如何配置高级感的数据可视化折线图?
  • vue 封装全局过滤器
  • Leecode刷题C语言之判断国际象棋棋盘中一个格子的颜色
  • 子网划分实例
  • 数据结构第一弹-图
  • sql中的运算符
  • 数据结构题库11
  • 网络安全法-法律责任
  • 酷柚易汛进销存系统PHP+Uniapp
  • 上下料机器人,CNC 加工行业的变革性力量
  • 电动车多动力源的扭矩协调:提升能源效率与车辆性能的关键
  • 如何优化 JavaScript 中的 DOM 操作?
  • Linux: docker: 怎么修改 proc下的文件内容?
  • 一次“okhttp访问间隔60秒,提示unexpected end of stream“的问题排查过程