REST API:Workflow Resources

REST API:Workflow Resources

From LongJump Support Wiki

REST API:Workflow Resources
Jump to: navigation, search

Manage Workflow record states using the REST API.

File:notepad.png

Note: This resource is available for Custom Objects. It is not available for Built-in or CRM objects.

Learn more: Workflow Records, States, Actions, and Owners

Contents

Permissions

File:Lock-tiny.gif

Users that have the Customize Objects permission can use Workflow APIs 

Identify Workflow Owners

Identify current owner(s) of a record in a workflow.

Method
GET
URI
https://na.longjump.com/networking/rest/record/{objectName}/{recordId}/workflowOwners
Response
<platform>
    <record>
        <availableWFOwners>
            <owners>
                <id>123qwe456rty</id>
                <fullname>John Smith</fullname>
            </owners>
            <owners>
                <id>456rty789uio</id>
                <fullname>Jane Doe</fullname>
            </owners>
        </availableWFOwners>
    </record>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

List Available Actions

Retrieve the actions available for a record, depending on its current Workflow state.

Considerations
  • Eligible actions are those that meet the action criteria, where the user has appropriate permissions take the action.
  • The action list is generated according to the following rules:
  • Eligible actions (which fit the criteria) are returned with the "available" field being set to "1"
  • Non-eligible actions are returned with "available" set as "0".
  • If multiple actions exist with the same name, then only the eligible action is returned, with "available" = 1
  • If multiple eligible actions exist with the same name, then all of the actions are returned with "available" = 1
  • If multiple non-eligible actions exist with the same name, then all of the are returned with "available" = 0
