Pipelineapp.io, an Innovative Way solution.
Learn more @ www.pipelineapp.io


Common use-cases

Nov 25, 2022

Examples in Postman

Looking for examples? Want to test the API?

View our collection of the common use-cases in Postman!

View the Postman Collection »

The following are the top common use-cases for the Pipeline API along sample GraphQL queries, mutations, and JSON responses.

Build out these common use-cases, and you'll have a great foundation for your integration.

Searching and filtering for Asks

Note, in the API, a request is the same as an Ask and a process is the same as a Flow.

The most common use-case is searching and filtering for Asks, and for this use-case, use the  getRequestsSearch query. The filter arguments are:

  • searchTerm keyword, phrase (in quotes, ex: "project management"), or negative keyword (ex: -project)
    • searches Ask name, Ask ID, notes and hashtags
  • masterProcessCodes comma-delimited list of unique master flow ID(s)—flow version 1
    • A master flow ID will return results for ALL versions of the same flow, ex: ABC flow, ALL versions
  • processCodes comma-delimited list of unique flow ID(s), ex: ABC flow version 6
  • processOwnerContactCodes comma-delimited list of unique contact ID(s) who own the flow
  • processOwnerContactPoolCodes comma-delimited list of unique team ID(s) who own the flow
  • requestCodes comma-delimited list of unique Ask ID(s)
  • requesterContactCodes comma-delimited list of unique contact ID(s) who submitted Ask(s)
  • requestStatusNames comma-delimited list of request statuses: Open, Completed, Canceled
  • requestDateClosedFrom start date range for when the Ask is closed, format: MM/DD/YYYY hh:mm am/pm, ex: 12/31/2025 11:59 pm
  • requestDateClosedTo end date range for when the Ask is closed, format: MM/DD/YYYY hh:mm am/pm, ex: 12/31/2025 11:59 pm
  • requestDateSubmittedFrom start date range for when the Ask is submitted, format: MM/DD/YYYY hh:mm am/pm, ex: 12/31/2025 11:59 pm
  • requestDateSubmittedTo end date range for when the Ask is submitted, format: MM/DD/YYYY hh:mm am/pm, ex: 12/31/2025 11:59 pm
  • stepOwnerContactCodes comma-delimited list of unique contact ID(s) who own the CURRENT step
  • stepOwnerContactPoolCodes comma-delimited list of unique team ID(s) who own the CURRENT step

If no filter parameters are provided, the result will return ALL Asks based on the user's OAuth token, corresponding to the All tab.

You can page through the results using the following arguments:

  • page
  • pageSize max 20
  • sortBy valid arguments: currentStepprocessNameprogressrequestCloseDateStamprequestName
  • sortDir direction: asc, desc

Specifically, the search will only return Asks that meets at least one of the following conditions:

  • Asks that the user submitted
  • Asks that has the user as a step owner in any step
  • Asks that has the user's team member as the current step owner, corresponding to For My Team tab
  • Asks that has the user's team as the current step owner, corresponding to Unassigned tab
  • Asks from flows that the user or the user's team owns
  • Asks that the user is following

Note, results are sorted by last updated date and are limited to a max of 20 results per page.

Sample GraphQL query for getRequests to return an array of SearchPageResultType with just requestCode.

{
    "operationName": "GetRequestsSearchQuery",
    "query": "query getRequestsSearch($requestCodes: String, 
				$processCodes: String, 
				$masterProcessCodes: String, 
				$stepOwnerContactCodes: String, 
				$stepOwnerContactPoolCodes: String, 
				$requesterContactCodes: String, 
				$requestStatusNames: String,
				$requestDateSubmittedFrom: String,
				$requestDateSubmittedTo: String,
				$page: Int,
				$pageSize: Int) { 
		getRequestsSearch(requestCodes: $requestCodes, 
				processCodes: $processCodes, 
				masterProcessCodes: $masterProcessCodes, 
				stepOwnerContactCodes: $stepOwnerContactCodes, 
				stepOwnerContactPoolCodes: $stepOwnerContactPoolCodes, 
				requesterContactCodes: $requesterContactCodes, 
				requestStatusNames: $requestStatusNames,
				requestDateSubmittedFrom: $requestDateSubmittedFrom,
				requestDateSubmittedTo: $requestDateSubmittedTo,
				page: $page,
				pageSize: $pageSize) {
	    __typename
	    page
	    pageSize
	    totalCount
	    requests {
	        requestCode
	    }
    	}
    }",
    "variables": {
	"page": 0,
"searchTerm": "project" } }
{
    "data": {
        "getRequestsSearch": {
            "page": 0,
            "pageSize": 20,
            "totalCount": 1,    
            "requests": [
                {
                    "requestCode": "GFK3ARE861"
                }
            ]
        }
    }
}

