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 Higher Logic Thrive Marketing Professional (Thrive Marketing Professional). 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:
etc.
Additionally, a 4-byte header containing the length of the original string (451) needs to prefix the message:
(then continue with the compressed message from above)
etc.
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.
Thrive Marketing Professional encrypts using this key: 1D432EBF6AF4022F603516F17902277A81AFC63CE8ABCDEF:
(Your encryption key will be different and provided to you upon request)
etc.
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>