Participant-Related Code Samples

InsertParticipants()

var req = new ParticipantInsertRequestModel()
{
    Participants = new List<object>
                    {
                        new ParticipantInsertModel()
                        {
                            TransactionID = 1234567890,
                            FullName = "Sally Smith"
                        }
                    }
};

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

GetParticipants()

var req = new ParticipantDetailsRequestModel()
{
    EnableLogging = false,
    IDs = new List<object> { 1234567890 },
    Includes = new ParticipantIncludesModel()
    {
        IncludeEmailNotifications = true,
        IncludeEmailTemplatePlaceholders = true,
        IncludeWorkflowActions = true,
        IncludeTasks = true
    }
};

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

GetParticipantsUpdateable()

var req = new ParticipantUpdateableRequestModel()
{
    IDs = new List<object> { 1234567890 }
};

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

UpdateParticipants()

var req = new ParticipantUpdateableRequestModel()
{
    IDs = new List<object> { 1234567890 }
};

var api = new ParticipantsUpdateableApi(myRestEndpointUrl);
var results = api.GetParticipantsUpdateable(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
    results.UpdateableParticipants[0].EmailAddress = "test@test.com";
    var updateModel = new ParticipantUpdateRequestModel()
    {
        Participants = results.UpdateableParticipants
    };

    var api = new ParticipantsApi(myRestEndpointUrl);
    var updateResults = api.UpdateParticipants(sa, updateModel);
    if (updateResults.IsSuccessful)
    {
        //do work...
    }
    else
    {
        //handle error
    }
}
else
{
    //handle error
}

ResendParticipantEmailNotifications()

var req = new ParticipantResendNotificationRequestModel()
{
    Participants = new List<object>
    {
        new ParticipantResendNotificationModel()
        {
            ID = 1234567890,
            EmailAddress = "corrected-email@some-domain.com"
        }
    }
};

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

GetParticipantEncryptedCredentials()

var req = new ParticipantEncryptedCredentialsRequestModel()
{
    Credentials = new List<object>
    {
        new ParticipantCredentialsModel()
        {
            ParticipantID = 1234567890,
            Password = "p@ssword123", //If your password is hashed, pass that instead.
            Username = "johnsmith"  //username is only required for RegisteredUser auth
        }
    }
};

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