If you want to receive a more complete object, we recommend you use the RequestFragment.

{
    "operationName": "GetRequestsQuery",
    "query": "query getRequestsSearch($requestCodes: String, 
				$processCodes: String, 
				$masterProcessCodes: String, 
				$stepOwnerContactCodes: String, 
				$stepOwnerContactPoolCodes: String, 
				$requesterContactCodes: String, 
				$requestStatusNames: String,
				$requestDateSubmittedFrom: String,
				$requestDateSubmittedTo: String,
				$page: Int,
				$pageSize: Int) { 
		getRequestsSearch(requestCodes: $requestCodes, 
				processCodes: $processCodes, 
				masterProcessCodes: $masterProcessCodes, 
				stepOwnerContactCodes: $stepOwnerContactCodes, 
				stepOwnerContactPoolCodes: $stepOwnerContactPoolCodes, 
				requesterContactCodes: $requesterContactCodes, 
				requestStatusNames: $requestStatusNames,
				requestDateSubmittedFrom: $requestDateSubmittedFrom,
				requestDateSubmittedTo: $requestDateSubmittedTo,
				page: $page,
				pageSize: $pageSize) {
__typename
page
pageSize
totalCount
requests { ...RequestFragment }
} } fragment RequestFragment on RequestType { __typename requestCode requestName requestRecurrenceId requestStatusId requestStatusName totalSteps totalTodoSteps completedStepCount isDelayed useDueDates originalDueDateStamp currentDueDateStamp processName processCode progressString progress requestDateStamp requestUpdateDateStamp requester { ...ContactFragment } } fragment ContactFragment on ContactType { contactFirstName contactLastName contactEmail contactCode isTrash }", "variables": { "processCodes": "TCK124RLNA99,KFO19MMLA1Z", "page": 0 } }
{
    "data": {
        "getRequestsSearch": {
            "page": 0,
            "pageSize": 20,
            "totalCount": 1,       
		"requests": [
		    {
			"requestCode": "GFK3ARE861",
			"requestName": "test ask",
			"requestRecurrenceId": 0,
			"requestStatusName": "Open",
			"totalSteps": 3,
			"totalTodoSteps": 3,
			"completedStepCount": 0,
			"isDelayed": false,
			"useDueDates": false,
			"originalDueDateStamp": 1601941558050,
			"currentDueDateStamp": 1601941558050,
			"processName": "Test flow",
			"processCode": "TCK124RLNA99",
			"requestComment": "",
			"requestDateStamp": 1601941558050
			"requester": {
			    "contactFirstName": "Henry",
			    "contactLastName": "Evans",
			    "contactEmail": "henry.evans@company.com",
			    "contactCode": "GYD6GR6W18",
			    "isTrash": false
			}
		    }
		]	    
	}
    }
}

Note the following key fields for this Ask:

  • processCode code of the Flow that serves as the blueprint for this Ask 
  • requestDateStamp UNIX epoch of when this Ask was submitted
  • requestStatusName status of this Ask; possible values: Open, Completed, Canceled
  • totalSteps total number of steps for this Ask
  • totalToDoSteps total number of Open steps for this Ask

Since the API is a GraphQL API, you can choose which fields you want to return. However, when using the search query, do not return deeply nested fields, due to performance reasons. Per GraphQL best practices, select only fields that you need.

Back to Top

 

Retrieve a specific Ask

After searching for Asks, you can retrieve an Ask by using the  getRequest query based on requestCode.

Sample GraphQL query for getRequest to return the RequestType using the recommended RequestFragment. This is equivalent to viewing an Ask with all the steps collapsed.

