From 9846475056c9f0475be9b3622de2144ba7797296 Mon Sep 17 00:00:00 2001
From: Uncled1023
- The Teknik API is free for everyone to use, and is defined on a per service basis.
+ The Teknik API is free for all accounts to use, and is defined on a per service basis.
- For some services, you may be required to authenticate to access them, or to associate generated content with your account. In all cases, the same authentication methods can be used.
+ For all API services, you will be required to authenticate to access them. You can either authenticate using Oauth/OpenID Connect, or via an Auth Token. We advise to use OAuth in as many cases as possible, but when unable, Auth Tokens are persistent tokens that give you access to the API only.
+ To authenticate with OAuth or OpenID, you will need to create a client in your Developer Settings to authenticate against. Once created, you can interact with the authentication endpoint via any of the endpoints described in the discovery document. To authenticate with an Oauth Token, you need to generate one using the token endpoint. To learn more about obtaining a token, you can To authenticate with an Auth Token, you can generate tokens in your Developer SettingsTeknik API
The general API calls can be summarized as follows: @Url.SubRouteUrl("api", "Api.Index")/v@(Config.ApiConfig.Version)/Service/Action
Authentication
+
+ OAuth or OpenID Connect
+
OAuth2 token (sent in a header)
+ curl -H "Authorization: token OATH-TOKEN" @Url.SubRouteUrl("api", "Api.Index")/v@(Config.ApiConfig.Version)/
For example, if you're accessing the API via cURL, the following command would associate the create paste with your account. Just replace <OAUTH-TOKEN>
with your access token.
+ $ curl -H <OAUTH-TOKEN> --data code="Test" @Url.SubRouteUrl("api", "API.v1.Paste")
+
+ Auth Token (sent in a header)
+ curl -H "Authorization: AuthToken AUTH-TOKEN" @Url.SubRouteUrl("api", "Api.Index")/v@(Config.ApiConfig.Version)/
+
+
+ For example, if you're accessing the API via cURL, the following command would associate the create paste with your account. Just replace <XXXXXXXXXXXXXXXXXXXX>
with your Auth Token.
+ $ curl -H "AuthToken <XXXXXXXXXXXXXXXXXXXX>"" --data code="Test" @Url.SubRouteUrl("api", "API.v1.Paste")