1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed API help page.

This commit is contained in:
Uncled1023 2021-12-06 19:31:49 -08:00
parent 80199b3ba7
commit 9450ebd33c

View File

@ -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 @@
<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>