Update doc

This commit is contained in:
syuilo 2019-02-23 15:35:26 +09:00
parent 140c78e5a7
commit 78a69e3da8
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 66 additions and 79 deletions

View file

@ -267,6 +267,65 @@ const schemas = {
}
};
const desc = `
## Usage
APIはすべてPOSTでリクエスト/JSON形式です
APIは認証情報()\`i\`というパラメータでアクセストークンを添付してください。
###
####
> API
> ()
###
APIを利用する際にはMisskeyに発行してもらいます
#### 1.
Webサービス()Misskeyに登録します
[](/dev) >
:
| | |
|---|---|
| | |
| | |
| URL | URLを設定できますWebサービスである場合に有用です |
| | APIからアクセスできます |
使
> </p>
#### 2.
使
%API_URL%/auth/session/generate appSecret
JSONでPOSTです
URLが取得できるのでURLをブラウザで表示し
URLを設定している場合
URLに token
URLを設定していない場合(())
#### 3.
%API_URL%/auth/session/userkey :
| | | |
|---|---|---|
| appSecret | string | |
| token | string | |
+sha256したものAPIにリクエストできます
:
<pre><code>const i = sha256(userToken + secretKey);</code></pre>
`;
export function genOpenapiSpec(lang = 'ja-JP') {
const spec = {
openapi: '3.0.0',
@ -274,10 +333,15 @@ export function genOpenapiSpec(lang = 'ja-JP') {
info: {
version: 'v1',
title: 'Misskey API',
description: 'Misskey is a decentralized microblogging platform.',
description: '**Misskey is a decentralized microblogging platform.**\n\n' + desc,
'x-logo': { url: '/assets/api-doc.png' }
},
externalDocs: {
description: 'Repository',
url: 'https://github.com/syuilo/misskey'
},
servers: [{
url: config.api_url
}],