CFLOW API key setup

1. Log in to your CFLOW account and click security settings from admin tab.

integration-menu-screen

2. Click API Settings tab, then click generate new api key button to create a new api key.

integration-menu-screen

3. Thats it! Your API key would be generated as shown.

integration-menu-screen

Web API Calls

1. List workflows

Lists all active workflows that are accessible for this user

Input

curl -H “apikey:API-KEY-PASTE-HERE” -H “Content-Type: application/json” -X POST -d ‘{“Username”:”steve”}’

Output

{
“Key Metrics”: [
{
“Total Users”: “63”,
“Active Workflows”: “50”,
“Total Requests”: “69”,
“Pending Requests”: “58”
}
],
“Workflows”: [
{
“Workflow”: “Job Scheduler Process”,
“Process Stage”: “Job Schedule”,
“Total Requests”: “1”,
“Pending Requests”: “0”
},
{
“Workflow”: “Purchase Request”,
“Process Stage”: “Purchase Request”,
“Total Requests”: “0”,
“Pending Requests”: “0”
}
] }

2. List fields

Lists the fields in a workflow stage along with the field properties

Input

curl -H “apikey:API-KEY-PASTE-HERE” -H “Content-Type: application/json” -X POST -d ‘{“Username”:”steve”,”WorkflowName”:”Leave Process”,”StageName”:”Leave Form”}’ https://cflow.cavintek.com/webapi/api/1/fields/

Output

{
“Section Fields”: [{
“Display Name”: “Employee No”,
“Field Type”: “TextBox”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “String”,
“Is Mandatory”: “No”,
“Is Enable”: “No”,
“Max Length”: “100”,
“Unique”: “No”
}, {
“Display Name”: “Employee Name”,
“Field Type”: “TextBox”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “String”,
“Is Mandatory”: “Yes”,
“Is Enable”: “No”,
“Max Length”: “100”,
“Unique”: “No”
}, {
“Display Name”: “Submitted Date”,
“Field Type”: “TextBox”,
“Valid Values”: “”,
“Default Values”: “12/02/2016”,
“Data Type”: “Date”,
“Is Mandatory”: “No”,
“Is Enable”: “No”,
“Max Length”: “10”,
“Unique”: “No”
}, {
“Display Name”: “Leave Type”,
“Field Type”: “DropDownList”,
“Valid Values”: “Casual,Privilege,Sick”,
“Default Values”: “”,
“Data Type”: “String”,
“Is Mandatory”: “Yes”,
“Is Enable”: “No”,
“Max Length”: “100”,
“Unique”: “No”
}, {
“Display Name”: “From Date”,
“Field Type”: “TextBox”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “Date”,
“Is Mandatory”: “No”,
“Is Enable”: “No”,
“Max Length”: “10”,
“Unique”: “No”
}, {
“Display Name”: “To Date”,
“Field Type”: “TextBox”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “Date”,
“Is Mandatory”: “No”,
“Is Enable”: “No”,
“Max Length”: “10”,
“Unique”: “No”
}, {
“Display Name”: “Manager Notes”,
“Field Type”: “TextBoxMultiLine”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “String”,
“Is Mandatory”: “No”,
“Is Enable”: “Yes”,
“Max Length”: “4000”,
“Unique”: “No”
}],
“Tables”: [{
“Table Name”: “Contact Info”
}],
“Contact Info”: [{
“Display Name”: “Day”,
“Field Type”: “TextBox”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “String”,
“Is Mandatory”: “No”,
“Is Enable”: “No”,
“Max Length”: “100”,
“Unique”: “No”
}, {
“Display Name”: “Contact Time”,
“Field Type”: “TextBox”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “String”,
“Is Mandatory”: “No”,
“Is Enable”: “No”,
“Max Length”: “100”,
“Unique”: “No”
}],
“Large Fields”: [{
“Display Name”: “Reason”,
“Field Type”: “LargeTextBox”,
“Valid Values”: “”,
“Default Values”: “”,
“Data Type”: “String”,
“Is Mandatory”: “No”,
“Is Enable”: “No”,
“Max Length”: “4000”,
“Unique”: “No”
}],
“Date Format”: [{
“Date Format”: “mm/dd/yyyy”
}] }