{
    "operationName": "GetRequestQuery",
    "query": "query getRequest($requestCode: String!, 
					$contactCode: String) { 
		getRequest(requestCode: $requestCode, 
					contactCode: $contactCode) {
            ...RequestFragment
    	}
    }
    fragment RequestFragment on RequestType {
        requestStatusName
        process {
            processName
            processCode
            isArchive
        }
        requestComment
        requestCode
        requestName
        requestDateStamp
        currentStepId
        currentStepCode
        requestRecurrenceId
        totalSteps
        completedStepCount
        totalTodoSteps
        currentProcessStepOwnerTeamName
        isDelayed
        useDueDates
        originalDueDateStamp
        currentDueDateStamp
        requester {
            ...ContactFragment
        }
        workflowOwner {
            ...OwnerFragment
            type
            contactPoolName
            contactIsMe
            isMember
        }
        form {
            ...FormFragment
        }
        attachments {
            ...FileFragment
        }
        steps {
            ...RequestStepFragment
        }
    }    
    fragment RequestStepFragment on RequestStepType {
        stepCode
        stepName
        stepStatusName
        dueDateTimeToComplete
        dueDateStamp
        useDueDates
        isPastDue
        stepOrder
        isAdHocStep
        isExternal
        isSkippable
        isConfidential
        stepCreateDateStamp
        stepStartDateStamp
        requestCode
        canReassignStep
        canSendReminder
        stepOwner {
            ...OwnerFragment
        }
    }      
    fragment FormFragment on FormType {
        formId
        fields {
            ...FieldFragment
        }
    }    
    fragment FieldFragment on FieldType {
        fieldCode
        editableFieldValue
        fieldTitle
        fieldType
        fieldValue
        fieldName
        metDependency
        childFields{
            fieldCode
            editableFieldValue
            fieldTitle
            fieldType
            fieldValue
            fieldName
            metDependency
        }
    }    
    fragment FileFragment on FileType {
        attachmentCode
        requestCode
        attachmentExtension
        attachmentName
        attachmentIcon
        attachmentThumbUrl        
        attachmentUrl
        attachmentUploadDateStamp
        canDelete
        isActionable
        contact {
            ...ContactFragment
        }
        step {
            isFilesRequired
            stepCode
            stepOrder
            stepStatusId
            stepName
            stepStatusName
        }
        uploaderContactCode
        uploaderProfileImageUrl
        uploaderContactEmail
        uploaderContactName
    }    
    fragment OwnerFragment on OwnerType {
        contactFirstName
        contactLastName
        contactEmail
        contactCode
        type
        contactProfileImageUrl
        contactPoolProfileImageUrl
        contactPoolName
        contactPoolCode
        contactIsMe
        isMember
        isOwner
        isTrash
        contactIsMe
        members {
            ...ContactFragment
        }
    }    
    fragment ContactFragment on ContactType {
	  contactFirstName
	  contactLastName
	  contactEmail
	  contactCode
	  isTrash
    }",
    "variables": {
	"requestCode": "GFK3ARE861"
    }    
}
{
    "data": {
        "getRequest": {
            "requestStatusName": "Open",
            "process": {
                "processName": "Test flow",
                "processCode": "TCK124RLNA99",
                "isArchive": 0
            },
            "requestComment": "",
            "requestCode": "GFK3ARE861",
            "requestName": "test ask",
            "requestDateStamp": 1601941558050,
            "currentStepId": 44258,
            "currentStepCode": "QZM44258FGXIXF",
            "requestRecurrenceId": 0,
            "totalSteps": 3,
            "completedStepCount": 0,
            "totalTodoSteps": 3,
            "currentProcessStepOwnerTeamName": "N/A",
            "isDelayed": false,
            "useDueDates": false,
            "originalDueDateStamp": 1601941558050,
            "currentDueDateStamp": 1601941558050,
            "requester": {
                "contactFirstName": "Henry",
                "contactLastName": "Evans",
                "contactEmail": "henry.evans@company.com",
                "contactCode": "GYD6GR6W18",
                "isTrash": false
            },
            "workflowOwner": {
                "contactFirstName": "",
                "contactLastName": "",
                "contactEmail": "",
                "contactCode": "",
                "type": "Team",
                "contactProfileImageUrl": "",
                "contactPoolProfileImageUrl": "",
                "contactPoolName": "Test Team",
                "contactPoolCode": "SNY30P4M48N",
                "contactIsMe": false,
                "isMember": 1,
                "isOwner": 1,
                "isTrash": false,
                "members": [
                    {
                        "contactFirstName": "Henry",
                        "contactLastName": "Evans",
                        "contactEmail": "henry.evans@company.com",
                        "contactCode": "GYD6GR6W18",
                        "isTrash": false
                    }
                ]
            },
            "form": {
                "formId": 604,
                "fields": [
                    {
                        "fieldCode": "3B104627-7182-40A2-8134-8A68FD6B49D7",
                        "editableFieldValue": "Henry",
                        "fieldTitle": "First Name",
                        "fieldType": "TEXT",
                        "fieldValue": "Henry",
                        "fieldName": "contact_first_name",
                        "metDependency": true,
                        "childFields": null
                    },
                    {
                        "fieldCode": "E9E8FA01-52FA-40A5-94FE-4FF61F46F8E0",
                        "editableFieldValue": "Evans",
                        "fieldTitle": "Last Name",
                        "fieldType": "TEXT",
                        "fieldValue": "Evans",
                        "fieldName": "contact_last_name",
                        "metDependency": true,
                        "childFields": null
                    },
                    {
                        "fieldCode": "792E449C-4587-4856-AED3-B1A20465C0B2",
                        "editableFieldValue": "henry.evans@company.com",
                        "fieldTitle": "Email",
                        "fieldType": "TEXT",
                        "fieldValue": "henry.evans@company.com",
                        "fieldName": "contact_email",
                        "metDependency": true,
                        "childFields": null
                    },
                    {
                        "fieldCode": "D53FFC90-23F2-432A-A974-468FF8F8A441",
                        "editableFieldValue": "test ask",
                        "fieldTitle": "Ask",
                        "fieldType": "TEXT",
                        "fieldValue": "test ask",
                        "fieldName": "request_name",
                        "metDependency": true,
                        "childFields": null
                    },
                    {
                        "fieldCode": "253FEFE2-E8AE-4606-BC94-B7F67DF99FCD",
                        "editableFieldValue": "",
                        "fieldTitle": "Details",
                        "fieldType": "TEXTAREA",
                        "fieldValue": "",
                        "fieldName": "details_notes_or_comments",
                        "metDependency": true,
                        "childFields": null
                    },
                    {
                        "fieldCode": "53789D90-E479-4091-ADDE-24C48D0CC58D",
                        "editableFieldValue": "",
                        "fieldTitle": "Files",
                        "fieldType": "FILEUPLOAD",
                        "fieldValue": "",
                        "fieldName": "request_files",
                        "metDependency": true,
                        "childFields": null
                    }
                ]
            },
            "attachments": [],
            "steps": [
                {
                    "stepCode": "QZM44258FGXIXF",
                    "stepName": "Execute step 1",
                    "stepStatusName": " NA",
                    "dueDateTimeToComplete": 1,
                    "dueDateStamp": 1601941558147,
                    "useDueDates": false,
                    "isPastDue": false,
                    "stepOrder": 1,
                    "isAdHocStep": false,
                    "isExternal": 0,
                    "isSkippable": 0,
                    "isConfidential": 0,
                    "stepCreateDateStamp": 1601941560000.0,
                    "stepStartDateStamp": 1601941560000.0,
                    "requestCode": "GFK3ARE861",
                    "canReassignStep": true,
                    "canSendReminder": true,
                    "stepOwner": {
                        "contactFirstName": "Henry",
                        "contactLastName": "Evans",
                        "contactEmail": "henry.evans@company.com",
                        "contactCode": "GYD6GR6W18",
                        "type": "Contact",
                        "contactProfileImageUrl": "https://d1v1s76gnntd7e.cloudfront.net/pipeline/contact-blank.png",
                        "contactPoolProfileImageUrl": "",
                        "contactPoolName": "",
                        "contactPoolCode": "",
                        "contactIsMe": true,
                        "isMember": 0,
                        "isOwner": 0,
                        "isTrash": false,
                        "members": []
                    }
                },
                {
                    "stepCode": "SMA44259A4SVH5",
                    "stepName": "Execute step 2",
                    "stepStatusName": " NA",
                    "dueDateTimeToComplete": 1,
                    "dueDateStamp": 1601941558147,
                    "useDueDates": false,
                    "isPastDue": false,
                    "stepOrder": 2,
                    "isAdHocStep": false,
                    "isExternal": 0,
                    "isSkippable": 0,
                    "isConfidential": 0,
                    "stepCreateDateStamp": 1601941560000.0,
                    "stepStartDateStamp": -62135575200000.0,
                    "requestCode": "GFK3ARE861",
                    "canReassignStep": true,
                    "canSendReminder": false,
                    "stepOwner": {
                        "contactFirstName": "Henry",
                        "contactLastName": "Evans",
                        "contactEmail": "henry.evans@company.com",
                        "contactCode": "GYD6GR6W18",
                        "type": "Contact",
                        "contactProfileImageUrl": "https://d1v1s76gnntd7e.cloudfront.net/pipeline/contact-blank.png",
                        "contactPoolProfileImageUrl": "",
                        "contactPoolName": "",
                        "contactPoolCode": "",
                        "contactIsMe": true,
                        "isMember": 0,
                        "isOwner": 0,
                        "isTrash": false,
                        "members": []
                    }
                },
                {
                    "stepCode": "4NB44260T5M8J5",
                    "stepName": "Execute step 3",
                    "stepStatusName": " NA",
                    "dueDateTimeToComplete": 1,
                    "dueDateStamp": 1601941558147,
                    "useDueDates": false,
                    "isPastDue": false,
                    "stepOrder": 3,
                    "isAdHocStep": false,
                    "isExternal": 0,
                    "isSkippable": 0,
                    "isConfidential": 0,
                    "stepCreateDateStamp": 1601941560000.0,
                    "stepStartDateStamp": -62135575200000.0,
                    "requestCode": "GFK3ARE861",
                    "canReassignStep": true,
                    "canSendReminder": false,
                    "stepOwner": {
                        "contactFirstName": "Henry",
                        "contactLastName": "Evans",
                        "contactEmail": "henry.evans@company.com",
                        "contactCode": "GYD6GR6W18",
                        "type": "Contact",
                        "contactProfileImageUrl": "https://d1v1s76gnntd7e.cloudfront.net/pipeline/contact-blank.png",
                        "contactPoolProfileImageUrl": "",
                        "contactPoolName": "",
                        "contactPoolCode": "",
                        "contactIsMe": true,
                        "isMember": 0,
                        "isOwner": 0,
                        "isTrash": false,
                        "members": []
                    }
                }
            ]
        }
    }
}

