v1

latestOpenAPI 3.0.12026-07-2471135326.0 KB
links

Create Short URL

.

post/v2/links

Request body

longUrlstring required
<p>URL destination name.</p><p>Enter the URL link to which the short URL will redirect.</p>
dataobject
<p>This array can be used by the customer to enter and store additional information about the short URL.</p><p><b>This additional information must be set in JSON format at key/value level.</b></p><p>For example:</p><p><code>'data': { 'name': 'Elizabeth Smith', 'email': 'eli7218@mailpoof.com' }</code></p>
externalIdstring

Alphanumeric identifier used for reporting purposes.

domainstring
<p>Domain which short URL will belong to (string without http/https or /).</p><p>Enter the custom domain in case you have requested it from the support team.</p><p>By default is <code>'msgi.me'</code></p>
callbacksstring[]
<p>Webhook URL to notify about the events of the short URL.</p><p>The URL is the external callback where the events of the short URL will be registered and published. The following short URL status sent to your callback URL will be the status to be recorded in the callback once end user has clicked on the short URL:</p><p><ul></p><p><li><code>'open'</code>: End user clicked on the short URL link. </li></p></ul></p>

Example request

{
  "longUrl": "www.MyWebsite.com",
  "externalId": "123456789abcde",
  "domain": "domain.me",
  "callbacks": [
    "http://www.mycallback.com?id=123"
  ]
}

Response

Successfully created

Example response

{
  "meta": {
    "timestamp": 1597166699457,
    "transactionId": "70169d77-c165-4795-9932-35b8a3af96fb",
    "explain": "a descriptive text"
  },
  "data": {
    "id": "id",
    "longUrl": "wwww.mylongUrl.com",
    "externalId": "18",
    "callbacks": [
      "callbacks"
    ],
    "shortLink": "shortLink.me/wrh6Hn",
    "date": "2020-07-20T21:11:12.352Z"
  }
}