Below is an example showing the many facets of the GridRequest documents. This example requests information about bounces from recently published mailings.
This example illustrates:
- Using single and multiple conditions
- Specifying a full day's worth of data using GTE and LT comparators
- Using the IN comparator with a Collection
- Requesting counts (in order to manage paging)
Request 1: Count of mailing instances from previous day
<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_instance"> <Conditions> <Condition> <Single> <DataElement>Mailing_Date</DataElement> <DataValue>2009-09-01</DataValue> <Comparator>GTE</Comparator> </Single> </Condition> <Condition> <Single> <DataElement>Mailing_Date</DataElement> <DataValue>2009-09-02</DataValue> <Comparator>LT</Comparator> </Single> </Condition> </Conditions> <ReturnFields> <DataElement>Count</DataElement> </ReturnFields> </Grid> </Grids> </GridRequest>
Response 1: Count of mailings
<?xml version="1.0" encoding="utf-16"?> <GridResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_instance"> <Record row="0"> <Fields> <Field element="count">6</Field> </Fields> </Record> </Grid> </Grids> </GridResponse>
Request 2: List of mailing instances from a single day
<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_instance"> <Conditions> <Condition> <Single> <DataElement>Mailing_Date</DataElement> <DataValue>2009-09-01</DataValue> <Comparator>GTE</Comparator> </Single> </Condition> <Condition> <Single> <DataElement>Mailing_Date</DataElement> <DataValue>2009-09-02</DataValue> <Comparator>LT</Comparator> </Single> </Condition> </Conditions> <ReturnFields> <DataElement>Mailing_ID</DataElement> <DataElement>Mailing_Instance_ID</DataElement> <DataElement>Mailing_Date</DataElement> <DataElement>Mailing_Subject</DataElement> </ReturnFields> <SortField order="asc">Mailing_Date</SortField> </Grid> </Grids> </GridRequest>
Response 2: When no rows are returned
<?xml version="1.0" encoding="utf-16"?> <GridResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_instance" /> </Grids> </GridResponse>
Response 2: List of two mailing instances
<?xml version="1.0" encoding="utf-16"?> <GridResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_instance"> <Record row="1"> <Fields> <Field element="mailing_id">134384</Field> <Field element="mailing_instance_id">1297889</Field> <Field element="mailing_date">2011-09-13T18:37:37.2630000Z</Field> <Field element="mailing_subject">Mailing one</Field> </Fields> </Record> <Record row="2"> <Fields> <Field element="mailing_id">134385</Field> <Field element="mailing_instance_id">1297891</Field> <Field element="mailing_date">2011-09-13T18:38:21.3700000Z</Field> <Field element="mailing_subject">Mailing two</Field> </Fields> </Record> </Grid> </Grids> </GridResponse>
Request 3: Count of mailing activity bounces rows to determine paging
<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_activity_bounces"> <Conditions> <Condition> <Collection> <DataElement>mailing_instance_id</DataElement> <DataValue>1297945</DataValue> <DataValue>478933</DataValue> <SetOperator>IN</SetOperator> </Collection> </Condition> </Conditions> <ReturnFields> <DataElement>Count</DataElement> </ReturnFields> </Grid> </Grids> </GridRequest>
Response 3: Count of mailing activity bounces
<?xml version="1.0" encoding="utf-16"?> <GridResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_activity_bounces"> <Record row="0"> <Fields> <Field element="count">92</Field> </Fields> </Record> </Grid> </Grids>
Request 4: First 50 rows of data for both mailing instances
<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/"> <Password>password</Password> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_activity_bounces"> <Conditions> <Condition> <Collection> <DataElement>mailing_instance_id</DataElement> <DataValue>1297945</DataValue> <DataValue>478933</DataValue> <SetOperator>IN</SetOperator> </Collection> </Condition> </Conditions> <ReturnFields> <DataElement>mailing_instance_id</DataElement> <DataElement>is_repeat_bounce</DataElement> <DataElement>is_hard_bounce</DataElement> <DataElement>is_soft_bounce</DataElement> <DataElement>user_id</DataElement> <DataElement>email</DataElement> </ReturnFields> <SortField order="asc">Email</SortField> <StartRow>1</StartRow> <NumberOfRows>50</NumberOfRows> </Grid> </Grids> </GridRequest>
Response 4: First 50 rows return bounce data of 135 total rows
<?xml version="1.0" encoding="utf-16"?> <GridResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_activity_bounces"> <Record row="1"> <Fields> <Field element="mailing_instance_id">1297945</Field> <Field element="is_repeat_bounce">0</Field> <Field element="is_hard_bounce">1</Field> <Field element="is_soft_bounce">0</Field> <Field element="user_id" /> <Field element="email">thisbounces1@gmail.com</Field> </Fields> </Record> <Record row="2"> <Fields> <Field element="mailing_instance_id">1297945</Field> <Field element="is_repeat_bounce">0</Field> <Field element="is_hard_bounce">1</Field> <Field element="is_soft_bounce">0</Field> <Field element="user_id" /> <Field element="email">thisbounces2@gmail.com</Field> </Fields> </Record> . . . <Record row="50"> <Fields> <Field element="mailing_instance_id">1297945</Field> <Field element="is_repeat_bounce">0</Field> <Field element="is_hard_bounce">1</Field> <Field element="is_soft_bounce">0</Field> <Field element="user_id" /> <Field element="email">thisbounces3@gmail.com</Field> </Fields> </Record> </Grid> </Grids> </GridResponse>
Request 5: Data for mailing instances (rows 51-100)
<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/"> <Password>password</Password> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_activity_bounces"> <Conditions> <Condition> <Collection> <DataElement>mailing_instance_id</DataElement> <DataValue>1297945</DataValue> <DataValue>478933</DataValue> <SetOperator>IN</SetOperator> </Collection> </Condition> </Conditions> <ReturnFields> <DataElement>mailing_instance_id</DataElement> <DataElement>is_repeat_bounce</DataElement> <DataElement>is_hard_bounce</DataElement> <DataElement>is_soft_bounce</DataElement> <DataElement>user_id</DataElement> <DataElement>email</DataElement> </ReturnFields> <SortField order="asc">Email</SortField> <StartRow>51</StartRow> <NumberOfRows>50</NumberOfRows> </Grid> </Grids> </GridRequest>
Response 5: Second 50 rows of bounce data
<?xml version="1.0" encoding="utf-16"?> <GridResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://partner.informz.net/aapi/2009/08/"> <Brand id="9999">Test Brand</Brand> <User>testuser</User> <Grids> <Grid type="mailing_activity_bounces"> <Record row="51"> <Fields> <Field element="mailing_instance_id">1297945</Field> <Field element="is_repeat_bounce">0</Field> <Field element="is_hard_bounce">1</Field> <Field element="is_soft_bounce">0</Field> <Field element="user_id" /> <Field element="email">thisbounces51@gmail.com</Field> </Fields> </Record> <Record row="52"> <Fields> <Field element="mailing_instance_id">1297945</Field> <Field element="is_repeat_bounce">0</Field> <Field element="is_hard_bounce">1</Field> <Field element="is_soft_bounce">0</Field> <Field element="user_id" /> <Field element="email">thisbounces52@gmail.com</Field> </Fields> </Record> <Record row="92"> <Fields> <Field element="mailing_instance_id">1297945</Field> <Field element="is_repeat_bounce">0</Field> <Field element="is_hard_bounce">1</Field> <Field element="is_soft_bounce">0</Field> <Field element="user_id" /> <Field element="email">thisbounces92@gmail.com</Field> </Fields> </Record> </Grid> </Grids> </GridResponse>