Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

AnchorTopTopApproval 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.

...

Include Page

...

titleBase URL for Approval Tasks REST API

...

http://host:port/flexdeploy/rest/tasks/approval

REST V1 Authentication
REST V1 Authentication

Table of Contents
maxLevel2

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. 

Info
titleAPI URL

http://host:port/flexdeploy/rest/tasks/approval/{Id}

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
themeEclipse
titleApproval 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

...

themeEclipse
titleApproval 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. 

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/tasks/scheduled/{Id}

Request

Parameter

Type

Required

Description

Id

URLYesThis 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 CodeDescription
200Task was found and returned
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Task not found
500Unexpected internal server error

Example

If we had a scheduled task in our database with an Id of 10000 and the following attributes

Code Block
themeEclipse
titleScheduled 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
themeEclipse
titleScheduled 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
titleAPI URLs

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

workflowrequestid
workflowRequestId
URL
Query - LongNoThis is a URL query parameter for the workflow request Id which is used to search the
approval
scheduled tasks.
foldererquestid
folderRequestId
URL
Query - LongNoThis is a URL query parameter for the folder request Id which is used to search the
approval
scheduled tasks.
pipelinestageexecid
pipelineStageGateExecId
URL
Query - LongNoThis is a URL query parameter for the pipeline stage gate execution Id which is used to search the
approval
scheduled tasks.
projectid
pipelineStageStepExecId
URL
Query - LongNoThis is a URL query parameter for the
project
pipeline stage step execution Id which is used to search the
approval
scheduled tasks.
applicationid
projectId
URL
Query - LongNoThis is a URL query parameter for the
application
project Id which is used to search the
approval
scheduled tasks.
environmentid
applicationId
URL
Query - LongNoThis is a URL query parameter for the
environment
application Id which is used to search the
approval
scheduled tasks.
externalId
environmentId
URL
Query - LongNoThis is a URL query
paramter
parameter for the
external
environment Id which is used to search the
approval
scheduled tasks.
externalSystemType
notes
URL
Query - StringNo

This is a URL query parameter for

the external system type which is used to search the approval tasks.externalSystemIdURLNo 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 CodeDescription
200Search successful and results returned
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
500Unexpected internal server error

Example

If we had an approval a scheduled task in our database with the following attributes

Code Block
themeEclipse
titleApproval 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
themeEclipse
titleApproval 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.

Info
titleAPI URL

http://host:port/flexdeploy/rest/tasks/approval/approve/{Id}

Parameters

...

Example

...

null
}

Run Now By TaskId

This PUT service will run a scheduled task with the given Id.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/tasks/scheduled/runnow/{Id}

Request

AttributesTypeRequiredDescription
IdLongYesThe Id of the scheduled task you wish to run
notesStringNoThis 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 CodeDescription
200Task was found and schedule set to run immediately
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Task not found
500Unexpected internal server error

Example

If we had a scheduled task in our database with the following attributes

Code Block
themeEclipse
titleApproval 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
themeEclipse
titleApproval 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
titleAPI URLs

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
titleReturned Tasks

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

workflowrequestid
workflowRequestIdURLNoThis is a URL query parameter for the workflow request Id which is used to search the
approval
scheduled tasks.
foldererquestid
folderRequestIdURLNoThis is a URL query parameter for the folder
request
request Id which is used to search the scheduled tasks.
pipelineStageGateExecIdURLNoThis is a URL query parameter for the pipeline stage gate execution Id which is used to search the
approval
scheduled tasks.
pipelinestageexecid
pipelineStageStepExecIdURLNoThis is a URL query parameter for the pipeline stage step execution Id which is used to search the
approval
scheduled tasks.
projectid
projectIdURLNoThis is a URL query parameter for the project Id which is used to search the
approval
scheduled tasks.
applicationid
applicationIdURLNoThis is a URL query parameter for the application Id which is used to search the
approval
scheduled tasks.
environmentid
environmentIdURLNoThis is a URL query parameter for the environment Id which is used to search
the approval tasks.externalId URLNoThis is a URL query parameter for the external Id which is used to search the approval tasks.externalSystemTypeURLNoThis is a URL query parameter for the external Id which is used to search the approval tasks.externalSystemId URLNoThis is a URL query parameter for the external Id which is used to search the approval tasks.
the scheduled tasks.
notesURLNoThis 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 CodeDescription
200Task was found and schedule set to run immediately
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Task not found
500Unexpected internal server error

Example

If we had

...

a scheduled task in our database with the following attributes

Code Block
themeEclipse
titleApproval 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&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
themeEclipse
titleApproval 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.

Info
titleAPI URL

http://host:port/flexdeploy/rest/tasks/approval/reject/{Id}

Parameters

...

Example

...

George"
}

Cancel By TaskId

This PUT service will reject a scheduled task with the given Id.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/tasks/scheduled/cancel/{Id}

Request

AttributesTypeRequiredDescription
IdLongYesThe Id of the scheduled task you wish to cancel
notesStringNoThis 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 CodeDescription
200Task was found and cancelled
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Task not found
500Unexpected internal server error

Example

If we had a scheduled task in our database with the following attributes

Code Block
themeEclipse
titleApproval 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
themeEclipse
titleApproval 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

...

null
}

Cancel using Query Parameters

This PUT service will approve an approval cancel a scheduled task with the given attributes.

Info
titleAPI URLs

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
titleReturned Tasks

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

workflowrequestid
workflowRequestIdURLNoThis is a URL query parameter for the workflow request Id which is used to search the
approval
scheduled tasks.
folderRequestIdURLNoThis is a URL query parameter for the folder request Id which is used to search the scheduled tasks.
foldererquestid
pipelineStageGateExecIdURLNoThis is a URL query parameter for
the folder request
the pipeline stage gate execution Id which is used to search the
approval
scheduled tasks.
pipelinestageexecid
pipelineStageStepExecIdURLNoThis is a URL query parameter for the pipeline stage step execution Id which is used to search the
approval
scheduled tasks.
projectid
projectIdURLNoThis is a URL query parameter for the project Id which is used to search the
approval
scheduled tasks.
applicationid
applicationIdURLNoThis is a URL query parameter for the application Id which is used to search the
approval
scheduled tasks.
environmentid
environmentIdURLNoThis is a URL query parameter for the environment Id which is used to search the
approval
scheduled tasks.
externalId
notes
URL 
URLNoThis is a URL query parameter
for the external Id which is used to search the approval tasks.externalSystemTypeURLNoThis is a URL query paramater for the external Id which is used to search the approval tasks.externalSystemIdURL NoThis 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 CodeDescription
200Task was found and cancelled
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Task not found
500Unexpected internal server error

Example

If we had

...

a scheduled task in our database with the following attributes

Code Block
themeEclipse
titleApproval 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&notes=Approved+by+George

The PUT request would reject cancel the approval scheduled task and return the following JSON approval scheduled task object

Code Block
themeEclipse
titleApproval 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"
}

...