launchpad-dx-apis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLaunchpad data model
Launchpad数据模型
Launchpad has Applications and each Application has Workflow or Data that will hold information about the lifecycle and the data model.
Launchpad provides COnstellation UI to create and run these workflows and Data. In some use cases we sometimes might have to create cases from outside using a Rest service in Launchpad. Or let us say a step in a workflow is to be completed by an external system then DXAPIs are the way.
DX APIs are called so as these are Digital Experience APIs as they are like Rest endpoints which give you data and alos provide view meta information so you can display the object in an external system using the view meta data.
For the context of this skill we will focus only on the DX APIS aspect of what types of API do we have and how can be use them.
Launchpad包含应用程序,每个应用程序都有Workflow(工作流)或Data(数据),用于存储生命周期相关信息和数据模型。Launchpad提供Constellation UI来创建和运行这些工作流与数据。在某些场景下,我们可能需要通过Launchpad中的Rest服务从外部创建案例;或者当工作流中的某个步骤需要由外部系统完成时,DX API就是合适的解决方案。
DX API全称为Digital Experience API(数字体验API),它们是Rest端点,既可以返回数据,也能提供视图元信息,让你可以借助这些元数据在外部系统中展示对象。
在本技能的语境下,我们仅聚焦DX API的相关内容,包括有哪些类型的API,以及如何使用它们。
Type of DXAPIs
DX API的类型
We have DX APIs for the following:
- Create Case or Data object on Launchpad
- Get the Case/Data information of an object
- Perform action on a particular workflow/case.
- Get a list of Objects by passing some filter criteria
- Get additional content of the application like Attachments.
我们提供以下类型的DX API:
- 在Launchpad上创建案例或数据对象
- 获取案例/数据对象的信息
- 对特定工作流/案例执行操作
- 通过传入筛选条件获取对象列表
- 获取应用程序的附加内容,如附件。
Authentication
认证
Launchpad support OAuth 2.0 authenitcation to invoke these DXAPIs.
For anyone to invoke the DX APIs we need to have a Client Registration rule created in the Subscriber environment of Launchpad. When this Client Registration is created there will be an option to provide the Persona who will be using this Client Registration.
So when any DXAPI is invoked with this credentials the Access Role and Privileges for this DXAPI will be determined by the Persona provided in the Client Registration. So it is very important to choose the right Persona while creating the Client Registration as this will determine what all DX APIs can be invoked using this Client Registration.
The external system or team before proceeding will have to ask the team who is hosting the Launchpad environment to share the following 4 things:
- Application URL
- AccessTokenURL
- ClientID
- Client Secret
Once these are obtained we can build a system to talk to the launchpad application using the above details.
AccessToken URL can be used to for the authentication and the Application URL can be used to invoke the DXAPIs.
Launchpad支持通过OAuth 2.0认证调用这些DX API。
要调用DX API,需要在Launchpad的订阅环境中创建Client Registration(客户端注册)规则。创建该规则时,需指定使用此客户端注册的Persona(角色)。
当使用该凭据调用DX API时,API的访问角色和权限将由Client Registration中指定的Persona决定。因此,创建Client Registration时选择正确的Persona至关重要,这将决定该客户端注册可调用哪些DX API。
外部系统或团队在开始操作前,需向托管Launchpad环境的团队获取以下4项信息:
- 应用程序URL
- AccessTokenURL(访问令牌URL)
- ClientID(客户端ID)
- Client Secret(客户端密钥)
获取这些信息后,我们就可以构建系统,通过上述信息与Launchpad应用程序进行交互。AccessToken URL用于认证,应用程序URL用于调用DX API。
Create Case DX API – scalar content
Create Case DX API – 标量内容
Use this pattern when an external system, needs to create a new case or Data object by sending data to Launchpad.
当外部系统需要向Launchpad发送数据以创建新案例或数据对象时,可使用此模式。
Create a Case
创建案例
Method: POST
Endpoint: https://<appURL>/dx/api/application/v2/cases
Request:
Body:
{
"caseTypeID": "ExpenseRequest",
"content": {
"ExpenseeRaisedBy":"John Doe",
"Name":"Expense Request for individual Name",
"Category":"Travel",
"Expenses":
{
{
"TravelType":"Air",
"Amount":1000$
},
{
"TravelType":"Cab"
"Amount":100$
}
},
"TotalAmount":1100$,
"Team":"Team A"
"ReasonforExpense":"Had to attend a conference in another city"
}
}
Response:
{
"data": {
"caseInfo": {
"caseTypeID": "ExpenseRequest",
"caseTypeName": "Expense Request",
"createTime": "2025-12-19T21:35:04.315Z",
"createdBy": "SystemUser",
"ID": "STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz",
"businessID": "ROT-715ABE",
"assignments": [
{
"actions": [
{
"ID": "ReviewExpenseRequest",
"links": {
"submit:Approve": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Approve",
"rel": "self",
"title": "Approve",
"type": "PATCH"
},
"ID": "ReviewExpenseRequest",
"links": {
"submit:Reject": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Reject",
"rel": "self",
"title": "Reject",
"type": "PATCH"
},
}]
}
"availableActions":[...]
}
}
}
方法:POST
端点:https://<appURL>/dx/api/application/v2/cases
请求:
请求体:
{
"caseTypeID": "ExpenseRequest",
"content": {
"ExpenseeRaisedBy":"John Doe",
"Name":"Expense Request for individual Name",
"Category":"Travel",
"Expenses":
{
{
"TravelType":"Air",
"Amount":1000$
},
{
"TravelType":"Cab"
"Amount":100$
}
},
"TotalAmount":1100$,
"Team":"Team A"
"ReasonforExpense":"Had to attend a conference in another city"
}
}
响应:
{
"data": {
"caseInfo": {
"caseTypeID": "ExpenseRequest",
"caseTypeName": "Expense Request",
"createTime": "2025-12-19T21:35:04.315Z",
"createdBy": "SystemUser",
"ID": "STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz",
"businessID": "ROT-715ABE",
"assignments": [
{
"actions": [
{
"ID": "ReviewExpenseRequest",
"links": {
"submit:Approve": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Approve",
"rel": "self",
"title": "Approve",
"type": "PATCH"
},
"ID": "ReviewExpenseRequest",
"links": {
"submit:Reject": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Reject",
"rel": "self",
"title": "Reject",
"type": "PATCH"
},
}]
}
"availableActions":[...]
}
}
}
Create a Data Object
创建数据对象
Method: POST
Endpoint: https://<appURL>/dx/api/application/v2/objects
Request:
Body:
{
"objectTypeID": "Category",
"content": {
"CategoryName":"Hotel"
}
}
{
Response:
“data”:{
"ID": "STE6Q29tbWVyY2lhbERlYWxDbG9zaW5nRnVuZGluZ19fTmV3RGVhbENsb3N1cmVfNjkzYzcwZjAyZjcyMjU0YTNlMjhkM2Qw"
}
}
Error: If you donot have access to create a case or data object then you will get a 403 error saying that you donot have permissions to create a case or data object. So it is very important to make sure that the Persona provided in the Client Registration has the access to create a case or data object in the application.
As we can see the request body for creating a case or a data object is very similar the only difference is in the endpoint and the type of object we are creating. For creating a case we need to provide the caseTypeID and for creating a data object we need to provide the objectTypeID. And in the response we get the ID of the created case or data object which can be used for any future reference to this case or data object in the other DXAPIs.
The fields that you can pass in the Create body have to be configured as Allowed Fields in the case or data object. If you try to pass any field which is not configured as an Allowed Field then the API will error out saying in valid data. All the fields requred in the Allowed Fields are required and additionally if we that field will be ignored and will not be created on the case or data object. So it is very important to make sure that all the fields that you want to pass in the Create body are configured as Allowed Fields in the case or data object.
In the Response of the Create Case API we also get the actions that are available on the case which can be used to perform any action on the case after it is created. For example in the above response we have an action called ProvideAdditionalDetails which can be used to send the additional Instructions from the external system to the launchpad application after the case is created. We can use the href provided in the response to invoke the action using a PATCH request and passing the additional details in the body of the request.
After Creating a Case the ID of the Case is to be stored somewhere in the external system for future references. This ID can be used to perform various operations on the case like updating the case, performing an action on the case, getting the details of the case etc.
方法:POST
端点:https://<appURL>/dx/api/application/v2/objects
请求:
请求体:
{
"objectTypeID": "Category",
"content": {
"CategoryName":"Hotel"
}
}
{
响应:
"data":{
"ID": "STE6Q29tbWVyY2lhbERlYWxDbG9zaW5nRnVuZGluZ19fTmV3RGVhbENsb3N1cmVfNjkzYzcwZjAyZjcyMjU0YTNlMjhkM2Qw"
}
}
错误说明:如果你没有创建案例或数据对象的权限,会收到403错误,提示你没有创建案例或数据对象的权限。因此,确保Client Registration中指定的Persona拥有在应用程序中创建案例或数据对象的权限至关重要。
可以看到,创建案例和数据对象的请求体非常相似,唯一的区别在于端点和创建的对象类型。创建案例需要提供caseTypeID,创建数据对象需要提供objectTypeID。响应中会返回创建的案例或数据对象的ID,可用于后续调用其他DX API时引用该对象。
请求体中可以传入的字段必须在案例或数据对象中配置为Allowed Fields(允许字段)。如果传入未配置为允许字段的字段,API会报错,提示数据无效。允许字段中标记为必填的字段必须传入,否则该字段会被忽略,不会在案例或数据对象中创建。因此,确保请求体中所有需要传入的字段都已配置为允许字段至关重要。
Create Case API的响应中还会返回案例可用的操作,可用于案例创建后对其执行操作。例如,在上述响应中,有一个名为ProvideAdditionalDetails的操作,可用于在案例创建后从外部系统向Launchpad应用程序发送额外说明。我们可以使用响应中提供的href,通过PATCH请求调用该操作,并在请求体中传入额外信息。
创建案例后,案例ID需要存储在外部系统中以备后续使用。该ID可用于对案例执行各种操作,如更新案例、执行操作、获取案例详情等。
Get an existing Case or data object using DX API
使用DX API获取现有案例或数据对象
Use this pattern when an external system, needs to get the details of an existing case or Data object by sending a request to Launchpad. This can be used to get the details of the case or data object after it is created or to get the latest details of the case or data object before performing any update on it.
Method: GET
Endpoint: https://<appURL>/dx/api/application/v2/cases/STE6Q29tbWVyY2lhbERlYWxDbG9zaW5nRnVuZGluZ19fTmV3RGVhbENsb3N1cmVfNjkzYzcwZjAyZjcyMjU0YTNlMjhkM2Qw
Note: Use the ID from the response of Create Case API
Request:
Response: Would be similar to the response of Create Case API but with all the details of the case which can be used for any future reference.
{
"data": {
"caseInfo": {
"caseTypeID": "ExpenseRequest",
"caseTypeName": "Expense Request",
"createTime": "2025-12-19T21:35:04.315Z",
"createdBy": "SystemUser",
"ID": "STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz",
"businessID": "ER-715ABE",
"assignments": [
{
"actions": [
{
"ID": "ReviewExpenseRequest",
"links": {
"submit:Approve": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Approve",
"rel": "self",
"title": "Approve",
"type": "PATCH"
},
"ID": "ReviewExpenseRequest",
"links": {
"submit:Reject": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Reject",
"rel": "self",
"title": "Reject",
"type": "PATCH"
},
"open": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest",
"rel": "self",
"title": "Get assignment action details",
"type": "GET"
}
},
"name": "Manager assigns pre-work",
"type": "FlowAction"
},
{
"ID": "ChangeAssignmentGoalAndDeadline",
"links": {
"open": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ChangeAssignmentGoalAndDeadline",
"rel": "self",
"title": "Get assignment action details",
"type": "GET"
}
}
}
}}]
]
"availableActions": [
{
"ID": "ProvideAdditionalDetails",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/ProvideAdditionalDetails",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Edit",
"type": "Case"
},
{
"ID": "Edit",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/Edit",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Edit",
"type": "Case"
},
{
"ID": "pyChangeStage",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/pyChangeStage",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Change Stage",
"type": "Case"
},
{
"ID": "RestartCurrentStage",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/RestartCurrentStage",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Restart current Stage",
"type": "Case"
},
}
}
}
Response of this API will have the Case ID and more details of the case and also the Assignment Actions and Case Action as AvailableActions.
当外部系统需要向Launchpad发送请求以获取现有案例或数据对象的详情时,可使用此模式。这可用于获取案例或数据对象创建后的详情,或在执行更新前获取其最新详情。
方法:GET
端点:https://<appURL>/dx/api/application/v2/cases/STE6Q29tbWVyY2lhbERlYWxDbG9zaW5nRnVuZGluZ19fTmV3RGVhbENsb3N1cmVfNjkzYzcwZjAyZjcyMjU0YTNlMjhkM2Qw
注意:使用Create Case API响应中的ID
请求:
响应:与Create Case API的响应类似,但包含案例的所有详情,可供后续参考。
{
"data": {
"caseInfo": {
"caseTypeID": "ExpenseRequest",
"caseTypeName": "Expense Request",
"createTime": "2025-12-19T21:35:04.315Z",
"createdBy": "SystemUser",
"ID": "STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz",
"businessID": "ER-715ABE",
"assignments": [
{
"actions": [
{
"ID": "ReviewExpenseRequest",
"links": {
"submit:Approve": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Approve",
"rel": "self",
"title": "Approve",
"type": "PATCH"
},
"ID": "ReviewExpenseRequest",
"links": {
"submit:Reject": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest?outcome=Reject",
"rel": "self",
"title": "Reject",
"type": "PATCH"
},
"open": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ReviewExpenseRequest",
"rel": "self",
"title": "Get assignment action details",
"type": "GET"
}
},
"name": "Manager assigns pre-work",
"type": "FlowAction"
},
{
"ID": "ChangeAssignmentGoalAndDeadline",
"links": {
"open": {
"href": "/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MTIwMTlkMGUzNDg4YjcwNmU5ZQ/actions/ChangeAssignmentGoalAndDeadline",
"rel": "self",
"title": "Get assignment action details",
"type": "GET"
}
}
}
}}]
]
"availableActions": [
{
"ID": "ProvideAdditionalDetails",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/ProvideAdditionalDetails",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Edit",
"type": "Case"
},
{
"ID": "Edit",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/Edit",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Edit",
"type": "Case"
},
{
"ID": "pyChangeStage",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/pyChangeStage",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Change Stage",
"type": "Case"
},
{
"ID": "RestartCurrentStage",
"links": {
"open": {
"href": "/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/RestartCurrentStage",
"rel": "self",
"title": "Get case action details",
"type": "GET"
}
},
"name": "Restart current Stage",
"type": "Case"
},
}
}
}
该API的响应将包含案例ID、案例详情,以及作为AvailableActions的分配操作和案例操作。
Assignment - actions
分配操作
These are the mandatory actions that need to be performed to compleete this task. If a Case has a task that a user has to perform then that will be an assignment action. Outcomes can be the possible outcomes user can take when performing this action. In the Launchpad UI these would have been shown as buttons. In the above example ReviewStep user can either Approve or Reject. So through DXAPI user can decide which action to take and then provide the data as fields which doing the action.
这些是完成任务必须执行的操作。如果案例包含需要用户执行的任务,那就是分配操作。结果是用户执行该操作时可以选择的可能结果。在Launchpad UI中,这些结果会显示为按钮。在上述示例中,ReviewStep(审核步骤)用户可以选择批准或拒绝。因此,通过DX API,用户可以决定执行哪个操作,并在执行操作时传入数据作为字段。
Available Actions:
可用操作
In Launchpad we have the concep of available action at any Stage/Step/Case level actions. These are all optional actions that users can perform on the case. These action when doing are similar to assignment actions but these are not mandatory to complete the task. These actions can be performed at any time of the lifecycle of the case. For example in the above case we have an available action called ProvideAdditionalDetails which can be used to provide any additional details for the case at any point of time in the lifecycle of the case.
Also you can perform these any number of times as long these actions are available. Every Get request return the appropriate actions.
Error: If you donot have access to the case or data object then you will get a 404 error saying that the case or data object is not found. So it is very important to make sure that the Persona provided in the Client Registration has the access to the case or data object that you are trying to get.
In the Resposne Header we will recieve a header called eTag which can be used for any future update on the case. This eTag value is a unique value which is generated for each case and it changes every time there is an update on the case. So whenever we want to perform an update on the case we need to pass this eTag value in the If-Match header of the update request to make sure that we are updating the latest version of the case and there are no concurrent updates happening on the case.
在Launchpad中,我们有在阶段/步骤/案例级别设置可用操作的概念。这些都是用户可以对案例执行的可选操作。执行这些操作的方式与分配操作类似,但它们不是完成任务的必需操作。这些操作可以在案例生命周期的任何时间执行。例如,在上述案例中,我们有一个名为ProvideAdditionalDetails的可用操作,可用于在案例生命周期的任何时间为案例提供额外信息。
只要这些操作可用,你可以多次执行它们。每次GET请求都会返回相应的操作。
错误说明:如果你没有访问案例或数据对象的权限,会收到404错误,提示案例或数据对象未找到。因此,确保Client Registration中指定的Persona拥有访问你要获取的案例或数据对象的权限至关重要。
在响应头中,我们会收到一个名为eTag的头信息,可用于后续对案例执行更新操作。eTag值是为每个案例生成的唯一值,每次案例更新时都会改变。因此,每当我们要对案例执行更新操作时,需要在更新请求的If-Match头中传入该eTag值,以确保我们更新的是案例的最新版本,避免并发更新。
Update an existing Case or data object using DX API
使用DX API更新现有案例或数据对象
Use this pattern when an external system, needs to update an existing case or Data object by sending data to Launchpad.
当外部系统需要向Launchpad发送数据以更新现有案例或数据对象时,可使用此模式。
UseCase1 Perform an Available Action on the Case which has only one outcome
场景1:对案例执行只有一个结果的可用操作
Method: PATCH
Endpoint: https://<appURL>/dx/api/application/v2/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MGYwMmY3MjI1NGEzZTI4ZDNkNA/actions/ProvideAdditionalDetails?outcome=Submit
Note: Use the actions:href from the response of Get Case or Create Case
Request:
Headers:
If-Match: 1 (The value we get in the eTag header of the Get Case response)
Body:
{
"content": {
"ReasonForExpense":"It was mainly to attend a conference in another city and also had to meet some clients there so it was important to travel for this."
}
}
方法:PATCH
端点:https://<appURL>/dx/api/application/v2/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MGYwMmY3MjI1NGEzZTI4ZDNkNA/actions/ProvideAdditionalDetails?outcome=Submit
注意:使用Get Case或Create Case响应中的actions:href
请求:
请求头:
If-Match: 1(Get Case响应中eTag头的值)
请求体:
{
"content": {
"ReasonForExpense":"It was mainly to attend a conference in another city and also had to meet some clients there so it was important to travel for this."
}
}
UseCase2 perfrom Assignment Action on the Case and choose an outcome for the action
场景2:对案例执行分配操作并选择操作结果
Method: PATCH
Endpoint: https://<appURL>/dx/api/application/v2/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MGYwMmY3MjI1NGEzZTI4ZDNkNA/actions/ReviewExpenseRequest?outcome=Accept
Note: Use the actions:href from the response of Get Case or Create Case
Request:
Headers:
If-Match: 1 (The value we get in the eTag header of the Get Case response)
Body:
{
"content": {
"Comments":"It is a valid expense and I am approving it."
}
}
方法:PATCH
端点:https://<appURL>/dx/api/application/v2/assignments/STE6UGVnYVBsYXRmb3JtX19Bc3NpZ25tZW50XzY5M2M3MGYwMmY3MjI1NGEzZTI4ZDNkNA/actions/ReviewExpenseRequest?outcome=Accept
注意:使用Get Case或Create Case响应中的actions:href
请求:
请求头:
If-Match: 1(Get Case响应中eTag头的值)
请求体:
{
"content": {
"Comments":"It is a valid expense and I am approving it."
}
}
UseCase3 perfrom Available Action on the Case
场景3:对案例执行可用操作
Method: PATCH
Endpoint: https://<appURL>/dx/api/application/v2/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/Edit
Note: Use the actions:href from the response of Get Case or Create Case
Request:
Headers:
If-Match: 1 (The value we get in the eTag header of the Get Case response)
Body:
{
"content": {
"ReasonForExpense":"It was mainly to attend a conference in another city and also had to meet some clients there so it was important to travel for this."
}
}
Error: If you donot have access to perform this action on the case or data object then you will get a 404 error saying that you donot have permissions to perform this action.
Error: Any Case/Stage/Step validations defined on the Case will be executed and if the data sent in the update request does not satisfy the validation criteria then you will get a 400 error with the details of the validation error.
方法:PATCH
端点:https://<appURL>/dx/api/application/v2/cases/STE6Sm9iUm90YXRpb25Qcm9ncmFtX19Sb3RhdGlvbkFz/actions/Edit
注意:使用Get Case或Create Case响应中的actions:href
请求:
请求头:
If-Match: 1(Get Case响应中eTag头的值)
请求体:
{
"content": {
"ReasonForExpense":"It was mainly to attend a conference in another city and also had to meet some clients there so it was important to travel for this."
}
}
错误说明:如果你没有对案例或数据对象执行此操作的权限,会收到404错误,提示你没有执行此操作的权限。
错误说明:案例/阶段/步骤中定义的所有验证规则都会被执行,如果更新请求中发送的数据不满足验证条件,会收到400错误,并包含验证错误的详细信息。
Get a List of Objects or any Data using the Data DX API
使用Data DX API获取对象列表或任何数据
This pattern can be used when an external system needs to get a list or even single record case or data objects based on some filter criteria. We may not have the Launchpad generated ID for the case but we know one of the case field and its value then if Launchpad exposes a Data page with this Field as a parameter then it is posisble to retrieve data using this pattern,
Method: POST
Endpoint: https://<appURL>/dx/api/application/v2/data_views/GetTeamExpenseRequests
Note: GetTeamExpenseRequests is the Data page name that is used to get data based on the team name.
Body
{
"dataViewParameters": {
"TeamName": "Team A"
},
"query": {
"select": [
{
"field": "ExpenseRaisedby"
},
{
"field": "CreateDateTime"
},
{
"field": "Team"
},
{
"field": "ReasonsforExpense"
},
{
"field": "TotalAmount"
},
{
"field": "Status"
}
]
}
}
Response:
{
"data": [
{
"@version": 2,
"@class": "ExpenseRequest",
"ExpenseRaisedby": "John Doe",
"CreateDateTime": "2025-12-22T17:02:56.890Z",
"Team": "Team A",
"ReasonsforExpense": "Client meeting travel and meals",
"TotalAmount": 245.75,
"Status": "Pending-Approval",
"ID": "EXP-REQUEST-0001"
}
],
"pageNumber": 1,
"pageSize": 1,
"fetchDateTime": "2026-03-25T21:10:41.299Z",
"totalCount": 27
}
using the above examples when a user asks to generate DXAPIs for their application we can ask them about the use case and based on the use case we can suggest which pattern to use and also generate the sample request and response for that particular use case.
Many time theuse cases might be we want to create a case dfrom out side or perfrom a particular action on the case. so based on the use case you can ask questions about the information you will need to form the request body and also the endpoint to generate the DXAPI request and response.
For example to Create a case we have to ask them to provide the case type, the fields that are marked as Allowed Fields, the values for those fields if they are asking for a specific API otherwise you can generate with the sample data.
You may be asked to generate a Yaml file for all the cases in the launchpad application with the details of which case has which actions and which fields. In that case you can generate a yaml file with all the cases and their details in the format shared above. Also suggest users where they can find the information you need to generate the yaml file in the launchpad application. You can get this information from the following options:
- Allowed Fields from the Casetype rule Setting tab.
- Optional Actions or Available actions from the Case type rule optional actions.
- Assignment actions, from each manual step of the stages and the outcomes that are configred.
- Data page names can be found in the Operations tab of each case type rule.
- For the details of the fields in the request body of Action, you can get that from the views of the actions.
当外部系统需要根据筛选条件获取案例或数据对象的列表甚至单条记录时,可使用此模式。我们可能没有Launchpad生成的案例ID,但知道案例的某个字段及其值,如果Launchpad公开了以该字段为参数的Data page(数据页面),则可以通过此模式检索数据。
方法:POST
端点:https://<appURL>/dx/api/application/v2/data_views/GetTeamExpenseRequests
注意:GetTeamExpenseRequests是用于根据团队名称获取数据的数据页面名称。
请求体
{
"dataViewParameters": {
"TeamName": "Team A"
},
"query": {
"select": [
{
"field": "ExpenseRaisedby"
},
{
"field": "CreateDateTime"
},
{
"field": "Team"
},
{
"field": "ReasonsforExpense"
},
{
"field": "TotalAmount"
},
{
"field": "Status"
}
]
}
}
响应:
{
"data": [
{
"@version": 2,
"@class": "ExpenseRequest",
"ExpenseRaisedby": "John Doe",
"CreateDateTime": "2025-12-22T17:02:56.890Z",
"Team": "Team A",
"ReasonsforExpense": "Client meeting travel and meals",
"TotalAmount": 245.75,
"Status": "Pending-Approval",
"ID": "EXP-REQUEST-0001"
}
],
"pageNumber": 1,
"pageSize": 1,
"fetchDateTime": "2026-03-25T21:10:41.299Z",
"totalCount": 27
}
通过上述示例,当用户要求为其应用程序生成DX API时,我们可以询问他们的使用场景,并根据场景建议使用哪种模式,同时生成该场景的示例请求和响应。
很多时候,使用场景可能是从外部创建案例或对案例执行特定操作。因此,根据场景,你可以询问构建请求体和端点所需的信息,以生成DX API的请求和响应。
例如,要创建案例,我们需要用户提供案例类型、标记为Allowed Fields的字段,如果用户需要特定的API,还需要提供这些字段的值,否则可以使用示例数据生成。
你可能会被要求为Launchpad应用程序中的所有案例生成Yaml文件,包含每个案例有哪些操作和字段的详细信息。在这种情况下,你可以按照上述格式生成包含所有案例及其详情的yaml文件。同时,建议用户在Launchpad应用程序中何处可以找到生成yaml文件所需的信息。你可以从以下选项获取这些信息:
- 案例类型规则设置标签中的Allowed Fields。
- 案例类型规则可选操作中的Optional Actions(可选操作)或Available actions(可用操作)。
- 每个阶段手动步骤中的Assignment actions(分配操作)以及配置的结果。
- 数据页面名称可在每个案例类型规则的操作标签中找到。
- 操作请求体中字段的详情,可从操作的视图中获取。