Documentation / API v1
Table of content
POST /api/v1/lenpasteAdd
Request parameters:
Field | Required? | Default | Description |
---|---|---|---|
domain |
Yes | Only the domain name without specifying the protocol or port. Example: example.org . |
Response example:
1{
2 "ok": true
3}
GET /api/v1/lenpasteList
Response example:
1{
2 "scoreMax": {
3 "domainIsNotIP": 1,
4 "shortDomain": 6,
5 "httpToHttpsRedirect": 1,
6 "httpsSupport": 1,
7 "noBadThirdPartyProxy": 4,
8 "pasteTitleLenMax": 1,
9 "pasteBodyLenMax": 2,
10 "pasteLifetimeMax": 2,
11 "adminContacts": 2,
12 "aboutExist": 1,
13 "noDarkPatterns": 2,
14 "total": 23
15 },
16 "servers": [
17 {
18 "addTime": 1667107360,
19 "lastUpdateTime": 1667108993,
20 "nowOnline": true,
21 "lastOnline": 1667108993,
22 "score": 16,
23 "scoreDetails": {
24 "domainIsNotIP": 1,
25 "shortDomain": 0,
26 "httpToHttpsRedirect": 1,
27 "httpsSupport": 1,
28 "noBadThirdPartyProxy": 4,
29 "pasteTitleLenMax": 1,
30 "pasteBodyLenMax": 2,
31 "pasteLifetimeMax": 2,
32 "adminContacts": 2,
33 "aboutExist": 0,
34 "noDarkPatterns": 2
35 },
36 "domain": "example.org",
37 "domainIsIP": false,
38 "http": false,
39 "https": true,
40 "httpToHttpsRedirect": true,
41 "badThirdPartyProxy": false,
42 "version": "1.2",
43 "titleMax": 100,
44 "bodyMax": 20000,
45 "lifetimeMax": -1,
46 "adminName": true,
47 "adminMail": true,
48 "about": "",
49 "rules": false,
50 "termsOfUse": false,
51 "uiDefaultLifetime": false
52 }
53 ]
54}
GET /api/v1/getServerInfo
Response example:
1{
2 "software": "Lenmonitor",
3 "version": "0.1.1",
4 "adminName": "Vasya Pupkin",
5 "adminMail": "me@example.org"
6}
Possible API errors
This API method exists on the server, but you passed the wrong arguments for it. Or the execution ended with an error, unrelated to the server.
1{
2 "code": 400,
3 "error": "Bad Request"
4}
1{
2 "code": 400,
3 "error": "tester: failed to connect to server via HTTP or HTTPS"
4}
1{
2 "code": 400,
3 "error": "tester: HTTP server response code is different from 200 when requesting HTTP and HTTPS"
4}
1{
2 "code": 400,
3 "error": "tester: server uses an incompatible API"
4}
1{
2 "code": 400,
3 "error": "tester: private server"
4}
There is no such API method.
1{
2 "code": 404,
3 "error": "Not Found"
4}
You made a mistake with HTTP request (example: you made POST instead of GET).
1{
2 "code": 405,
3 "error": "Method Not Allowed"
4}
You have made too many requests, try again in 300 seconds. The Retry-After: 300
HTTP header will also be returned along with this error.
1{
2 "code": 429,
3 "error": "Too Many Requests"
4}
There was a failure on the server. Contact your server administrator to find out what the problem is.
1{
2 "code": 500,
3 "error": "Internal Server Error"
4}