Anchor |
---|
Top | Top | Approval Scheduled Tasks can be accessed through this API using GET. This API can also
approve run and
reject approval cancel scheduled tasks based on task id and other parameters.
...
...
title | Base URL for Approval Tasks REST API |
---|
...
http://host:port/flexdeploy/rest/tasks/approval
| REST V1 Authentication |
---|
| REST V1 Authentication |
---|
|
Each function returns a JSON approval task object. The approval task object has these attributes:
...
Each approval task can be one of three different types: Release, Application, and Project.
Release Approval Task
...
Application Approval Task
...
The pipeline stage execution Id of the release approval task.
Project Approval Task
...
Back to Top
GET
GET by TaskId
This GET service will find an approval task with the given task Id and return the JSON representation of the object.
Parameters
...
Parameter
...
Type
...
Required
...
Description
...
Id
...
Example
If we had an application in our database with an Id of 10000 and had the following attributes
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task - 10000 |
---|
|
{
"projectName": "Project 1",
"projectVersionName": "1.0.21",
"workflowRequestId": 11701,
"projectId": 10002,
"taskId": 10000,
"status": "PENDING",
"environmentId": 16109,
"flexFields": [],
"requestType": "Project",
"requestorPath": "FlexDeploy / Application 1"
} |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/tasks/approval/10000
The GET request would return the following JSON approval task object
...
theme | Eclipse |
---|
title | Approval Task - 10000 |
---|
...
GET
GET by TaskId
This GET service will find a scheduled task with the given task Id and return the JSON representation of the object.
Request
Parameter | Type | Required | Description |
---|
Id | URL | Yes | This is a URL parameter for the Id which is used to find and return a scheduled task. |
Include Page |
---|
| REST V1 Scheduled Task Response |
---|
| REST V1 Scheduled Task Response |
---|
|
Response Codes
HTTP Code | Description |
---|
200 | Task was found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with an Id of 10000 and the following attributes
Code Block |
---|
theme | Eclipse |
---|
title | Scheduled Task - 10000 |
---|
|
{
"projectVersionName": "1.0.11",
"projectName": "Scheduled Tasks Project",
"workflowRequestId": 656423,
"projectId": 576267,
"scheduledDate": "2099-03-16 22:17:52.0",
"taskId": 14332,
"requestType": "Project",
"flexFields": [],
"environmentId": 77954,
"status": "PENDING",
"notes": null
} |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/scheduled/10000
The GET request would return the following JSON scheduled task object
Code Block |
---|
theme | Eclipse |
---|
title | Scheduled Task - 10000 |
---|
|
{
"projectVersionName": "1.0.11",
"projectName": "Scheduled Tasks Project 1",
"projectVersionNameworkflowRequestId": "1.0.21"656423,
"workflowRequestIdprojectId": 11701576267,
"projectIdscheduledDate": 10002"2099-03-16 22:17:52.0",
"taskId": 1000014332,
"statusrequestType": "PENDINGProject",
"environmentIdflexFields": 16109[],
"flexFieldsenvironmentId": []77954,
"requestTypestatus": "ProjectPENDING",
"requestorPathnotes": "FlexDeploy / Application 1"null
} |
Back to Top
GET (Using Query Parameters)
This GET service will return a list of approval scheduled tasks in the form of JSON objects based on a query parameter for the display name. Approval Scheduled tasks are only returned if they contain the specified parameter. If no query parameters are given this request will return the entire list of approval scheduled tasks.
Info |
---|
|
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled? Append the following character sequences to the above URL to specify Query parameters.workflowrequestid workflowRequestId = {workflowRequestId} foldererquestid folderRequestId = {folderRequestId} pipelinestageexecid pipelineStageGateExecId = {pipelineStageExecIdpipelineStageGateExecId} projectid pipelineStageStepExecId = {projectIdpipelineStageStepExecId} applicationid projectId = {applicationIdprojectId} environmentid applicationId = {environmentIdapplicationId} externalId environmentId = {externalIdenvironmentId} externalSystemType notes = {externalSystemType}externalSystemId = {externalSystemIdnotes} Examples:To return all of the approval scheduled tasks:http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled To search by project Id only:http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled?projectid=11001 |
Tip |
---|
The query parameters are not case sensitive. Searching by name=EXAMPLE is the same as searching by name=example. |
...
Request
Parameter | Type | Required | Description |
---|
workflowrequestidURLQuery - Long | No | This is a URL query parameter for the workflow request Id which is used to search the |
approval foldererquestidURLQuery - Long | No | This is a URL query parameter for the folder request Id which is used to search the |
approval pipelinestageexecidURLQuery - Long | No | This is a URL query parameter for the pipeline stage gate execution Id which is used to search the |
approval projectidURLQuery - Long | No | This is a URL query parameter for the |
project pipeline stage step execution Id which is used to search the |
approval applicationidURLQuery - Long | No | This is a URL query parameter for the |
application project Id which is used to search the |
approval environmentidURLQuery - Long | No | This is a URL query parameter for the |
environment application Id which is used to search the |
approval externalIdURLQuery - Long | No | This is a URL query |
paramter external environment Id which is used to search the |
approval externalSystemTypeURLQuery - String | No | This is a URL query parameter for |
the external system type which is used to search the approval tasks.externalSystemId | URL | No | This is a URL query parameter for the external system Id which is used to seach the approval tasks.notes added to the task when running or canceling it. Equals type search. |
Include Page |
---|
| REST V1 Scheduled Task Response |
---|
| REST V1 Scheduled Task Response |
---|
|
Response Codes
HTTP Code | Description |
---|
200 | Search successful and results returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If we had an approval a scheduled task in our database with the following attributes
Code Block |
---|
theme | Eclipse |
---|
title | Approval scheduled Task |
---|
|
[
{
"projectNameprojectVersionName": "Project "1.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 10002,
"taskIdscheduledDate": 11702"2099-03-16 22:17:52.0",
"statustaskId": "PENDING"14332,
"environmentIdrequestType": 16109"Project",
"flexFields": [],
"requestTypeenvironmentId": "Project"77954,
"requestorPathstatus": "PENDING"FlexDeploy,
/ Application 1""notes": null
}
] |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled?projectid=10002
The GET request would return the following JSON approval scheduled task object
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
[
{
"projectNameprojectVersionName": "Project 1.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 10002,
"scheduledDate": "2099-03-16 22:17:52.0",
"taskId": 1170214332,
"statusrequestType": "PENDINGProject",
"environmentIdflexFields": 16109[],
"flexFieldsenvironmentId": []77954,
"requestTypestatus": "ProjectPENDING",
"requestorPathnotes": "FlexDeploy / Application 1"
}
] |
Back to Top
Approve By TaskId
This PUT service will approve an approval task with the given Id.
Parameters
...
Example
...
Run Now By TaskId
This PUT service will run a scheduled task with the given Id.
Request
Attributes | Type | Required | Description |
---|
Id | Long | Yes | The Id of the scheduled task you wish to run |
notes | String | No | This is a URL query parameter to add notes to the task when running it. |
Include Page |
---|
| REST V1 Scheduled Task Response |
---|
| REST V1 Scheduled Task Response |
---|
|
Response Codes
HTTP Code | Description |
---|
200 | Task was found and schedule set to run immediately |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with the following attributes
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectNameprojectVersionName": "Project 1.0.11",
"projectName"projectVersionName": "1.0.21": "Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 10002576267,
"taskIdscheduledDate": 11702 "2099-03-16 22:17:52.0",
"statustaskId": "PENDING"14332,
"environmentIdrequestType": 16109"Project",
"flexFields": [],
"requestTypeenvironmentId": "Project"77954,
"requestorPathstatus": "FlexDeployPENDING",
/ Application 1"notes": null
} |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled/approve/11702runnow/14332?notes=Approved+by+George
The PUT request would approve run the approval scheduled task and return the following JSON approval scheduled task object
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectNameprojectVersionName": "Project 1.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 576267,
"projectId": 10002 "scheduledDate": "2099-03-16 22:17:52.0",
"taskId": 1170214332,
"statusrequestType": "APPROVEDProject",
"environmentIdflexFields": 16109[],
"flexFieldsenvironmentId": []77954,
"requestTypestatus": "ProjectAPPROVED",
"requestorPathnotes": "FlexDeployApproved /by Application 1George"
} |
Back to Top
...
Run Now using Query Parameters
This PUT service will approve an approval run a scheduled task with the given attributes.
Info |
---|
|
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled/approverunnow? Append the following character sequences to the above URL to specify Query parameters.workflowrequestid workflowRequestId = {workflowRequestId} folderRequestId = {folderRequestId}foldererquestid pipelineStageGateExecId = {folderRequestIdpipelineStageGateExecId} pipelinestageexecid pipelineStageStepExecId = {pipelineStageExecIdpipelineStageStepExecId} projectid projectId = {projectId} applicationid applicationId = {applicationId} environmentid environmentId = {environmentId} externalId = {externalId} externalSystemType =notes = {externalSystemTypenotes} |
Info |
---|
|
Only one approval scheduled task can be approved run at a time. If more than one task matches the query parameters an exception will be thrown. |
...
Request
Parameter | Type | Required | Description |
---|
workflowrequestidworkflowRequestId | URL | No | This is a URL query parameter for the workflow request Id which is used to search the |
approval foldererquestidfolderRequestId | URL | No | This is a URL query parameter for the folder |
request request Id which is used to search the scheduled tasks. |
pipelineStageGateExecId | URL | No | This is a URL query parameter for the pipeline stage gate execution Id which is used to search the |
approval pipelinestageexecidpipelineStageStepExecId | URL | No | This is a URL query parameter for the pipeline stage step execution Id which is used to search the |
approval projectidprojectId | URL | No | This is a URL query parameter for the project Id which is used to search the |
approval applicationidapplicationId | URL | No | This is a URL query parameter for the application Id which is used to search the |
approval environmentidenvironmentId | URL | No | This is a URL query parameter for the environment Id which is used to search |
the approval tasks.externalId | URL | No | This is a URL query parameter for the external Id which is used to search the approval tasks. |
externalSystemType | URL | No | This is a URL query parameter for the external Id which is used to search the approval tasks. |
externalSystemId | URL | No | This is a URL query parameter for the external Id which is used to search the approval tasks.the scheduled tasks. |
notes | URL | No | This is a URL query parameter to add notes to the task when running it. |
Include Page |
---|
| REST V1 Scheduled Task Response |
---|
| REST V1 Scheduled Task Response |
---|
|
Response Codes
HTTP Code | Description |
---|
200 | Task was found and schedule set to run immediately |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had
...
a scheduled task in our database with the following attributes
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectNameprojectVersionName": "Project 1.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 656423,
"projectId": 1170110002,
"projectIdscheduledDate": 10002"2099-03-16 22:17:52.0",
"taskId": 1170214332,
"statusrequestType": "PENDINGProject",
"environmentIdflexFields": 16109[],
"flexFieldsenvironmentId": []77954,
"requestTypestatus": "ProjectPENDING",
"requestorPathnotes": "FlexDeploy / Application 1"
null
} |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled/approverunnow?projectid=10002¬es=Approved+by+George
The PUT request would approve run the approval scheduled task and return the following JSON approval scheduled task object
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectNameprojectVersionName": "Project 1.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 10002,
"scheduledDate": "2099-03-16 22:17:52.0",
"taskId": 1170214332,
"requestType": "Project",
"statusflexFields": "APPROVED"[],
"environmentId": 1610977954,
"flexFieldsstatus": []"APPROVED",
"requestTypenotes": "Project",Approved by "requestorPath": "FlexDeploy / Application 1"
} |
Back to Top
Reject By TaskId
This PUT service will reject an approval task with the given Id.
Parameters
...
Example
...
Cancel By TaskId
This PUT service will reject a scheduled task with the given Id.
Request
Attributes | Type | Required | Description |
---|
Id | Long | Yes | The Id of the scheduled task you wish to cancel |
notes | String | No | This is a URL query parameter to add notes to the task when canceling it. |
Include Page |
---|
| REST V1 Scheduled Task Response |
---|
| REST V1 Scheduled Task Response |
---|
|
Response Codes
HTTP Code | Description |
---|
200 | Task was found and cancelled |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had a scheduled task in our database with the following attributes
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectNameprojectVersionName": "Project 11.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 10002,
"taskIdscheduledDate": 11702"2099-03-16 22:17:52.0",
"statustaskId": "PENDING"14332,
"environmentIdrequestType": 16109"Project",
"flexFields": [],
"requestTypeenvironmentId": "Project"77954,
"requestorPathstatus": "PENDING"FlexDeploy,
/ Application 1""notes": null
} |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled/reject/11702cancel/14332?notes=
The PUT request would reject cancel the approval scheduled task and return the following JSON approval scheduled task object
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectNameprojectVersionName": "Project 1.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 10002,
"projectId": 10002 "scheduledDate": "2099-03-16 22:17:52.0",
"taskId": 1170214332,
"statusrequestType": "REJECTEDProject",
"environmentIdflexFields": 16109[],
"flexFieldsenvironmentId": []77954,
"requestTypestatus": "ProjectREJECTED",
"requestorPathnotes": "FlexDeploy / Application 1"
} |
Back to Top
...
Cancel using Query Parameters
This PUT service will approve an approval cancel a scheduled task with the given attributes.
Info |
---|
|
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled/rejectcancel? Append the following character sequences to the above URL to specify Query parameters.workflowrequestid = {workflowRequestId} foldererquestid workflowRequestId = {workflowRequestId} folderRequestId = {folderRequestId} pipelineStageGateExecId = {folderRequestIdpipelineStageGateExecId} pipelinestageexecid pipelineStageStepExecId = {pipelineStageExecIdpipelineStageStepExecId} projectid projectId = {projectId} applicationid applicationId = {applicationId} environmentid environmentId = {environmentId} notes = {notes} |
Info |
---|
|
Only one approval scheduled task can be rejected canceled at a time. If more than one task matches the query parameters an exception will be thrown. |
...
Request
Parameter | Type | Required | Description |
---|
workflowrequestidworkflowRequestId | URL | No | This is a URL query parameter for the workflow request Id which is used to search the |
approval scheduled tasks. |
folderRequestId | URL | No | This is a URL query parameter for the folder request Id which is used to search the scheduled tasks. |
foldererquestidpipelineStageGateExecId | URL | No | This is a URL query parameter for |
the folder request the pipeline stage gate execution Id which is used to search the |
approval pipelinestageexecidpipelineStageStepExecId | URL | No | This is a URL query parameter for the pipeline stage step execution Id which is used to search the |
approval projectidprojectId | URL | No | This is a URL query parameter for the project Id which is used to search the |
approval applicationidapplicationId | URL | No | This is a URL query parameter for the application Id which is used to search the |
approval environmentidenvironmentId | URL | No | This is a URL query parameter for the environment Id which is used to search the |
approval externalIdURL URL | No | This is a URL query parameter |
for the external Id which is used to search the approval tasks.externalSystemType | URL | No | This is a URL query paramater for the external Id which is used to search the approval tasks. |
externalSystemId | URL | No | This is a URL query parameter for the external Id which is used to search the approval tasks.to add notes to the task when canceling it. |
Include Page |
---|
| REST V1 Scheduled Task Response |
---|
| REST V1 Scheduled Task Response |
---|
|
Response Codes
HTTP Code | Description |
---|
200 | Task was found and cancelled |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Task not found |
500 | Unexpected internal server error |
Example
If we had
...
a scheduled task in our database with the following attributes
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectNameprojectVersionName": "Project 1.0.11",
"projectVersionNameprojectName": "1.0.21Scheduled Tasks Project",
"workflowRequestId": 11701656423,
"projectId": 10002,
"taskIdscheduledDate": 11702"2099-03-16 22:17:52.0",
"statustaskId": "PENDING"14332,
"environmentIdrequestType": 16109"Project",
"flexFields": [],
"requestTypeenvironmentId": "Project"77954,
"requestorPathstatus": "PENDING"FlexDeploy,
/ Application 1"notes": null
} |
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/tasks/approvalscheduled/rejectcancel?projectid=10002¬es=Approved+by+George
The PUT request would reject cancel the approval scheduled task and return the following JSON approval scheduled task object
Code Block |
---|
theme | Eclipse |
---|
title | Approval Task |
---|
|
{
"projectVersionName": "1.0.11",
"projectName": "Scheduled Tasks Project 1",
"projectVersionNameworkflowRequestId": "1.0.21"656423,
"workflowRequestIdprojectId": 1170110002,
"projectIdscheduledDate": 10002"2099-03-16 22:17:52.0",
"taskId": 1170214332,
"statusrequestType": "REJECTEDProject",
"environmentIdflexFields": 16109[],
"flexFieldsenvironmentId": []77954,
"requestTypestatus": "ProjectREJECTED",
"requestorPathnotes": "FlexDeployApproved /by Application 1George"
} |
...