Paste Service


This is a description of the API commands available for the Paste service.

Submit a Paste

POST https://api.teknik.io/v1/Paste

Headers

Name Value Default Value Description
Authorization Basic Encoding.Base64(<username>:<token>) NULL Basic Authentication to associate the paste with your account.

Parameters

Name Type Default Description
code string NULL Required The text that will be submitted as the paste content.
title string NULL The title for the paste.
syntax string text
The syntax of the pasted code.

This can be one of the following:
expireUnit string never The expiration type for the paste. Possible values are view (Number of Views) or a date value minute, hour, day, month, year
expireLength int 1 The length of whatever unit you choose before the paste is deleted.
password string NULL Specify a password to encrypt and lock the paste with.
doNotTrack bool false If you do not want the api request to be tracked as defined in the privacy policy.

Response

{"result":{"id":id, "url":"url", "title":"title", "syntax":"text", "expiration":"datetime", "password":"password"}}
Name Type Description
id string The id of the paste.
url string The direct url to the paste.
title string The title of the paste.
syntax string The syntax of the pasted code.
expiration datetime The date of expiration of the paste.
password string The password of the paste.

Example

$ curl --data "title=Paste%20Title&expireUnit=view&expireLength=3" --data-urlencode "code=This is my test code." https://api.teknik.io/v1/Paste

This will submit the paste with a title and expiration when the paste has viewed 3 times.