Back to Top

 

Retrieve step details

To retrieve a step's details, use the  getRequestStep query based on stepCode.

Sample GraphQL query for getRequestStep to return the RequestStepType using the recommended RequestStepFragment. This is equivalent to expanding a step in the Ask.

{
    "operationName": "GetRequestStepQuery",
    "query": "query getRequestStep($stepCode: String!) { 
		getRequestStep(stepCode: $stepCode) {
            ...RequestStepDetailsFragment
    	}
    }
    fragment RequestStepDetailsFragment on RequestStepType {
        ...RequestStepFragment
        canRenderEditAndDeleteAdhocButtons
        canRenderDisabledEditAndDeleteAdhocButtons
        canSendReminder
        stepOwnerIsRequester
        showCompleteButton
        stepDescription
        showAssignTo
        stepRejectName
        showInstructions
        stepCompleteName
        stepCompleteDateStamp
        showStepFormEdit
        isFilesRequired
        filesCount
        previousStepCode
        writeToActivityFeed
        isCurrentStep
        isContactStepOwner
        isContactExternalStepOwner
        isOpen
        form {
            ...FormFragment
        }
        attachments {
            ...FileFragment
        }
        notes {
            ...NoteFragment
        }
    }
    fragment RequestStepFragment on RequestStepType {
        stepCode
        stepName
        stepStatusName
        dueDateTimeToComplete
        dueDateStamp
        useDueDates
        isPastDue
        stepOrder
        isAdHocStep
        isExternal
        isSkippable
        isConfidential
        stepCreateDateStamp
        stepStartDateStamp
        requestCode
        canReassignStep
        canSendReminder
        stepOwner {
            ...OwnerFragment
        }
    }    
    fragment FormFragment on FormType {
        formId
        fields {
            ...FieldFragment
        }
    }    
    fragment FieldFragment on FieldType {
        fieldCode
        editableFieldValue
        fieldTitle
        fieldType
        fieldValue
        fieldName
        metDependency
        childFields{
            fieldCode
            editableFieldValue
            fieldTitle
            fieldType
            fieldValue
            fieldName
            metDependency
        }
    }    
    fragment FileFragment on FileType {
        attachmentCode
        requestCode
        attachmentExtension
        attachmentName
        attachmentIcon
        attachmentThumbUrl        
        attachmentUrl
        attachmentUploadDateStamp
        canDelete
        isActionable
        contact {
            ...ContactFragment
        }
        step {
            isFilesRequired
            stepCode
            stepOrder
            stepStatusId
            stepName
            stepStatusName
        }
        uploaderContactCode
        uploaderProfileImageUrl
        uploaderContactEmail
        uploaderContactName
    }    
    fragment OwnerFragment on OwnerType {
        contactFirstName
        contactLastName
        contactEmail
        contactCode
        type
        contactProfileImageUrl
        contactPoolProfileImageUrl
        contactPoolName
        contactPoolCode
        contactIsMe
        isMember
        isOwner
        isTrash
        contactIsMe
        members {
            ...ContactFragment
        }
    }    
    fragment NoteFragment on NoteType {
        noteContent
        stepOrder
        requestCode
        isSystem
        canDelete
        activityFeedRecordTypeEnum
        noteCreateDateStamp
        contact {
            ...ContactFragment
        }
        step {
            stepCode
            stepOrder
            stepName
        }
    }    
    fragment ContactFragment on ContactType {
	  contactFirstName
	  contactLastName
	  contactEmail
	  contactCode
	  isTrash
    }",
    "variables": {
	"stepCode": "QZM44258FGXIXF"
    }    
}
{
    "data": {
        "getRequestStep": {
            "stepCode": "QZM44258FGXIXF",
            "stepName": "Execute step 1",
            "stepStatusName": " NA",
            "dueDateTimeToComplete": 1,
            "dueDateStamp": 1601941558147,
            "useDueDates": false,
            "isPastDue": false,
            "stepOrder": 1,
            "isAdHocStep": false,
            "isExternal": 0,
            "isSkippable": 0,
            "isConfidential": 0,
            "stepCreateDateStamp": 1601941560000.0,
            "stepStartDateStamp": 1601941560000.0,
            "requestCode": "GFK3ARE861",
            "canReassignStep": true,
            "canSendReminder": true,
            "stepOwner": {
                "contactFirstName": "Henry",
                "contactLastName": "Evans",
                "contactEmail": "henry.evans@company.com",
                "contactCode": "GYD6GR6W18",
                "type": "Contact",
                "contactProfileImageUrl": "https://d1v1s76gnntd7e.cloudfront.net/pipeline/contact-blank.png",
                "contactPoolProfileImageUrl": "",
                "contactPoolName": "",
                "contactPoolCode": "",
                "contactIsMe": true,
                "isMember": 0,
                "isOwner": 0,
                "isTrash": false,
                "members": []
            },
            "canRenderEditAndDeleteAdhocButtons": false,
            "canRenderDisabledEditAndDeleteAdhocButtons": false,
            "stepOwnerIsRequester": true,
            "showCompleteButton": true,
            "stepDescription": "",
            "showAssignTo": false,
            "stepRejectName": "Cannot Complete",
            "showInstructions": false,
            "stepCompleteName": "Complete",
            "stepCompleteDateStamp": -62135575200000.0,
            "showStepFormEdit": false,
            "isFilesRequired": 0,
            "filesCount": 0,
            "previousStepCode": "QZM44258FGXIXF",
            "writeToActivityFeed": false,
            "isCurrentStep": true,
            "isContactStepOwner": true,
            "isContactExternalStepOwner": false,
            "isOpen": true,
            "form": {
                "formId": 0,
                "fields": []
            },
            "attachments": [],
            "notes": []
        }
    }
}

