Making the Call

Here is an example of a message that is encrypted, compressed, and encoded. The account, user, password, and encryption tags (if used) must be populated with the values supplied by Informz. When dealing with encryption and compression, white space counts!

Start with this message: 

<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/">
       <Password>password</Password>
       <Brand id="1234">My Brand</Brand>
       <User>informz</User>
       <Grids>
              <Grid type="mailing_instance">
                     <Conditions>
                           <Condition>
                                  <Single>
                                         <DataElement>Mailing_Date</DataElement>
                                         <DataValue>2011-09-01</DataValue>
                                         <Comparator>GTE</Comparator>
                                  </Single>
                           </Condition>
                           <Condition>
                                  <Single>
                                         <DataElement>Mailing_Date</DataElement>
                                         <DataValue>2011-09-02</DataValue>
                                         <Comparator>LT</Comparator>
                                  </Single>
                           </Condition>
                     </Conditions>
                     <ReturnFields>
                           <DataElement>Count</DataElement>
                     </ReturnFields>
              </Grid>
       </Grids>
</GridRequest>

Here is the payload that must be gzip-compressed (just the Grid node from above, with white space removed for the example, with a length of 451):

<Grid type="mailing_instance" xmlns="http://partner.informz.net/aapi/2009/08/"><Conditions><Condition>
<Single><DataElement>Mailing_Date</DataElement><DataValue>2011‑09‑01</DataValue>
<Comparator>GTE</Comparator></Single></Condition><Condition><Single>
<DataElement>Mailing_Date</DataElement><DataValue>2011‑09‑02</DataValue><Comparator>LT</Comparator>
</Single></Condition></Conditions><ReturnFields><DataElement>Count</DataElement></ReturnFields></Grid>

Here is the result from the compression:
                                [0]          31           byte
                                [1]          139         byte
                                [2]          8              byte
                                [3]          0              byte
                                [4]          0              byte
                                [5]          0              byte
                                [6]          0              byte
                                [7]          0              byte
                                [8]          4              byte
                                [9]          0              byte
                                [10]        236         byte

                                etc.

                                [315]      60           byte
                                [316]      195         byte
                                [317]      1              byte
                                [318]      0              byte
                                [319]      0              byte

Additionally, a 4-byte header containing the length of the original string (451) needs to prefix the message:

                                [0]          195         byte
                                [1]          1              byte
                                [2]          0              byte
                                [3]          0              byte

                                (then continue with the compressed message from above)

                                [4]          31           byte
                                [5]          139         byte
                                [6]          8              byte
                                [7]          0              byte
                                [8]          0              byte
                                [9]          0              byte
                                [10]        0              byte
                                [11]        0              byte
                                [12]        4              byte
                                [13]        0              byte
                                [14]        236         byte

                                etc.

                                [319]      60           byte
                                [320]      195         byte
                                [321]      1              byte
                                [322]      0              byte
                                [323]      0              byte

Finally, that byte array is converted to a base-64 string (compression is finished at this point):

wwEAAB+LCAAAAAAABADsvQdgHEmWJSYvbcp7f0r1StfgdKEIgGATJNiQQBDswYjN5pLsHWlHIymrKoHKZVZlXWYWQMztnbz33nvvvffee++997o7nU4n99
//P1xmZAFs9s5K2smeIYCqyB8/fnwfPyIef14Xs7S9XuWffbTIirJYXvz+xbJps+U0/yh9tyiXzWcfzdt29eju3VVWt8u8HhfL86pe
/GC8zNu7WbYq7u7t7Dy8u3Nw96OjxyfVcla0RbVsvN+PHr8muGV+9Php1manZb7Il+3RF9odfZY
/vut/w81+MivX+dHezu7u9s7D7Z1daSKfEugFYZO1VX30+ZvTx3e9vx
/fNZ3d9RD4RnHZG8Ll+ZtboOJ+Jxq9ytt1vXxW5OWsCVE6qdbLtoPL3bD5XUze0f8TAAD//9kAQzzDAQAA

If not using encryption, skip the next two steps.

Informz encrypts using this key: 1D432EBF6AF4022F603516F17902277A81AFC63CE8ABCDEF:

(Your encryption key will be different and provided to you upon request)

                                [0]          1              byte
                                [1]          100         byte
                                [2]          179         byte
                                [3]          10           byte
                                [4]          52           byte
                                [5]          92           byte
                                [6]          103         byte
                                [7]          151         byte
                                [8]          202         byte
                                [9]          98           byte
                                [10]        137         byte
                                [11]        125         byte
                                [12]        12           byte
                                [13]        170         byte
                                [14]        51           byte

                                etc.

                                [435]      11           byte
                                [436]      96           byte
                                [437]      91           byte
                                [438]      177         byte
                                [439]      167         byte

