Connecting TNZ with MarketDirect

Configure an existing MarketDirect Cross Media campaign to send SMS through TNZ using the SMS API.

Connect an existing MarketDirect Cross Media campaign to TNZ using its XML SMS configuration and the TNZ HTTP/S API.

Overview

  • MarketDirect uses its own public and private server keys; these are separate from the TNZ Sender and APIKey.
  • The legacy XML maps [PHONE] to the recipient and [TEXT] to the message.
  • The request uses https://api.tnz.co.nz/api/v2.04/HttpApi/SMS.
  • Menu names can vary by MarketDirect release; use the equivalent campaign and SMS configuration controls when necessary.

Set up the integration

In the TNZ Dashboard:

  1. Log into https://my.tnz.co.nz/
  2. Under Users, click on your Username.
  3. Toggle Enable API to On.
  4. Enable the Sender/APIKey.
  5. Save your Sender and APIKey values somewhere safe.

In MarketDirect:

  1. Open the campaign and select the appropriate Data Environment.
  2. Open Set Server Admin Keys and confirm the MarketDirect public and private keys supplied by MarketDirect are present.
  3. Open SMS Configuration.
  4. Paste the compatibility XML below. Replace only {YOUR_SENDER_HERE} and {YOUR_APIKEY_HERE} with the dedicated TNZ User's Sender and APIKey.
  5. Confirm that [PHONE] maps to the intended campaign mobile field and [TEXT] maps to the approved message text.
  6. Save the configuration. If MarketDirect provides a second SMS XML configuration, switch to it and apply the same reviewed XML.
<SMS Token="{YOUR_TOKEN_HERE}" FromNumber="0000" Url="https://api.tnz.co.nz/api/v2.04/HttpApi/SMS?sender={YOUR_SENDER_HERE}&amp;token={YOUR_APIKEY_HERE}&amp;number=[PHONE]&amp;message=[TEXT]" UseGsmEncoding="False">
<ReturnCode Value="200" Text="Message Sent." Success="yes" />
<ReturnCode Value="200 OK" Text="Message Sent." Success="yes" />
<ReturnCode Value="OK Thanks" Text="Message Sent." Success="yes" />
<ReturnCode Value="400" Text="Sending Failed. Incorrect syntax." />
<ReturnCode Value="BAD REQUEST" Text="Sending Failed. Incorrect syntax." />
<ReturnCode Value="500" Text="Server Error. Check the connection or TNZ service status." />
<ReturnCode Value="Internal Server Error" Text="Server Error. Check the connection or TNZ service status." />
</SMS>

Troubleshooting

MarketDirect reports a server error

Check the endpoint, internet connection, and TNZ service status before changing the XML.

Every request is rejected

Confirm the dedicated Sender/APIKey pair, URL encoding, and the [PHONE] and [TEXT] substitutions.

MarketDirect says sent but TNZ has no message

Review the ReturnCode mappings and confirm the request reached TNZ and produced a Message ID.

The documented menus are unavailable

Ask MarketDirect Support for the equivalent Data Environment, server-key, and SMS XML settings in your installed release.


Topics:   Installation

Start your free trial today!

Ready to revolutionise your messaging?
Connect with people anywhere - boost engagement, responses and conversations.

20 credits over 14-days. No obligation. No credit card required.