Skip to content
On this page

Group-Related Code Samples

GetGroups()

csharp
var req = new GroupDetailsRequestModel()
{
    ProntoIDs = new string[] 
    { 
        "MyAccountName"
    }
};

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

InsertGroups()

csharp
var req = new GroupInsertRequestModel()
{
    Groups = new List<object> 
    { 
        new GroupInsertModel()
        {
            Name = "Web Services Test Account",
            OwnerName = "Test Owner",
            OwnerEmail = "test@your-domain.com"
        }
    }
};

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

GetGroupsUpdateable()

csharp
var req = new GroupUpdateableRequestModel()
{
    ProntoIDs = new string[] 
    { 
        "MyAccountName"
    }
};

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

UpdateGroups()

csharp
var req = new GroupUpdateableRequestModel()
{
    ProntoIDs = new string[] 
    { 
        "MyAccountName"
    }
};

var api = new GroupsUpdateableApi(myRestEndpointUrl);
var results = api.GetGroupsUpdateable(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
	results.UpdateableGroups[0].OwnerEmail = "updated-email@your-domain.com";
    var updateModel = new GroupUpdateRequestModel()
	{
		Groups = results.UpdateableGroups
	};
    var api = new GroupsApi(myRestEndpointUrl);
	var updateResults = api.UpdateGroups(sa, updateModel);
	if (updateResults.IsSuccessful)
	{
		//do work...
	}
	else
	{
	    //handle error
	}
}
else
{
    //handle error
}

DeleteGroups()

csharp
var req = new GroupDeleteRequestModel()
{
    Groups = new List<object>
    { 
        new GroupDeleteModel()
        {
            ProntoID = "MyAccountName"
        }
    }
};

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