problem with subscribing users

Apr 19, 2011 at 12:36 PM

I am trying to subscribe users to a group of a list but I have trouble with it. The error count is 0 and no user is subscribed.

I have written the following lines of code :

	   listSubscribeInput input = new listSubscribeInput();
            input.api_AccessType = PerceptiveMCAPI.EnumValues.AccessType.Serial;
            input.api_CustomErrorMessages = true;
            input.api_MethodType = PerceptiveMCAPI.EnumValues.MethodType.POST;
            input.api_Validate = true;
            input.api_OutputType = PerceptiveMCAPI.EnumValues.OutputType.XML;
            input.parms.apikey = apikey;
            input.parms.id = List();
            input.parms.merge_vars.Add("EMAIL", "rahi_azhar@yahoo.com");

            List<listInterestGroupingsResults> results = GetGroups();

            List<interestGroupings> listInterest = new List<interestGroupings>();

            listInterestGroupingsResults res = results.Where(r => r.name == "Shezan").SingleOrDefault();
            
            interestGroupings interest = new interestGroupings();
            interest.id = res.grouping_id;
            interest.name = res.name;
            List<listInterestGroupingsGroups> grp = res.groups;
            interest.groups = new List<string> {"Shezan Twisr" };
            listInterest.Add(interest);
            
            input.parms.merge_vars.Add("GROUPINGS", listInterest);
            listSubscribe subscribe = new listSubscribe();
            listSubscribeOutput output = subscribe.Execute(input);

            if (output.api_ErrorMessages.Count > 0)
                Label1.Text = output.api_ErrorMessages.FirstOrDefault().error;

            Label1.Text = output.result.ToString();

Please let me know if I am doing any mistake or missing anything ?
Coordinator
Apr 19, 2011 at 6:16 PM

I'll need more info, like the raw request/response strings from the api output

and since I see you've turned on verification, you have to check for verification messages as well
you could be running into a verifcation issue -- in which case an api call is never performed
and so api_ErrorMessages.Count would of course be zero

-- or else turn off verification and see what api errors are returned, if any

if you leave verification on, I'll need to see the verification messages as well.

 

dbm