Allow API to report only contacts with specific field data
Currently, if you want to generate a report via the API containing only those contacts with specific field data (i.e. contacts whose "zip" field contains "10001"), you must pull the entire contacts table, sort, and discard all contacts that are not a match. This request is to selectively pull only those contacts that match the specific field data requested.
This idea will be included in our new segmentation system.
Yes, we are planning / working on full segment manipulation via the API.
Jennifer Leone commented
Preston, please see Kwan's comment: "There is no API call for adding segment. If a field is really dynamic(such as ZIP), we should create 100,000 segment for all zip code manually, But this is nearly impossible." Will an addSegment call be created as well?
Onur, that is a very valid point. I will investigate getting a refreshSegment call or something analogous to that added to our API.
Onur Okyay commented
I also use the segment method to get the contacts with specific field data. But the main problem is refreshing the segment. We need a function to refresh the segment through the API. Without refreshing, reading the contacts from a segment is useless.
For example; I can create segment which filters contacts by a datetime field that has a value within last couple of hours. So manually refreshing a segment isn't feasible in such a case.
We are expanding the scope of coverage for segments to be able to include contacts with any status (active, transactional, bounced, unsubscribed, etc.).
So you should be able to use it for the reporting purposes that you are thinking of.
Jennifer Leone commented
"Segments are definitely the way to do this. We are looking at how we can provide an addSegment and updateSegment call via the API."
But don't segments only report active or bounced contacts? We were hoping to use such an API option for automated reporting purposes, regardless of status of the contact.
Marty Wesley commented
Segments are definitely the way to do this. We are looking at how we can provide an addSegment and updateSegment call via the API.
Kwan Woo Park commented
But, there is no API call for adding segment.
If a field is really dynamic(such as ZIP), we should create 100,000 segment for all zip code manually, But this is nearly impossible.
Ricardo Lowe commented
I think I can do this already using SegmentObject.
We can create a SegmentObject with SegmentRuleObjects containing the criteria we wish to search for. We can then call for ReadSegmentsResponse to the get the Contacts out of the SegmentObjects returned.