mirror of
https://github.com/wekan/wekan.git
synced 2026-02-07 09:01:47 +01:00
v6.56
This commit is contained in:
parent
e7d1e2fc9c
commit
5c0a389fb9
10 changed files with 318 additions and 17 deletions
|
|
@ -7,7 +7,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>Wekan REST API v6.55</title>
|
||||
<title>Wekan REST API v6.56</title>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -1558,7 +1558,7 @@ var n=this.pipeline.run(e.tokenizer(t)),r=new e.Vector,i=[],o=this._fields.reduc
|
|||
<ul class="toc-list-h1">
|
||||
|
||||
<li>
|
||||
<a href="#wekan-rest-api" class="toc-h1 toc-link" data-title="Wekan REST API v6.55">Wekan REST API v6.55</a>
|
||||
<a href="#wekan-rest-api" class="toc-h1 toc-link" data-title="Wekan REST API v6.56">Wekan REST API v6.56</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
|
@ -1928,6 +1928,11 @@ var n=this.pipeline.run(e.tokenizer(t)),r=new e.Vector,i=[],o=this._fields.reduc
|
|||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#delete_user_token" class="toc-h2 toc-link" data-title="">delete_user_token</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#get_current_user" class="toc-h2 toc-link" data-title="">get_current_user</a>
|
||||
|
||||
|
|
@ -2156,7 +2161,7 @@ var n=this.pipeline.run(e.tokenizer(t)),r=new e.Vector,i=[],o=this._fields.reduc
|
|||
<div class="page-wrapper">
|
||||
<div class="dark-box"></div>
|
||||
<div class="content">
|
||||
<h1 id="wekan-rest-api">Wekan REST API v6.55</h1>
|
||||
<h1 id="wekan-rest-api">Wekan REST API v6.56</h1>
|
||||
<blockquote>
|
||||
<p>Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.</p>
|
||||
</blockquote>
|
||||
|
|
@ -16358,6 +16363,265 @@ System.out.println(response.toString());
|
|||
To perform this operation, you must be authenticated by means of one of the following methods:
|
||||
UserSecurity
|
||||
</aside>
|
||||
<h2 id="delete_user_token">delete_user_token</h2>
|
||||
<p><a id="opIddelete_user_token"></a></p>
|
||||
<blockquote>
|
||||
<p>Code samples</p>
|
||||
</blockquote>
|
||||
<pre class="highlight tab tab-shell"><code><span class="hljs-comment"># You can also use wget</span>
|
||||
curl -X POST /api/deletetoken \
|
||||
-H <span class="hljs-string">'Content-Type: multipart/form-data'</span> \
|
||||
-H <span class="hljs-string">'Accept: application/json'</span> \
|
||||
-H <span class="hljs-string">'Authorization: API_KEY'</span>
|
||||
|
||||
</code></pre>
|
||||
<pre class="highlight tab tab-http"><code><span class="hljs-keyword">POST</span> <span class="hljs-string">/api/deletetoken</span> <span class="hljs-meta">HTTP/1.1</span>
|
||||
|
||||
<span class="fortran">Content-<span class="hljs-keyword">Type</span>: multipart/<span class="hljs-keyword">form</span>-<span class="hljs-keyword">data</span>
|
||||
Accept: application/json
|
||||
|
||||
</span></code></pre>
|
||||
<pre class="highlight tab tab-javascript"><code><span class="hljs-keyword">const</span> inputBody = <span class="hljs-string">'{
|
||||
"userId": "string",
|
||||
"token": "string"
|
||||
}'</span>;
|
||||
<span class="hljs-keyword">const</span> headers = {
|
||||
<span class="hljs-string">'Content-Type'</span>:<span class="hljs-string">'multipart/form-data'</span>,
|
||||
<span class="hljs-string">'Accept'</span>:<span class="hljs-string">'application/json'</span>,
|
||||
<span class="hljs-string">'Authorization'</span>:<span class="hljs-string">'API_KEY'</span>
|
||||
};
|
||||
|
||||
fetch(<span class="hljs-string">'/api/deletetoken'</span>,
|
||||
{
|
||||
<span class="hljs-attr">method</span>: <span class="hljs-string">'POST'</span>,
|
||||
<span class="hljs-attr">body</span>: inputBody,
|
||||
<span class="hljs-attr">headers</span>: headers
|
||||
})
|
||||
.then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">res</span>) </span>{
|
||||
<span class="hljs-keyword">return</span> res.json();
|
||||
}).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">body</span>) </span>{
|
||||
<span class="hljs-built_in">console</span>.log(body);
|
||||
});
|
||||
|
||||
</code></pre>
|
||||
<pre class="highlight tab tab-javascript--nodejs"><code><span class="hljs-keyword">const</span> fetch = <span class="hljs-built_in">require</span>(<span class="hljs-string">'node-fetch'</span>);
|
||||
<span class="hljs-keyword">const</span> inputBody = {
|
||||
<span class="hljs-string">"userId"</span>: <span class="hljs-string">"string"</span>,
|
||||
<span class="hljs-string">"token"</span>: <span class="hljs-string">"string"</span>
|
||||
};
|
||||
<span class="hljs-keyword">const</span> headers = {
|
||||
<span class="hljs-string">'Content-Type'</span>:<span class="hljs-string">'multipart/form-data'</span>,
|
||||
<span class="hljs-string">'Accept'</span>:<span class="hljs-string">'application/json'</span>,
|
||||
<span class="hljs-string">'Authorization'</span>:<span class="hljs-string">'API_KEY'</span>
|
||||
};
|
||||
|
||||
fetch(<span class="hljs-string">'/api/deletetoken'</span>,
|
||||
{
|
||||
<span class="hljs-attr">method</span>: <span class="hljs-string">'POST'</span>,
|
||||
<span class="hljs-attr">body</span>: <span class="hljs-built_in">JSON</span>.stringify(inputBody),
|
||||
<span class="hljs-attr">headers</span>: headers
|
||||
})
|
||||
.then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">res</span>) </span>{
|
||||
<span class="hljs-keyword">return</span> res.json();
|
||||
}).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">body</span>) </span>{
|
||||
<span class="hljs-built_in">console</span>.log(body);
|
||||
});
|
||||
|
||||
</code></pre>
|
||||
<pre class="highlight tab tab-ruby"><code><span class="hljs-keyword">require</span> <span class="hljs-string">'rest-client'</span>
|
||||
<span class="hljs-keyword">require</span> <span class="hljs-string">'json'</span>
|
||||
|
||||
headers = {
|
||||
<span class="hljs-string">'Content-Type'</span> => <span class="hljs-string">'multipart/form-data'</span>,
|
||||
<span class="hljs-string">'Accept'</span> => <span class="hljs-string">'application/json'</span>,
|
||||
<span class="hljs-string">'Authorization'</span> => <span class="hljs-string">'API_KEY'</span>
|
||||
}
|
||||
|
||||
result = RestClient.post <span class="hljs-string">'/api/deletetoken'</span>,
|
||||
<span class="hljs-symbol">params:</span> {
|
||||
}, <span class="hljs-symbol">headers:</span> headers
|
||||
|
||||
p JSON.parse(result)
|
||||
|
||||
</code></pre>
|
||||
<pre class="highlight tab tab-python"><code><span class="hljs-keyword">import</span> requests
|
||||
headers = {
|
||||
<span class="hljs-string">'Content-Type'</span>: <span class="hljs-string">'multipart/form-data'</span>,
|
||||
<span class="hljs-string">'Accept'</span>: <span class="hljs-string">'application/json'</span>,
|
||||
<span class="hljs-string">'Authorization'</span>: <span class="hljs-string">'API_KEY'</span>
|
||||
}
|
||||
|
||||
r = requests.post(<span class="hljs-string">'/api/deletetoken'</span>, headers = headers)
|
||||
|
||||
<span class="hljs-built_in">print</span>(r.json())
|
||||
|
||||
</code></pre>
|
||||
<pre class="highlight tab tab-java"><code>URL obj = <span class="hljs-keyword">new</span> URL(<span class="hljs-string">"/api/deletetoken"</span>);
|
||||
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
|
||||
con.setRequestMethod(<span class="hljs-string">"POST"</span>);
|
||||
<span class="hljs-keyword">int</span> responseCode = con.getResponseCode();
|
||||
BufferedReader in = <span class="hljs-keyword">new</span> BufferedReader(
|
||||
<span class="hljs-keyword">new</span> InputStreamReader(con.getInputStream()));
|
||||
String inputLine;
|
||||
StringBuffer response = <span class="hljs-keyword">new</span> StringBuffer();
|
||||
<span class="hljs-keyword">while</span> ((inputLine = in.readLine()) != <span class="hljs-keyword">null</span>) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
in.close();
|
||||
System.out.println(response.toString());
|
||||
|
||||
</code></pre>
|
||||
<pre class="highlight tab tab-go"><code><span class="hljs-keyword">package</span> main
|
||||
|
||||
<span class="hljs-keyword">import</span> (
|
||||
<span class="hljs-string">"bytes"</span>
|
||||
<span class="hljs-string">"net/http"</span>
|
||||
)
|
||||
|
||||
<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {
|
||||
|
||||
headers := <span class="hljs-keyword">map</span>[<span class="hljs-keyword">string</span>][]<span class="hljs-keyword">string</span>{
|
||||
<span class="hljs-string">"Content-Type"</span>: []<span class="hljs-keyword">string</span>{<span class="hljs-string">"multipart/form-data"</span>},
|
||||
<span class="hljs-string">"Accept"</span>: []<span class="hljs-keyword">string</span>{<span class="hljs-string">"application/json"</span>},
|
||||
<span class="hljs-string">"Authorization"</span>: []<span class="hljs-keyword">string</span>{<span class="hljs-string">"API_KEY"</span>},
|
||||
}
|
||||
|
||||
data := bytes.NewBuffer([]<span class="hljs-keyword">byte</span>{jsonReq})
|
||||
req, err := http.NewRequest(<span class="hljs-string">"POST"</span>, <span class="hljs-string">"/api/deletetoken"</span>, data)
|
||||
req.Header = headers
|
||||
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
<span class="hljs-comment">// ...</span>
|
||||
}
|
||||
|
||||
</code></pre>
|
||||
<pre class="highlight tab tab-php"><code> <span class="hljs-string">'multipart/form-data'</span>,
|
||||
<span class="hljs-string">'Accept'</span> => <span class="hljs-string">'application/json'</span>,
|
||||
<span class="hljs-string">'Authorization'</span> => <span class="hljs-string">'API_KEY'</span>,
|
||||
);
|
||||
|
||||
<span class="hljs-variable">$client</span> = <span class="hljs-keyword">new</span> \GuzzleHttp\Client();
|
||||
|
||||
<span class="hljs-comment">// Define array of request body.</span>
|
||||
<span class="hljs-variable">$request_body</span> = <span class="hljs-keyword">array</span>();
|
||||
|
||||
<span class="hljs-keyword">try</span> {
|
||||
<span class="hljs-variable">$response</span> = <span class="hljs-variable">$client</span>->request(<span class="hljs-string">'POST'</span>,<span class="hljs-string">'/api/deletetoken'</span>, <span class="hljs-keyword">array</span>(
|
||||
<span class="hljs-string">'headers'</span> => <span class="hljs-variable">$headers</span>,
|
||||
<span class="hljs-string">'json'</span> => <span class="hljs-variable">$request_body</span>,
|
||||
)
|
||||
);
|
||||
print_r(<span class="hljs-variable">$response</span>->getBody()->getContents());
|
||||
}
|
||||
<span class="hljs-keyword">catch</span> (\GuzzleHttp\<span class="hljs-built_in">Exception</span>\BadResponseException <span class="hljs-variable">$e</span>) {
|
||||
<span class="hljs-comment">// handle exception or api errors.</span>
|
||||
print_r(<span class="hljs-variable">$e</span>->getMessage());
|
||||
}
|
||||
|
||||
<span class="hljs-comment">// ...</span>
|
||||
|
||||
</code></pre>
|
||||
<p><code>POST /api/deletetoken</code></p>
|
||||
<p><em>Delete one or all user token.</em></p>
|
||||
<p>Only the admin user (the first user) can call the REST API.</p>
|
||||
<blockquote>
|
||||
<p>Body parameter</p>
|
||||
</blockquote>
|
||||
<pre class="highlight tab tab-yaml"><code><span class="hljs-attr">userId:</span> <span class="hljs-string">string</span>
|
||||
<span class="hljs-attr">token:</span> <span class="hljs-string">string</span>
|
||||
|
||||
</code></pre>
|
||||
<h3 id="delete_user_token-parameters">Parameters</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>In</th>
|
||||
<th>Type</th>
|
||||
<th>Required</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>body</td>
|
||||
<td>body</td>
|
||||
<td>object</td>
|
||||
<td>true</td>
|
||||
<td>none</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>» userId</td>
|
||||
<td>body</td>
|
||||
<td>string</td>
|
||||
<td>true</td>
|
||||
<td>the user ID</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>» token</td>
|
||||
<td>body</td>
|
||||
<td>string</td>
|
||||
<td>true</td>
|
||||
<td>the user hashedToken</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<blockquote>
|
||||
<p>Example responses</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>200 Response</p>
|
||||
</blockquote>
|
||||
<pre class="highlight tab tab-json"><code>{
|
||||
<span class="hljs-attr">"message"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
</code></pre>
|
||||
<h3 id="delete_user_token-responses">Responses</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<th>Meaning</th>
|
||||
<th>Description</th>
|
||||
<th>Schema</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>200</td>
|
||||
<td><a href="https://tools.ietf.org/html/rfc7231#section-6.3.1">OK</a></td>
|
||||
<td>200 response</td>
|
||||
<td>Inline</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="delete_user_token-responseschema">Response Schema</h3>
|
||||
<p>Status Code <strong>200</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Required</th>
|
||||
<th>Restrictions</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>» message</td>
|
||||
<td>string</td>
|
||||
<td>false</td>
|
||||
<td>none</td>
|
||||
<td>none</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="warning">
|
||||
To perform this operation, you must be authenticated by means of one of the following methods:
|
||||
UserSecurity
|
||||
</aside>
|
||||
<h2 id="get_current_user">get_current_user</h2>
|
||||
<p><a id="opIdget_current_user"></a></p>
|
||||
<blockquote>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
swagger: '2.0'
|
||||
info:
|
||||
title: Wekan REST API
|
||||
version: v6.55
|
||||
version: v6.56
|
||||
description: |
|
||||
The REST API allows you to control and extend Wekan with ease.
|
||||
|
||||
|
|
@ -2497,6 +2497,43 @@ paths:
|
|||
properties:
|
||||
_id:
|
||||
type: string
|
||||
/api/deletetoken:
|
||||
post:
|
||||
operationId: delete_user_token
|
||||
summary: Delete one or all user token.
|
||||
description: |
|
||||
Only the admin user (the first user) can call the REST API.
|
||||
tags:
|
||||
- Users
|
||||
consumes:
|
||||
- multipart/form-data
|
||||
- application/json
|
||||
parameters:
|
||||
- name: userId
|
||||
in: formData
|
||||
description: |
|
||||
the user ID
|
||||
type: string
|
||||
required: true
|
||||
- name: token
|
||||
in: formData
|
||||
description: |
|
||||
the user hashedToken
|
||||
type: string
|
||||
required: true
|
||||
produces:
|
||||
- application/json
|
||||
security:
|
||||
- UserSecurity: []
|
||||
responses:
|
||||
'200':
|
||||
description: |-
|
||||
200 response
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
/api/user:
|
||||
get:
|
||||
operationId: get_current_user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue