source: TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/WebApiTokens.openapi.yaml@ 462

Last change on this file since 462 was 462, checked in by alloc, 15 months ago

More OpenAPI specs added

File size: 4.2 KB
Line 
1openapi: 3.1.0
2info:
3 title: WebAPI Tokens
4 version: '1'
5
6components:
7 schemas:
8 TypeWebApiTokenName:
9 type: string
10
11 WebApiTokenElement:
12 type: object
13 properties:
14 name:
15 $ref: '#/components/schemas/TypeWebApiTokenName'
16 secret:
17 type: string
18 permissionLevel:
19 type: integer
20 description: Permission level of the token
21 required:
22 - name
23 - secret
24 - permissionLevel
25
26 WebApiTokenList:
27 type: array
28 items:
29 $ref: '#/components/schemas/WebApiTokenElement'
30
31
32 requestBodies:
33 WebApiTokenBodyIn:
34 content:
35 application/json:
36 schema:
37 type: object
38 properties:
39 secret:
40 string
41 permissionLevel:
42 type: integer
43 required:
44 - secret
45 - permissionLevel
46 required: true
47
48
49 parameters:
50 WebApiTokenNamePathParameter:
51 name: apiTokenName
52 in: path
53 required: true
54 schema:
55 $ref: '#/components/schemas/TypeWebApiTokenName'
56
57
58paths:
59 /api/webapitokens:
60 get:
61 tags:
62 - Permissions
63 summary: WebAPI token list
64 description: Fetch a list of all WebAPI tokens
65 operationId: WebApiTokens.get
66 responses:
67 200:
68 description: List of API tokens
69 content:
70 application/json:
71 schema:
72 type: object
73 properties:
74 data:
75 $ref: '#/components/schemas/WebApiTokenList'
76 meta:
77 $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
78 required:
79 - data
80 - meta
81 403:
82 $ref: './openapi.yaml#/components/responses/Unauthorized'
83 security:
84 - apiTokenName: [ ]
85 apiTokenSecret: [ ]
86 - sessionCookie: [ ]
87
88
89 /api/webapitokens/{apiTokenName}:
90# get:
91# tags:
92# - Permissions
93# summary: Marker show
94# description: Fetch a single defined map marker
95# operationId: blacklist.get.id
96# parameters:
97# - $ref: '#/components/parameters/MarkerIdParameter'
98# responses:
99# 200:
100# description: Single found marker
101# $ref: '#/components/responses/MarkersBodyOut'
102# 404:
103# description: Marker ID not found, errorCode will be 'ID_NOT_FOUND'
104# $ref: '#/components/responses/HttpEmptyEnvelopedResponse'
105
106 post:
107 tags:
108 - Permissions
109 summary: WebAPI token create
110 description: Create or update a WebAPI token
111 operationId: WebApiTokens.post.id
112 parameters:
113 - $ref: '#/components/parameters/WebApiTokenNamePathParameter'
114 requestBody:
115 $ref: '#/components/requestBodies/WebApiTokenBodyIn'
116 responses:
117 201:
118 description: Token created or updated
119 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
120 400:
121 description: Invalid request body, errorCode will be one of 'NO_NAME', 'NO_OR_INVALID_SECRET' or 'NO_OR_INVALID_PERMISSION_LEVEL'
122 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
123 403:
124 $ref: './openapi.yaml#/components/responses/Unauthorized'
125 security:
126 - apiTokenName: []
127 apiTokenSecret: []
128 - sessionCookie: []
129
130 delete:
131 tags:
132 - Permissions
133 summary: WebAPI token delete
134 description: Delete a single WebAPI token
135 operationId: WebApiTokens.delete.id
136 parameters:
137 - $ref: '#/components/parameters/WebApiTokenNamePathParameter'
138 responses:
139 204:
140 description: Deleted token
141 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
142 404:
143 description: Token not found
144 $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
145 403:
146 $ref: './openapi.yaml#/components/responses/Unauthorized'
147 security:
148 - apiTokenName: []
149 apiTokenSecret: []
150 - sessionCookie: []
Note: See TracBrowser for help on using the repository browser.