1

How can I get these contacts from the mobile connect app using the java fuel api?

enter image description here

1

Here's the answer to my question.

I have'nt figured out how to built in the filter for the data extension yet but you can loop throught the return values and pick it out manually.

ETResponse<ETDataExtension> response = client.retrieve(ETDataExtension.class);
            for (ETDataExtension etDataExtension : response.getObjects()) {
                System.out.println(
                " ID:" + etDataExtension.getId() +
                " Key:" + etDataExtension.getKey() +
                " Name:" + etDataExtension.getName()+
                " Description:" + etDataExtension.getDescription() +
                " Create Date:" + etDataExtension.getCreatedDate()+
                " Modified Date:" + etDataExtension.getModifiedDate());


                ETResponse<ETDataExtensionRow> etDataExtensionRowResponse = etDataExtension.select();
                List<ETResult<ETDataExtensionRow>> etDataExtensionRow = etDataExtensionRowResponse.getResults();

                for (Iterator iterator2 = etDataExtensionRow.iterator(); iterator2.hasNext();) {

                    ETResult<ETDataExtensionRow> etResult2 = (ETResult<ETDataExtensionRow>) iterator2.next();

                    Map<String, String> row = etResult2.getObject().getColumns();

                    Map<String, String> map = new HashMap<String, String>();
                    Iterator<Map.Entry<String, String>> entries = row.entrySet().iterator();
                    while (entries.hasNext()) {
                        Map.Entry<String, String> entry = entries.next();

                        if (etDataExtension.getName().contains("The Name of you data extension.")) {
                            System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
                        }
                    }
                }
|improve this answer|||||
  • @Justin Apostolellis – bwburch Mar 23 '15 at 16:37
0

You can specify the filter as a SQL WHERE like string, e.g.:

ETResponse<ETDataExtension> response = client.retrieve(ETDataExtension.class,
                                                       "name = 'this is a test'");

or

ETResponse<ETDataExtensionRow> response = dataExtension.select("value >= 42");

-ian

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.