This article provides an example of a message that is encrypted, compressed, and encoded.
Note that the
- account ("brand"),
- user,
- password, and
- (optional) encryption tags
must be populated with the values that are provided by Higher Logic Thrive Marketing Professional (Thrive Marketing Professional).
TIP: When dealing with encryption and compression, white space counts!
Start with the following 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>
Payload compression
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>
Result
Here is the result from the compression:
etc.
Additionally, a 4-byte header containing the length of the original string (451) must prefix the message:
(then continue with the compressed message from above)
etc.
Base-64 string conversion
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
NOTE: If you're not using encryption, skip the next two steps (encryption and string conversion) and refer to Result (compression only), below.
Encryption
Thrive Marketing Professional encrypts using this key:
1D432EBF6AF4022F603516F17902277A81AFC63CE8ABCDEF
Your encryption key will be different and provided to you upon request.
etc.
Base-64 string conversion
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:
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>
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>