The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Shorten.cshtml 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. @model Teknik.Areas.Help.ViewModels.HelpViewModel
  2. <bundle src="css/help.min.css" append-version="true"></bundle>
  3. <div class="container">
  4. <ol class="breadcrumb">
  5. <li><a href="@Url.SubRouteUrl("help", "Help.Index")">Help Index</a></li>
  6. <li><a href="@Url.SubRouteUrl("help", "Help.API", new { version = string.Empty, service = string.Empty })">API</a></li>
  7. <li>v1</li>
  8. <li class="active"><a href="#">Url Shortening</a></li>
  9. </ol>
  10. <div class="row api">
  11. <h2><b>Url Shortening Service</b></h2>
  12. <hr>
  13. <p>This is a description of the API commands available for the Url Shortening service.</p>
  14. <h3>Shorten a Url</h3>
  15. <pre><code>POST @Url.SubRouteUrl("api", "API.v1.Shorten")</code></pre>
  16. <h4>Parameters</h4>
  17. <table>
  18. <thead>
  19. <tr>
  20. <th>Name</th>
  21. <th>Type</th>
  22. <th>Default</th>
  23. <th>Description</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <tr>
  28. <td>
  29. <code>url</code>
  30. </td>
  31. <td>
  32. <code>string</code>
  33. </td>
  34. <td>
  35. <var>NULL</var>
  36. </td>
  37. <td>
  38. <strong>Required</strong>
  39. The url you want to shorten. This url must be an absolute url.
  40. </td>
  41. </tr>
  42. <tr>
  43. <td>
  44. <code>doNotTrack</code>
  45. </td>
  46. <td>
  47. <code>bool</code>
  48. </td>
  49. <td>
  50. <var>false</var>
  51. </td>
  52. <td>
  53. If you do not want the api request to be tracked as defined in the privacy policy.
  54. </td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. <h4>Response</h4>
  59. <pre><code>{"result":{"shortUrl":"<var>shortened url</var>", "originalUrl":"<var>original url</var>"}}</code></pre>
  60. <table>
  61. <thead>
  62. <tr>
  63. <th>Name</th>
  64. <th>Type</th>
  65. <th>Description</th>
  66. </tr>
  67. </thead>
  68. <tbody>
  69. <tr>
  70. <td>
  71. <code>shortUrl</code>
  72. </td>
  73. <td>
  74. <code>string</code>
  75. </td>
  76. <td>
  77. The shortened url.
  78. </td>
  79. </tr>
  80. <tr>
  81. <td>
  82. <code>originalUrl</code>
  83. </td>
  84. <td>
  85. <code>string</code>
  86. </td>
  87. <td>
  88. The original url that was shortened.
  89. </td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <h4>Example</h4>
  94. <pre><code>$ curl --data "url=http://www.example.com/long/url/is/long" @Url.SubRouteUrl("api", "API.v1.Shorten")</code></pre>
  95. <p>
  96. This will shorten the supplied url.
  97. </p>
  98. </div>
  99. </div>