Note the following key fields for this step:

  • stepCode code of the step 
  • stepStartDateStamp UNIX epoch of when this step was started
  • stepCompleteDateStamp UNIX epoch of when this step was completed
  • stepStatusName status of this Ask; possible values: NA, Completed, Canceled, Skipped

Back to Top

Create an Ask

To create an Ask, use the createRequest mutation based on:

  • processCode unique ID of the flow
  • contactEmail email of the contact. Note, the email must be a valid, non-disposable email. Fake emails will not pass validation and result in a error.

Sample GraphQL query for createRequest to return the RequestType using the recommended RequestFragment.

{
    "operationName": "CreateRequestMutation",
    "query": "mutation createRequest($processCode: String!,
                    $contactEmail: String!,
                    $requestName: String,
                    $requestComment: String,
                    $requestFields: [InputFieldType]) { 
		createRequest(processCode: $processCode,
                    contactEmail: $contactEmail,
                    requestName: $requestName,
                    requestComment: $requestComment,
                    requestFields: $requestFields) {
            ...RequestFragment
    	}
    }
    fragment RequestFragment on RequestType {
        requestCode
        requestName
        requestRecurrenceId
        requestStatusName
        totalSteps
        totalTodoSteps
        completedStepCount
        isDelayed
        useDueDates
        originalDueDateStamp
        currentDueDateStamp
        requester {
            ...ContactFragment
        }
        processName
        processCode
        requestComment
        requestDateStamp
    }    
    fragment ContactFragment on ContactType {
	  contactFirstName
	  contactLastName
	  contactEmail
	  contactCode
	  isTrash
    }",
    "variables": {
	"processCode": "TCK124RLNA99",        
	"contactEmail": "henry.evans@company.com",
	"requestName": "Hello World!",
	"requestComment": "lorem ipsum dolor sit amet"        
    }    
}
{
    "data": {
        "createRequest": {
            "requestCode": "WCX4D3H00C",
            "requestName": "Hello World!",
            "requestRecurrenceId": 0,
            "requestStatusName": "Open",
            "totalSteps": 3,
            "totalTodoSteps": 3,
            "completedStepCount": 0,
            "isDelayed": false,
            "useDueDates": false,
            "originalDueDateStamp": 1602084988070,
            "currentDueDateStamp": 1602084988070,
            "requester": {
                "contactFirstName": "Henry",
                "contactLastName": "Evans",
                "contactEmail": "henry.evans@company.com",
                "contactCode": "GYD6GR6W18",
                "isTrash": false
            },
            "processName": "Test flow",
            "processCode": "TCK124RLNA99",
            "requestComment": "lorem ipsum dolor sit amet",
            "requestDateStamp": 1602084988070
        }
    }
}

