RESTful API

Blast a Smart URL

Overview

Generate a short URL to redirect a user to a given destination allowing the API to keep track about the user interaction. This method will blast the URL to a list of recipients.

URL

Parameters on the following URL are inside braces { }

{base_url}/rest/api/tools/createRedirectURLBatch/{instanceId}/{redirectURL}/{oneTime}/{externalId}/{type}/{idType}/{publicKey}/{signature}

Please note that on the URL you won't see any POST parameters, only the regular parameters
All POST parameters will be highlighted in the following table.

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 to from Facebook after registration finished. 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 )
to
POST
Recipients who will receive the message. Please read the basic phone list file guidelines for more information about this text file
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>createRedirectURLBatch</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>
		<to>13056708084</to>
	</url>
 
	...
	<url>
		<fullUrl>https://api.messangi.com/rest/message/executeRedirect/d43ffe13-2</fullUrl>
		<shortUrl>http://messangi.com/r/d43ffe13-2</shortUrl>
		<to>18133210984</to>
	</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.to Recipient's mobile number Text

Activate a Smart URL

Overview

Smart URL can be turned on or off any time, use this method to turn on a smart URL.

URL

Parameters on the following URL are inside braces { }

{base_url}/rest/api/tools/activateRedirectURL/{instanceId}/{id}/{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
id Smart URL's id
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>activateRedirectURL</input>
<status>OK</status>
<description>Completed</description>
<result>
	<transactionResult> 
		<successful>true</successful>
		<message>Redirect Url activated</message>
	</transactionResult>
</result>
Result parameters
Parameter Name Description Possible Values
successful Indicates if the URL was activated true
false
message A human readable explanation Text

Deactivate a Smart URL

Overview

Smart URL can be turned on or off any time, use this method to turn off a smart URL.

URL

Parameters on the following URL are inside braces { }

{base_url}/rest/api/tools/deactivateRedirectURL/{instanceId}/{id}/{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
id Smart URL's id
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>deactivateRedirectURL</input>
<status>OK</status>
<description>Completed</description>
<result>
	<transactionResult> 
		<successful>true</successful>
		<message>Redirect Url activated</message>
	</transactionResult>
</result>
Result parameters
Parameter Name Description Possible Values
successful Indicates if the URL was deactivated true
false
message A human readable explanation Text

Retrieve a Smart URL by Id

Overview

Retrieve a Smart URL configuration by its Id.

URL

Parameters on the following URL are inside braces { }

{base_url}/rest/api/tools/getRedirectURL/{instanceId}/{id}/{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
id Smart URL's id
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>getRedirectURL</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>
	  </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

Execute a Smart URL Redirection

Overview

Redirects the user (using HTTP redirect) to the configured URL that corresponds with the given Smart URL Id. If the URL is configured for just one execution, no further redirects will be allowed.

URL

Parameters on the following URL are inside braces { }

{base_url}/rest/api/tools/executeRedirect/{instanceId}/{id}/{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
id Smart URL's id
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

This method does not have any response, it just perform a web redirection.