RESTful API

Send a Smart URL

Previous Versions

Overview

Generate a short URL to redirect a user to a given destination allowing the API to keep track about the user interaction.

URL

Parameters on the following URL are inside braces { }

{base_url}/rest/api/tools/createRedirectURL/{instanceId}/{redirectURL}/{to}/{oneTime}/{externalId}/{type}/{idType}/{parameters}/{publicKey}/{signature}
Parameter Name Description
instanceId An instance id is the workspace identification number, if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login
redirectURL The URL that users will be redirected when the smart URL is reached. This parameter must be Base64 encoded.
to Recipient's mobile number. This parameter must be Base64 encoded.
oneTime Indicates if a user can use this redirection more than once If true, the generated URL will only be valid for one use.
externalId ID defined for the user. This associated the url with external uses (an arbitrary string, can be a number).
type Type of object associated with the redirect. (Ex: The type could be “ScratchCard”)
idType Id of the object. (Ex: The IdType could be the ScratchCard's id )
parameters
OPTIONAL
Additional web parameters of the Redirect Url. This parameter must be Base64 encoded.
Write null on this placeholder to ignore this parameter
publicKey The public key to access this API. if you don't know yours please request it using our ticketing tool, you will need to provide your Mobile Engagement Campaign Manager's URL and your user login
signature The unique SHA256 signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our Java Example

Response

The Response XML is divided in a static part and a dynamic one, we call it dynamic because it will vary depending on the method you invoke. Please read our Response XML Basics section if you want to learn more about the response parts.

<input>createRedirectURL</input>
<status>OK</status>
<description>Completed</description>
<result>
	<url>
		<fullUrl>https://api.messangi.com/rest/message/executeRedirect/d43ffe13-2</fullUrl>
		<shortUrl>http://messangi.com/r/d43ffe13-2</shortUrl>
		<destinationURL>https://api.messangi.com/messangi-staging/content/scratchcards/cards/7da380f4-f2e6-4c81-w11c-194fe657c3100</destinationURL>
		<to>588754853330</to>
		<externalId>CAMPAINGNAME</externalId>
		<clientId>D79BFFVx2TjXcJrrnktB</clientId>
		<visits>0</visits>
		<oneTime>true</oneTime>
		<isActive>false</isActive>
		<clientDate>2015-11-07T10:44:03.327-05:00</clientDate>
		<parameters>
			<parameter>param0=MYQRCODE</parameter>
		</parameters>
	  </url>
</result>

Please be aware that the <url> tag and its content is a generic object and may apply to other responses in other methods.

Result parameters
Parameter Name Description Possible Values
url.fullUrl The real API URL. URL
url.shortUrl A short version of the URL that uses apache redirects to resolve to the API URL. URL
url.destinationURL URL where you will be redirected. URL
url.to Recipient's mobile number Text
url.externalId Campaign name which owns this Smart Url. Text
url.clientId The Client's identifier. Text
url.visits How many hits has received this Smart URL Number
url.oneTime true if the Smart URL is valid just for one time true
false
url.isActive true if the Smart URL is currently active true
false
url.clientDate Time mark at the origination moment A formatted date string: yyyy-MM-dd'T'HH:mm:ss.SSSZZ
For more information please review the pattern letters quick reference
url.parameters Aditional parameters Web parameters