I'm using the SFMC (soap) API in an application which automatically generates AmpScript for dynamic content. In order to allow the user to set up their dynamic content in my app (ready for SFMC) I'd like to find out distinct values for values in the attributes of subscribers. I've seen that I can get the Profile Attributes easily enough but the only way I can see to find the values is to fetch all of the subscribers (2500 at a time) to see what the values are. This seems like an inefficient approach, is there a better way?
If you're dealing with an Enterprise 2.0 account, you can write a Query Activity that selects distinct column values in _EnterpriseAttribute (one of the System Data Views). The Query Activity can be part of an Automation that refreshes the data on an interval.
Once the Data Extension is populated, you can retrieve the rows (DataExtensionObject) via API.