Back to Top

 

Complete a step

To complete an Open step, use the  completeStep mutation based on:

  • requestCode unique ID of the Ask
  • stepCode unique ID of the step
  • contactCode unique ID of the contact

Sample GraphQL mutation for completeStep to return the RequestStepType using the recommended RequestStepFragment

{
    "operationName": "CompletestepMutation",
    "query": "mutation completeStep($requestCode: String!,
                    $stepCode: String!,
                    $contactCode: String!,
                    $noteContent: String) { 
		completeStep(requestCode: $requestCode,
                    stepCode: $stepCode,
                    contactCode: $contactCode,
                    noteContent: $noteContent) {
            ...RequestStepFragment
    	}
    }
    fragment RequestStepFragment on RequestStepType {
        stepCode
        stepName
        stepStatusName
        dueDateTimeToComplete
        dueDateStamp
        useDueDates
        isPastDue
        stepOrder
        isAdHocStep
        isExternal
        isSkippable
        isConfidential
        stepCreateDateStamp
        stepStartDateStamp
        requestCode
        canReassignStep
        canSendReminder
        stepOwner {
            ...OwnerFragment
        }
    }    
    fragment OwnerFragment on OwnerType {
        contactFirstName
        contactLastName
        contactEmail
        contactCode
        type
        contactProfileImageUrl
        contactPoolProfileImageUrl
        contactPoolName
        contactPoolCode
        contactIsMe
        isMember
        isOwner
        isTrash
        contactIsMe
        members {
            ...ContactFragment
        }
    }    
    fragment ContactFragment on ContactType {
	  contactFirstName
	  contactLastName
	  contactEmail
	  contactCode
	  isTrash
    }",
    "variables": {
	"requestCode": "GFK3ARE861",        
	"stepCode": "QZM44258FGXIXF",
	"contactCode": "GYD6GR6W18"        
    }    
}
{
    "data": {
        "completeStep": {
            "stepCode": "QZM44258FGXIXF",
            "stepName": "Execute step 1",
            "stepStatusName": "Completed",
            "dueDateTimeToComplete": 1,
            "dueDateStamp": 1601941558147,
            "useDueDates": false,
            "isPastDue": false,
            "stepOrder": 1,
            "isAdHocStep": false,
            "isExternal": 0,
            "isSkippable": 0,
            "isConfidential": 0,
            "stepCreateDateStamp": 1601941560000.0,
            "stepStartDateStamp": 1601941560000.0,
            "requestCode": "GFK3ARE861",
            "canReassignStep": false,
            "canSendReminder": false,
            "stepOwner": {
                "contactFirstName": "Henry",
                "contactLastName": "Evans",
                "contactEmail": "henry.evans@company.com",
                "contactCode": "GYD6GR6W18",
                "type": "Contact",
                "contactProfileImageUrl": "https://d1v1s76gnntd7e.cloudfront.net/pipeline/contact-blank.png",
                "contactPoolProfileImageUrl": "",
                "contactPoolName": "",
                "contactPoolCode": "",
                "contactIsMe": true,
                "isMember": 0,
                "isOwner": 0,
                "isTrash": false,
                "members": []
            }
        }
    }
}