Method
GET
URI
https://na.longjump.com/networking/rest/workflowAction/record/{objectName}/{recordId}
Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <platform>
    <workflowAction>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <created_id type=""
            uri="https://{domain}/networking/rest/user/b2912a93cb0e"
            displayValue="Smith;;Mary">b2912a93cb0e</created_id>
        <modified_id type=""
            uri="https://{domain}/networking/rest/user/b2912a93cb0e"
            displayValue="Smith;;Mary">b2912a93cb0e</modified_id>
        <object_id>2b934310dbd24347813a722ab8724eb3</object_id>
        <record_id>1381445705</record_id>
        <id>e5c9c2deaaf240c2b45d54b0cea320aa</id>
        <name>action1</name>
        <title>action1</title>
        <currentStateId>38c8725a13e04ec08796f1b0791da071</currentStateId>
        <nextStateId>0a324a8eea444adc861f8a0d42f384bd</nextStateId>
        <notifyRecordOwner>0</notifyRecordOwner>
        <additionalUserToNotify type=""
            uri="https://{domain}/networking/rest/user/123456789"
            displayValue="User1 Name">123456789</additionalUserToNotify>
        <additionalUserToNotify type=""
            uri="https://{domain}/networking/rest/user/223456789"
            displayValue="User2 Name">223456789</additionalUserToNotify>
        <customCriteria></customCriteria>
        <actionCriteria>
            <criteria_1_join_operator></criteria_1_join_operator>
            <criteria_1_pre_bracket></criteria_1_pre_bracket>
            <criteria_1_post_bracket></criteria_1_post_bracket>
            <criteria_1_column>amount</criteria_1_column>
            <criteria_1_operator>lteq</criteria_1_operator>
            <criteria_1_value>100</criteria_1_value>
            <criteria_2_join_operator></criteria_2_join_operator>
            <criteria_2_pre_bracket></criteria_2_pre_bracket>
            <criteria_2_post_bracket></criteria_2_post_bracket>
            <criteria_2_column></criteria_2_column>
            <criteria_2_operator></criteria_2_operator>
            <criteria_2_value></criteria_2_value>
            <criteria_3_join_operator></criteria_3_join_operator>
            <criteria_3_pre_bracket></criteria_3_pre_bracket>
            <criteria_3_post_bracket></criteria_3_post_bracket>
            <criteria_3_column></criteria_3_column>
            <criteria_3_operator></criteria_3_operator>
            <criteria_3_value></criteria_3_value>
            <criteria_4_join_operator></criteria_4_join_operator>
            <criteria_4_pre_bracket></criteria_4_pre_bracket>
            <criteria_4_post_bracket></criteria_4_post_bracket>
            <criteria_4_column></criteria_4_column>
            <criteria_4_operator></criteria_4_operator>
            <criteria_4_value></criteria_4_value>
            <criteria_5_join_operator></criteria_5_join_operator>
            <criteria_5_pre_bracket></criteria_5_pre_bracket>
            <criteria_5_post_bracket></criteria_5_post_bracket>
            <criteria_5_column></criteria_5_column>
            <criteria_5_operator></criteria_5_operator>
            <criteria_5_value></criteria_5_value>
        </actionCriteria>
        <available>0</available>
    </workflowAction>
    <workflowAction>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <created_id type=""
            uri="https://{domain}/networking/rest/user/b2912a93cb0e"
            displayValue="Smith;;Mary">b2912a93cb0e</created_id>
        <modified_id type=""
            uri="https://{domain}/networking/rest/user/b2912a93cb0e"
            displayValue="Smith;;Mary">b2912a93cb0e</modified_id>
        <object_id>2b934310dbd24347813a722ab8724eb3</object_id>
        <record_id>1381445705</record_id>
        <id>e8cfbadc9ae547bb85e1bd86abca8ac5</id>
        <name>action1</name>
        <title>action1</title>
        <currentStateId>38c8725a13e04ec08796f1b0791da071</currentStateId>
        <nextStateId>90e2323956e24c0a8e475fce4ae19ca8</nextStateId>
        <notifyRecordOwner>0</notifyRecordOwner>
        <customCriteria></customCriteria>
        <actionCriteria>
            <criteria_1_join_operator></criteria_1_join_operator>
            <criteria_1_pre_bracket></criteria_1_pre_bracket>
            <criteria_1_post_bracket></criteria_1_post_bracket>
            <criteria_1_column>amount</criteria_1_column>
            <criteria_1_operator>gt</criteria_1_operator>
            <criteria_1_value>500</criteria_1_value>
            <criteria_2_join_operator></criteria_2_join_operator>
            <criteria_2_pre_bracket></criteria_2_pre_bracket>
            <criteria_2_post_bracket></criteria_2_post_bracket>
            <criteria_2_column></criteria_2_column>
            <criteria_2_operator></criteria_2_operator>
            <criteria_2_value></criteria_2_value>
            <criteria_3_join_operator></criteria_3_join_operator>
            <criteria_3_pre_bracket></criteria_3_pre_bracket>
            <criteria_3_post_bracket></criteria_3_post_bracket>
            <criteria_3_column></criteria_3_column>
            <criteria_3_operator></criteria_3_operator>
            <criteria_3_value></criteria_3_value>
            <criteria_4_join_operator></criteria_4_join_operator>
            <criteria_4_pre_bracket></criteria_4_pre_bracket>
            <criteria_4_post_bracket></criteria_4_post_bracket>
            <criteria_4_column></criteria_4_column>
            <criteria_4_operator></criteria_4_operator>
            <criteria_4_value></criteria_4_value>
            <criteria_5_join_operator></criteria_5_join_operator>
            <criteria_5_pre_bracket></criteria_5_pre_bracket>
            <criteria_5_post_bracket></criteria_5_post_bracket>
            <criteria_5_column></criteria_5_column>
            <criteria_5_operator></criteria_5_operator>
            <criteria_5_value></criteria_5_value>
        </actionCriteria>
        <available>0</available>
    </workflowAction>
    <workflowAction>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <created_id type=""
            uri="https://{domain}/networking/rest/user/b2912a93cb0e"
            displayValue="Smith;;Mary">b2912a93cb0e</created_id>
        <modified_id type=""
            uri="https://{domain}/networking/rest/user/b2912a93cb0e"
            displayValue="Smith;;Mary">b2912a93cb0e</modified_id>
        <object_id>2b934310dbd24347813a722ab8724eb3</object_id>
        <record_id>1381445705</record_id>
        <id>24b410913f9e47cb96fe69aa68e34a47</id>
        <name>action1</name>
        <title>action1</title>
        <currentStateId>38c8725a13e04ec08796f1b0791da071</currentStateId>
        <nextStateId>517071981f5d4708ab1739d320804210</nextStateId>
        <notifyRecordOwner>0</notifyRecordOwner>
        <customCriteria></customCriteria>
        <actionCriteria>
            <criteria_1_join_operator></criteria_1_join_operator>
            <criteria_1_pre_bracket></criteria_1_pre_bracket>
            <criteria_1_post_bracket></criteria_1_post_bracket>
            <criteria_1_column>amount</criteria_1_column>
            <criteria_1_operator>gt</criteria_1_operator>
            <criteria_1_value>100</criteria_1_value>
            <criteria_2_join_operator>and</criteria_2_join_operator>
            <criteria_2_pre_bracket></criteria_2_pre_bracket>
            <criteria_2_post_bracket></criteria_2_post_bracket>
            <criteria_2_column>amount</criteria_2_column>
            <criteria_2_operator>lteq</criteria_2_operator>
            <criteria_2_value>500</criteria_2_value>
            <criteria_3_join_operator></criteria_3_join_operator>
            <criteria_3_pre_bracket></criteria_3_pre_bracket>
            <criteria_3_post_bracket></criteria_3_post_bracket>
            <criteria_3_column></criteria_3_column>
            <criteria_3_operator></criteria_3_operator>
            <criteria_3_value></criteria_3_value>
            <criteria_4_join_operator></criteria_4_join_operator>
            <criteria_4_pre_bracket></criteria_4_pre_bracket>
            <criteria_4_post_bracket></criteria_4_post_bracket>
            <criteria_4_column></criteria_4_column>
            <criteria_4_operator></criteria_4_operator>
            <criteria_4_value></criteria_4_value>
            <criteria_5_join_operator></criteria_5_join_operator>
            <criteria_5_pre_bracket></criteria_5_pre_bracket>
            <criteria_5_post_bracket></criteria_5_post_bracket>
            <criteria_5_column></criteria_5_column>
            <criteria_5_operator></criteria_5_operator>
            <criteria_5_value></criteria_5_value>
        </actionCriteria>
        <available>0</available>
    </workflowAction>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>3</recordCount>
