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.
 
 
 
 
 

128 lines
4.2 KiB

@model Teknik.Areas.Help.ViewModels.HelpViewModel
<bundle src="css/help.min.css" append-version="true"></bundle>
<div class="container">
<ol class="breadcrumb">
<li><a href="@Url.SubRouteUrl("help", "Help.Index")">Help Index</a></li>
<li><a href="@Url.SubRouteUrl("help", "Help.API", new { version = string.Empty, service = string.Empty })">API</a></li>
<li>v1</li>
<li class="active"><a href="#">Url Shortening</a></li>
</ol>
<div class="row api">
<h2><b>Url Shortening Service</b></h2>
<hr>
<p>This is a description of the API commands available for the Url Shortening service.</p>
<h3>Shorten a Url</h3>
<pre><code>POST @Url.SubRouteUrl("api", "API.v1.Shortener")</code></pre>
<h4>Headers</h4>
<table>
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>Default Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>Authorization</code>
</td>
<td>
<code>Basic <i>Encoding.Base64</i>(&lt;username&gt;:&lt;token&gt;)</code>
</td>
<td>
<var>NULL</var>
</td>
<td>
Basic Authentication to associate the shortened url with your account.
</td>
</tr>
</tbody>
</table>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>url</code>
</td>
<td>
<code>string</code>
</td>
<td>
<var>NULL</var>
</td>
<td>
<strong>Required</strong>
The url you want to shorten. This url must be an absolute url.
</td>
</tr>
<tr>
<td>
<code>doNotTrack</code>
</td>
<td>
<code>bool</code>
</td>
<td>
<var>false</var>
</td>
<td>
If you do not want the api request to be tracked as defined in the privacy policy.
</td>
</tr>
</tbody>
</table>
<h4>Response</h4>
<pre><code>{"result":{"shortUrl":"<var>shortened url</var>", "originalUrl":"<var>original url</var>"}}</code></pre>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>shortUrl</code>
</td>
<td>
<code>string</code>
</td>
<td>
The shortened url.
</td>
</tr>
<tr>
<td>
<code>originalUrl</code>
</td>
<td>
<code>string</code>
</td>
<td>
The original url that was shortened.
</td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<pre><code>$ curl --data "url=http://www.example.com/long/url/is/long" @Url.SubRouteUrl("api", "API.v1.Shortener")</code></pre>
<p>
This will shorten the supplied url.
</p>
</div>
</div>