Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Getting the Grouping ID #162

Open
dorofino opened this issue Jul 11, 2015 · 1 comment
Open

Getting the Grouping ID #162

dorofino opened this issue Jul 11, 2015 · 1 comment

Comments

@dorofino
Copy link

Hi ,

On your documentation you mentioned to add your Group ID.
This ID is coming from where, MailChimp? if so the GroupID is a string and not a Int.

can some one help me with this, thanks

myMergeVars.Groupings[0].Id = 1234; // replace with your grouping id

@AmadeusW
Copy link

@dorofino here's the code I used to get all grouping information:

            MailChimpManager mc = new MailChimpManager(APIKEY);

            var lists = mc.GetLists().Data;
            foreach (var list in lists)
            {
                var listName = list.Name;
                var listId = list.Id;
                try
                {
                    // When a group has no interest groupings, an exception is thrown
                    var groupings = mc.GetListInterestGroupings(listId);

                    foreach (var grouping in groupings)
                    {
                        var groupingId = grouping.Id;
                        var innerGroups = grouping.GroupNames;
                        foreach (var innerGroup in innerGroups)
                        {
                            var gname = innerGroup.Name;
                            var gbit = innerGroup.Bit;
                        }
                    }
                }
                catch
                { }
            }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants