listUpdateMemberInput groupings

Dec 1, 2010 at 8:09 PM

Hi,

I was wondering if anyone knows how to add / upgrade goupings of a list member ? I couldnt find any property on the listUpdateMemberInput to update the groupings although there is an replace interests property.

Thanks a lot

Coordinator
Dec 1, 2010 at 8:30 PM

Hey josh,

what you're going to do is update the 'Groupings' entry in merge_vars (refer to listSubscribe() in the MC api doc)

here's a snippet of code that might help...

 

         input.parms.replace_interests = true;
         // ---- merge vars
         input.parms.merge_vars.Add( "FNAME", "Brian" );
         //
         List<interestGroupings> grps = new List<interestGroupings>();
         interestGroupings grp = new interestGroupings();
         grp.id = 6; grp.name = "My Interests"; grp.groups = new List<string> { "Surveys" };
         grps.Add( grp );
         grp = new interestGroupings();
         grp.id = 33; grp.name = ""; grp.groups = new List<string> { "dogs", "cats" };
         grps.Add( grp );
         grp = new interestGroupings();
         grp.id = 17; grp.name = ""; grp.groups = new List<string> { "Finance" };
         grps.Add( grp );
         //
         input.parms.merge_vars.Add( "groupings", grps );
         // execution
         listUpdateMember cmd = new listUpdateMember( input );
         listUpdateMemberOutput output = cmd.Execute();


you can specify grouping id, or by grouping name, (or both) to specify what you want to update - either works.

Hope that helps.

 

David

Dec 2, 2010 at 7:19 AM

Hi David,

thanks a lot we will have a look at it today!

Keep up the good work!