</platform>
See also: REST API:Error Codes

Fields

Name Type Attributes Required During Add Description Additional Information
idStringRead OnlyUnique identifier of the action
nameString Workflow action name
titleString Workflow action title
currentStateIdStringWorkflowAction current state unique identifier
nextStateIdStringWorkflowAction next state unique identifier
notifyRecordOwnerStringNotify the Record Owner about the workflow action being taken, available values: 0, 1
customCriteriaStringAdvanced criteria; learn more: Action Criteria in Workflows
actionCriteriaStructBasic criteria; learn more: Action Criteria in WorkflowsContains a set of fields for each criteria, where the criteria are numbered from 1 to N:
  • <criteria_1_join_operator>
  • <criteria_1_pre_bracket>
  • <criteria_1_post_bracket>
  • <criteria_1_column>
  • <criteria_1_operator>
  • <criteria_1_value>
     ...
additionalUserToNotifyStringList of additional users to notify upon taking the action One for every additional user to notify
availableStringEligibility of the workflow action (does the record fit the criteria?)

Available values: 0, 1

date_modifiedDateRead OnlyDate the record was last modified UTC Format
modified_idLookupRead Only Unique identifier of the user who last modified the record
date_createdDateRead OnlyDate the record was created UTC Format
created_idLookupRead OnlyUnique identifier of the the user who created the record

Transition a Record to a New State

Take one of the available actions on a record to transition to a new state.

Requirements
  • User must be a workflow owner for the record
  • The workflow must allow the specified action
Method
POST
URI
https://na.longjump.com/networking/rest/record/{objectName}/{recordId}/operation/changeWorkflowState
Request
<platform>
    <workflowChangeState>
        <workflowIdOrName>workflow1</workflowIdOrName>
        <actionName>approve</actionName>
        <comment>approve comment</comment>
        <userChoiceOwner>John Doe</userChoiceOwner>
    </workflowChangeState>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>

Fields

Name Type Attribute Required During POST Description Additional Information
objectIdStringRead Only Unique object identifier
record_idStringRead Only Unique record identifier
workflowIdOrNameString Workflow ID or name
actionNameString Workflow action name
commentString comment on taken action
userChoiceOwnerString If required indicate next workflow owner
date_modifiedStringRead Only Date the record was last modified
date_createdStringRead Only Date the record was created
created_idIDBeanRead Only ID of user who created the record
modified_idIDBean Read Only ID of user who last modified the record
Personal tools