3. List pending requests details

Lists the requests pending for this user

Input

curl -H “apikey:API-KEY-PASTE-HERE” -H “Content-Type: application/json” -X POST -d ‘{“Username”:”steve”}’ https://cflow.cavintek.com/webapi/api/1/pendingrequests/

Output


[
{
“Workflow”: “All In One”,
“Process Stage”: “All in One”,
“Record Id”: “117”,
“Time Taken To Approve”: “2 months ago”
},
{
“Workflow”: “Boutique Orders”,
“Process Stage”: “Payment Delivery”,
“Record Id”: “2”,
“Time Taken To Approve”: “3 months ago”
}
]

4. View Request Details

Get the field values for the specified request that is currently in this stage

Input

curl -H “apikey:API-KEY-PASTE-HERE” -H “Content-Type: application/json” -X POST -d ‘{“Username”:”steve”,”WorkflowName”:”Leave Process”,”StageName”:”Leave Form”,”RecordId”:”20″}’

Output

{
“Section Values”: [{
“ID”: 20,
“Employee No”: “C006”,
“Employee Name”: “Steve”,
“Submitted Date”: “12/01/2016”,
“Leave Type”: “Casual”,
“From Date”: “10/11/2016”,
“To Date”: “11/11/2016”,
“Manager Notes”: “Lv1”
}],
“Large Field Values”: [{
“ID”: 20,
“Reason”: “reas1”
}],
“Contact Info Values”: [],
“Approval Values”: [{
“Manager Approval Approved By”: “steve”,
“Manager Approval Approved Date”: “Dec 1 2016 6:18PM”,
“Manager Approval Status”: “Approved”,
“Manager Approval Comments”: “”,
“HR Approval Approved By”: “steve”,
“HR Approval Approved Date”: “Dec 1 2016 8:22PM”,
“HR Approval Status”: “Approved”,
“HR Approval Comments”: “”,
“END Approved By”: “”,
“END Approved Date”: “”
}],
“Comments”: [],
“Files”: [] }

5. Initiate New Request

Initiate a new request in this workflow

Input

curl -H “apikey:API-KEY-PASTE-HERE” -H “Content-Type: application/json” -X POST -d ‘{“Username”:”steve”,”WorkflowName”:”Leave Process”,”StageName”:”Leave Form”,”Values”:”C006,Steve,11/12/2016,Casual,11/12/2016,11/14/2016,-,Vacation to Goa,tbls=Contact Info=Day 1,After 5PM,Day2,After 7PM”,”isDraft”:”0″}’ https://cflow.cavintek.com/webapi/api/1/submit/
curl -H “apikey:API-KEY-PASTE-HERE” -H “Content-Type: application/json” -X POST -d ‘{“Username”:”steve”,”WorkflowName”:”Leave Process”,”StageName”:”Leave Form”,”Values”:”Employee No=C006,Employee Name=Steve,Leave Type=Casual,From Date=11/12/2016,To Date=11/14/2016,Reason=Vacation to Goa,tbls=Contact Info=Day 1,After 5PM,Day2,After 7PM”,”isDraft”:”0″}’ https://cflow.cavintek.com/webapi/api/1/submit/

Output

A new request with ID # 27 has been created successfully.

7. Approve Existing Request

Approve or Reject an existing request waiting for this user’s review

Input

curl -H “apikey:API-KEY-PASTE-HERE” -H “Content-Type: application/json” -X POST -d ‘{“Username”:”steve”,”WorkflowName”:”Leave Process”,”StageName”:”Manager Approval”,”RecordId”:”24″,”Status”:”Approved”,”Comment”:”Happy Journey Steve.”}’ https://cflow.cavintek.com/webapi/api/1/approve/

Output

ID:6