Search This Blog

Breaking

Monday, 30 August 2021

[ WorkFront ] Workfront API for Task creation, status change, upload document, folder create, project create/conversion

 In my last project, I worked on a SAAS tool "Workfront". Workfront provides a software-as-a-service platform for enterprise workflow management, project and portfolio management, resource management and individual task management. Workfront's platform automates and repeatable processes and allows users to manage financial information and create reports.

When I got an opportunity to automate our customized Workfront application, I learned a lot about Workfront API's. This article is about my learning of those API's (Which I could not find easily in internet).

If you are also in such a situation, then the first step to start understanding Workfront API's are Workfront API documentation page. Here, you will get a lot of information about Workfront objects and their API details.



So When I started working on it, I started with one of my Workflow. Let me describe my workflow a bit:

1: Create a request (Task)

2. Validate all field presence in request

3: Change it's assignment and add a user 

4: Change its status

5. Convert it to a project 

6. Validate project having the same data which we submitted at the time of request creation

7. Validate that the converted project is having the same task list which is already defined for this task template

8. Add document to project

9. Mark all the task as complete in Workfront

So to perform this workflow, I picked Workfront API's. To work on Workfront API, first I created an appKey. Take help from your team who manages Workfront accesses.


Between, below is the point for creating/getting the appkey:

1. Create an appkey for new user:

Method: Put

Path: /attask/api/v9.0/user

Params: action: generateApiKey

Param: username: username

Param: password: password

Param: method:put

2. Get an alredy created appkey for a user:

Method: Put

Path: /attask/api/v9.0/user

Params: action: getApiKey

Param: username: username

Param: password: password

Param: method:put


Once you will have the appkey, for creating a request, you can use /OPTASK endpoint.

1. Create Request/Task End Point

Method: Post

Path: /attask/api/v9.0/

Params: appKey

Body: Request Body

2. Validate all field presence in request:

Method: Get

Path: /attask/api/v9.0/

Params: appKey : appkey value

Params: ID : requestID

Params: fields : *

3Change it's assignment and add a use

Method: Put

Path: /attask/api/v9.0/

Params: appKey : appkey value

Params: ID : requestID

Body: Request body containing userid

4. Change its status

 Method: Put

Path: /attask/api/v9.0/

Params: appKey : appkey value

Params: ID : requestID

Params: status: RPC (Ready for project conversion)

5. Validate Project Creation:

 Method: Get

Path: /attask/api/v9.0/project/search

Params: appKey : appkey value

Params: name : requestname

fields: *

6. Get all task for a project:

 Method: Get

Path: /attask/api/v9.0/task/search

Params: appKey : appkey value

Params: projectID: projectID

7. Get all task from a template:

 Method: Get

Path: /attask/api/v9.0/templateTask/search

Params: appKey : appkey value

Params: templateID: templateIDValue

8. Create a folder: (Later add document to it):

 Method: Post

Path: /attask/api/v9.0/docfdr

Params: appKey : appkey value

Params: name: docFolderName

Params: userID: userIDValue

9. Add document to folder

 Method: Post

Path: /attask/api/v9.0/document

Params: appKey : appkey value

Body: Request body containing file information

10. Mark all the task as complete in Workfront

 Method: Get

Path: /attask/api/v9.0/task/

Params: appKey : appkey value

Params: projectID: projectIDValue

Param: name: projectName

Param: taskNumber: taskNumberValue

Param: percentComplete:percentCompleteValue


While Doing this activity, I explored many other Workfront end points also. This I will update in some time.



No comments:

Post a Comment