Skip to content

Latest commit

 

History

History
242 lines (176 loc) · 3.86 KB

API.md

File metadata and controls

242 lines (176 loc) · 3.86 KB

API Documentation

Table of Contents Created by gh-md-toc

Get

Request

GET api.pasteme.cn/:key

Params

Name Type Description
key string Paste key

Response

Headers

Content-Type: application/json

Body

Params
Name Type Description
status int request status code
lang string Paste content's language
content text Paste content
Example
{
  "status": 200,
  "lang": "bash",
  "content": "echo Hello"
}

Create

Request

Method URL Description
POST api.pasteme.cn Create a permanent paste
POST api.pasteme.cn/once Create a temporary paste with random key

Headers

Content-Type: application/json

Body

Params
Name Type Description Required
lang string Paste content's language Yes
content text Paste's content Yes
password string Paste's password No
Example
{
  "lang": "bash",
  "content": "echo Hello"
}

or

{
  "lang": "bash",
  "content": "echo Hello",
  "password": "password"
}

Response

Headers

Content-Type: application/json

Body

Params
Name Type Description
status string Request status code
key string Paste's key
Example
{
  "status": 201,
  "key": "100"
}

Custom temporary key

Request

PUT api.pasteme.cn/:key

Params

Name Type Description
key string Paste key

Headers

Content-Type: application/json

Body

Params
Name Type Description Required
lang string Paste content's language Yes
content text Paste's content Yes
password string Paste's password No
Example
{
  "lang": "bash",
  "content": "echo Hello"
}

or

{
  "lang": "bash",
  "content": "echo Hello",
  "password": "password"
}

Response

Headers

Content-Type: application/json

Body

Params
Name Type Description
status string Request status code
key string Paste's key
Example
{
  "status": 201,
  "key": "100"
}

Error

Response

Headers

Content-Type: application/json

Body

Params
Name Type Description
status int Request status code
error string Error content
message string Error's detail
Example
{
  "status": 401,
  "error":   "unauthorized",
  "message": "wrong password"
}