Teknik API


The Teknik API is free for all accounts to use, and is defined on a per service basis.

The general API calls can be summarized as follows: https://api.teknik.io/v1/Service/Action

Authentication

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.

OAuth or OpenID Connect

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.


OAuth2 token (sent in a header)

To authenticate with an Oauth Token, you need to generate one using the token endpoint. To learn more about obtaining a token, you can

curl -H "Authorization: token OATH-TOKEN" https://api.teknik.io/v1/

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 "Authorization: token <OAUTH-TOKEN>" --data code="Test" https://api.teknik.io/v1/Paste

Auth Token (sent in a header)

To authenticate with an Auth Token, you can generate tokens in your Developer Settings

curl -H "Authorization: AuthToken AUTH-TOKEN" https://api.teknik.io/v1/

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 "Authorization: AuthToken <XXXXXXXXXXXXXXXXXXXX>" --data code="Test" https://api.teknik.io/v1/Paste


Responses

All responses are returned as json. The returned json can contain any of the following sections.

Results

{"result":{"<resultData>":"<value>"}}
Errors
{"error":{"message":"<errorMessage>"}}