Note that stepStatusName becomes Completed after the mutation.

Back to Top

 

Reassign a step

To reassign an Open step, use the reassignStep mutation based on:

  • requestCode unique ID of the Ask
  • stepCode unique ID of the step
  • reassignTo either an email address or unique ID of the team
  • isReassignAllTeamSteps whether to reassign all other Open and unassigned step(s) owned by same the team to the specified user or team; corresponds to Assign All Teams to Me function

Sample GraphQL mutation for reassignStep to return the RequestStepType using the recommended RequestStepFragment

{
    "operationName": "ReassignStepMutation",
    "query": "mutation reassignStep($requestCode: String!,
                    $stepCode: String!,
                    $reassignTo: String!,
                    $isReassignAllTeamSteps: Int) { 
		reassignStep(requestCode: $requestCode,
                    stepCode: $stepCode,
                    reassignTo: $reassignTo,
                    isReassignAllTeamSteps: $isReassignAllTeamSteps) {
            ...RequestStepFragment
    	}
    }
    fragment RequestStepFragment on RequestStepType {
        stepCode
        stepName
        stepStatusName
        dueDateTimeToComplete
        dueDateStamp
        useDueDates
        isPastDue
        stepOrder
        isAdHocStep
        isExternal
        isSkippable
        isConfidential
        stepCreateDateStamp
        stepStartDateStamp
        requestCode
        canReassignStep
        canSendReminder
        stepOwner {
            ...OwnerFragment
        }
    }    
    fragment OwnerFragment on OwnerType {
        contactFirstName
        contactLastName
        contactEmail
        contactCode
        type
        contactProfileImageUrl
        contactPoolProfileImageUrl
        contactPoolName
        contactPoolCode
        contactIsMe
        isMember
        isOwner
        isTrash
        contactIsMe
        members {
            ...ContactFragment
        }
    }    
    fragment ContactFragment on ContactType {
	  contactFirstName
	  contactLastName
	  contactEmail
	  contactCode
	  isTrash
    }",
    "variables": {
	"requestCode": "GFK3ARE861",        
	"stepCode": "QZM44258FGXIXF",
	"reassignTo": "henry.evans@company.com",
        "isReassignAllTeamSteps": 0
    }    
}
{
    "data": {
        "completeStep": {
            "stepCode": "QZM44258FGXIXF",
            "stepName": "Execute step 1",
            "stepStatusName": "Open",
            "dueDateTimeToComplete": 1,
            "dueDateStamp": 1601941558147,
            "useDueDates": false,
            "isPastDue": false,
            "stepOrder": 1,
            "isAdHocStep": false,
            "isExternal": 0,
            "isSkippable": 0,
            "isConfidential": 0,
            "stepCreateDateStamp": 1601941560000.0,
            "stepStartDateStamp": 1601941560000.0,
            "requestCode": "GFK3ARE861",
            "canReassignStep": false,
            "canSendReminder": false,
            "stepOwner": {
                "contactFirstName": "Henry",
                "contactLastName": "Evans",
                "contactEmail": "henry.evans@company.com",
                "contactCode": "GYD6GR6W18",
                "type": "Contact",
                "contactProfileImageUrl": "https://d1v1s76gnntd7e.cloudfront.net/pipeline/contact-blank.png",
                "contactPoolProfileImageUrl": "",
                "contactPoolName": "",
                "contactPoolCode": "",
                "contactIsMe": true,
                "isMember": 0,
                "isOwner": 0,
                "isTrash": false,
                "members": []
            }
        }
    }
}

Note, reassigning steps is only allowed when stepStatusName = Open.

Back to Top