Convert it to a base-64 string:

AWSzCjRcZ5fKYol9DKozQdVNpX4fxArYS6RjGch1fL4Koq+ez7bSRa9taldckOS3f4WCgqsTzoUGW0yb1hGrlYia
/98SFF2q7Z23XemMTuZZ5I75Pe+7CQpx8teYevECwKQXRtehiFdzNZSb7k4rkurlSHjVLVqjlZWvUSOvO1ZOJ2UW+hIzji2SOetpVa17RH1Dphm5ETh30Lz9DY7xFNMJfW0XYso1F1zS9gJnYReXxTrg9036dC7L3mWn4gIP5PyRFH5
//a1Hxu3QqZmmzLFgXUZVXS/fMvm9eoZ2Umq4qW1LPyYLIEyo2VoxqgOOsR0
/jWJGIuEOPiNgh+SVqaH0FpW9mzpfwns9X6Ua+QdFBryzCKKJkAOF1BwCAKx6vqd71PL61q6KGBWoQhzaWH8BfLv0C60yVmv0yX0ySK
/K8F/zPUDWR5urb84CUpJMm0PJD2G5ptoAyUtCkgW3VA4eO0CDklODlKycK0HU66q25pBWLfb8mkBO9ND8oTGda4
/NE1sNZYTtr7mljCOn1OEG37ioGVLUG2BG1D4DS/50sr4EINJQtfwCI35u7R7PcmSBC2Bbsac=

And replace the payload of the XML message:

Final Result Compression ONLY:

<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/">
       <Password>password</Password>
       <Brand id="1234">My Brand</Brand>
       <User>informz</User>
       <Grids>wwEAAB+LCAAAAAAABADsvQdgHEmWJSYvbcp7f0r1StfgdKEIgGATJNiQQBDswYjN5pLsHWlHIymrKoHKZVZlXWYWQMztnbz33nvvvffee++997o7nU4n99
       //P1xmZAFs9s5K2smeIYCqyB8/fnwfPyIef14Xs7S9XuWffbTIirJYXvz+xbJps+U0/yh9tyiXzWcfzdt29eju3VVWt8u8HhfL86pe
       /GC8zNu7WbYq7u7t7Dy8u3Nw96OjxyfVcla0RbVsvN+PHr8muGV+9Php1manZb7Il+3RF9odfZY/vut/w81+MivX+dHezu7u9s7D7Z1daSKfEugFYZO1VX30+ZvTx3e9vx
       /fNZ3d9RD4RnHZG8Ll+ZtboOJ+Jxq9ytt1vXxW5OWsCVE6qdbLtoPL3bD5XUze0f8TAAD//9kAQzzDAQAA</Grids>
</GridRequest>

 Final Result Compression AND Encryption:

<GridRequest xmlns="http://partner.informz.net/aapi/2009/08/">
       <Password>password</Password>
       <Brand id="1234">My Brand</Brand>
       <User>informz</User>
       <Grids>AWSzCjRcZ5fKYol9DKozQdVNpX4fxArYS6RjGch1fL4Koq+ez7bSRa9taldckOS3f4WCgqsTzoUGW0yb1hGrlYia
       /98SFF2q7Z23XemMTuZZ5I75Pe+7CQpx8teYevECwKQXRtehiFdzNZSb7k4rkurlSHjVLVqjlZWvUSOvO1ZOJ2UW+hIzji2SOetpVa17RH1Dphm5ETh30Lz9DY7xFNMJfW0XYso1F1zS9gJnYReXxTrg9036dC7L3mWn4gIP5PyRFH5
       //a1Hxu3QqZmmzLFgXUZVXS/fMvm9eoZ2Umq4qW1LPyYLIEyo2VoxqgOOsR0
       /jWJGIuEOPiNgh+SVqaH0FpW9mzpfwns9X6Ua+QdFBryzCKKJkAOF1BwCAKx6vqd71PL61q6KGBWoQhzaWH8BfLv0C60yVmv0yX0ySK/K8F
       /zPUDWR5urb84CUpJMm0PJD2G5ptoAyUtCkgW3VA4eO0CDklODlKycK0HU66q25pBWLfb8mkBO9ND8oTGda4/NE1sNZYTtr7mljCOn1OEG37ioGVLUG2BG1D4DS
       /50sr4EINJQtfwCI35u7R7PcmSBC2Bbsac=</Grids>
</GridRequest>