//[[restapi:start|RESTful API]]//
~~NOTOC~~
====== Send a Smart URL ======
==== Previous Versions ====
[[restapi:send_a_smart_url_3_34|Tag 34]]
==== 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 [[misc:otto|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 [[restapi:appx_ciphering|Base64 encoded]]. |
| to | Recipient's mobile number. This parameter must be [[restapi:appx_ciphering|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 [[restapi:appx_ciphering|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 [[misc:otto|ticketing tool]], you will need to provide your Mobile Engagement Campaign Manager's URL and your user login// |
| signature | The unique [[restapi:appx_ciphering#SHA256 - Cipher|SHA256]] signature for this call, it's involve all input parameters. To learn about generating the correct signature please visit our [[restapi:appx_call_ex|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 [[restapi:appx_resp_xml|Response XML Basics]] section if you want to learn more about the response parts.
createRedirectURL
OKCompletedhttps://api.messangi.com/rest/message/executeRedirect/d43ffe13-2http://messangi.com/r/d43ffe13-2https://api.messangi.com/messangi-staging/content/scratchcards/cards/7da380f4-f2e6-4c81-w11c-194fe657c3100588754853330CAMPAINGNAMED79BFFVx2TjXcJrrnktB0truefalse2015-11-07T10:44:03.327-05:00param0=MYQRCODEPlease be aware that the **////** 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 [[restapi:appx_date#date_format_-_pattern_letters|pattern letters]] quick reference |
| url.parameters | Aditional parameters | Web parameters |