Browse Source

Fixed API help page.

master
Teknikode 7 months ago
parent
commit
9450ebd33c
  1. 8
      Teknik/Areas/Help/Views/Help/API/API.cshtml

8
Teknik/Areas/Help/Views/Help/API/API.cshtml

@ -36,15 +36,13 @@ @@ -36,15 +36,13 @@
<h4>OAuth or OpenID Connect</h4>
<p>To authenticate with OAuth or OpenID, you will need to create a client in your <a href="@Url.SubRouteUrl("account", "User.ClientSettings")">Developer Settings</a> to authenticate against. Once created, you can interact with the authentication endpoint via any of the endpoints described in the <a href="https://auth.teknik.io/.well-known/openid-configuration">discovery document</a>.</p>
<br />
<br />
<h4>OAuth2 token (sent in a header)</h4>
<p>To authenticate with an Oauth Token, you need to generate one using the <a href="https://auth.teknik.io/connect/token">token endpoint</a>. To learn more about obtaining a token, you can </p>
<code>curl -H "Authorization: token <i>OATH-TOKEN</i>" @Url.SubRouteUrl("api", "Api.Index")/v@(Config.ApiConfig.Version)/</code>
<br />
<br />
For example, if you're accessing the API via cURL, the following command would associate the create paste with your account. Just replace <code>&lt;OAUTH-TOKEN&gt;</code> with your access token.
<pre><code>$ curl -H &lt;OAUTH-TOKEN&gt; --data code="Test" @Url.SubRouteUrl("api", "API.v1.Paste")</code></pre>
<br />
<pre><code>$ curl -H "Authorization: token &lt;OAUTH-TOKEN&gt;"" --data code="Test" @Url.SubRouteUrl("api", "API.v1.Paste")</code></pre>
<br />
<h4>Auth Token (sent in a header)</h4>
<p>To authenticate with an Auth Token, you can generate tokens in your <a href="@Url.SubRouteUrl("account", "User.AuthTokenSettings")">Developer Settings</a></p>
@ -52,7 +50,9 @@ @@ -52,7 +50,9 @@
<br />
<br />
For example, if you're accessing the API via cURL, the following command would associate the create paste with your account. Just replace <code>&lt;XXXXXXXXXXXXXXXXXXXX&gt;</code> with your Auth Token.
<pre><code>$ curl -H "AuthToken &lt;XXXXXXXXXXXXXXXXXXXX&gt;"" --data code="Test" @Url.SubRouteUrl("api", "API.v1.Paste")</code></pre>
<pre><code>$ curl -H "Authorization: AuthToken &lt;XXXXXXXXXXXXXXXXXXXX&gt;"" --data code="Test" @Url.SubRouteUrl("api", "API.v1.Paste")</code></pre>
<br />
<br />
</p>
<h3>Responses</h3>
<p>

Loading…
Cancel
Save