Skip to content
On this page

Workflow Action-Related Sample Code

GetParticipantWorkflowActionsUpdateable

c#
var req = new ParticipantWorkflowActionsUpdateableRequestModel()
        {
            IDs = new ParticipantWorkflowActionIDModel[]
            {
                new ParticipantWorkflowActionIDModel()
                {
                    ActionCount = 1,
                    ParticipantID = 1234567890
                }
            }
        };

var results = serviceClient.GetParticipantWorkflowActionsUpdateable(sa, req);
if (results.IsSuccessful)
{
    results.UpdateableParticipantWorkflowActions[0].Url = "https://yourdomain.com/yournewupdatedpath.html?securitytoken=1234567890";
}

UpdateParticipantWorkflowActions

c#
var req = new ParticipantWorkflowActionsUpdateableRequestModel()
        {
            IDs = new ParticipantWorkflowActionIDModel[]
            {
                new ParticipantWorkflowActionIDModel()
                {
                    ActionCount = 1,
                    ParticipantID = 1234567890
                }
            }
        };

var results = serviceClient.GetParticipantWorkflowActionsUpdateable(sa, req);
if (results.IsSuccessful)
{
    results.UpdateableParticipantWorkflowActions[0].Url = "https://yourdomain.com/yournewupdatedpath.html?securitytoken=1234567890";

    var action = new ParticipantWorkflowActionsUpdateRequestModel()
    {
        ParticipantWorkflowActions = results.UpdateableParticipantWorkflowActions
    };

    var actionUpdateResult = serviceClient.UpdateParticipantWorkflowActions(sa, action);
    if (actionUpdateResult.IsSuccessful)
    {
        // WORKED!!
    }
}

UpdateParticipantWorkflowActionStatus()

TIP

See also Participant Custom Workflow Actions for more information on how to update workflow actions.

csharp
var req = new ParticipantWorkflowActionUpdateRequestModel()
{
    WorkflowAction = new ParticipantWorkflowActionUpdateModel()
    {
        ID = actionID,
        ParticipantID = participantID,
        IsCompleted = true
    }
};

var api = new ParticipantsUpdateableApi(myRestEndpointUrl);
var results = api.UpdateParticipantWorkflowActionStatus(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
    //do work...
}
else
{
    //handle error
}

GetTaskWorkflowActionsUpdateable

c#
var req = new TaskWorkflowActionsUpdateableRequestModel()
{
    IDs = new TaskWorkflowActionIDModel[]
    {
        new TaskWorkflowActionIDModel()
        {
            ActionCount = 1,
            TaskID = 1234567890
        }
    }
};

var results = serviceClient.GetTaskWorkflowActionsUpdateable(sa, req);
if (results.IsSuccessful)
{
    results.UpdateableTaskWorkflowActions[0].Url = "https://yourdomain.com/yournewupdatedpath.html?securitytoken=1234567890";
}

UpdateTaskWorkflowActions

c#
var req = new TaskWorkflowActionsUpdateableRequestModel()
{
    IDs = new TaskWorkflowActionIDModel[]
    {
        new TaskWorkflowActionIDModel()
        {
            ActionCount = 1,
            TaskID = 1234567890
        }
    }
};

var results = serviceClient.GetTaskWorkflowActionsUpdateable(sa, req);
if (results.IsSuccessful)
{
    results.UpdateableTaskWorkflowActions[0].Url = "https://yourdomain.com/yournewupdatedpath.html?securitytoken=1234567890";

    var action = new TaskWorkflowActionsUpdateRequestModel()
    {
        TaskWorkflowActions = results.UpdateableTaskWorkflowActions
    };
    var actionUpdateResult = serviceClient.UpdateTaskWorkflowActions(sa, action);
    if (actionUpdateResult.IsSuccessful)
    {
        // WORKED!!
    }
}

UpdateTaskWorkflowActionStatus()

TIP

See also Task Custom Workflow Actions for more information on how to update task actions.

csharp
var actionModel = new TaskWorkflowActionUpdateRequestModel()
                  {
                      WorkflowAction = new TaskWorkflowActionUpdateModel()
                                       {
                                           ID = actionID,  // ps_actno from querystring
                                           TaskID = taskID,  // SigID from querystring
                                           IsCompleted = true  // Is they completed, set to true. If they didn't, set to false
                                       }
                  };

var actionResults = serviceClient.UpdateTaskWorkflowActionStatus(sa, actionModel);

if (actionResults.IsSuccessful)
{
    // if request was valid, you will receive a return URL to redirect back into Pronto process.
    // This will happen for both complete or cancelled options
    return Redirect(actionResults.ReturnUrl);
}
else
{
    // handle error
}