Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ja:how_to_use_swagger_ui_and_postman_for_biostar_2_new_local_api [2021/05/31 11:51]
pjemoon created
ja:how_to_use_swagger_ui_and_postman_for_biostar_2_new_local_api [2021/06/01 14:10] (current)
pjemoon [Swagger UI]
Line 8: Line 8:
  
 **[REST APIのリクエストメソッド]** ​ \\ **[REST APIのリクエストメソッド]** ​ \\
-{{:ja:http_method.png?500|}} \\ \\+{{:ja:httpmethod1.png?400|}}\\ \\
  
 New Local APIの使用をお勧めします。以下のリンクでBioStar 2 New Local APIをご利用いただけます。\\ New Local APIの使用をお勧めします。以下のリンクでBioStar 2 New Local APIをご利用いただけます。\\
Line 15: Line 15:
 {{:​en:​newapi_1.png?​nolink&​700|}} \\ {{:​en:​newapi_1.png?​nolink&​700|}} \\
  
-We provide the information on BioStar 2 API through the Swagger UI so that you can check kinds of APIs and those model schemas before calling ​API. Below is an example for the way to utilize this tool by using login API.\\ \\ \\+APIを呼び出す前に、APIの種類とそれらのモデルスキーマを確認できます。以下は、ログインAPIを使用してサービスを利用する方法です。\\ \\ \\
  
-==== How to utilize ​Swagger UI ==== +==== Swagger UIの利用方法 ​==== 
   * <wrap em>POST /api/login API</​wrap>​   * <wrap em>POST /api/login API</​wrap>​
-1) Click ‘Try it out’ button which located in the right upper corner to edit the request body. \\ +1) 右上にある[Try it out]ボタンをクリックして、リクエストボディを編集します。\\ 
-2) Enter the values to login BioStar 2\\ +2) BioStar 2のログイン情報を入力します。 ​\\ 
-3) After enter the values, click ‘Execute’ button in below the screen to check the result about response message. ​\\+3) 画面下の「Execute」ボタンをクリックして、レスポンスメッセージの結果を確認します。 ​\\
   ​   ​
 {{:​en:​newapi_2.png?​nolink&​700|}} \\ \\ \\ {{:​en:​newapi_2.png?​nolink&​700|}} \\ \\ \\
  
-==== How to utilize Postman with Swagger UI ====  +==== Swagger UIとPostmanを使用する方法 ​====  
-Postman ​is a utilize App which helps you confirm the result of calling ​API easily. We recommend you to use it. By using the postman, you can construct complex ​HTTP quickly, organize them in collections,​ and share them with your co-workers. +PostmanAPIコールの結果を簡単に確認できるアプリです。Postmanを使用すると、複雑なHTTPをすばやく作成し、コレクションに整理して、共有できます。 
-The biggest advantage is that the history you call API is remained.+APIコール履歴も残ります。
 \\ \\ \\ \\
-You can download the Postman ​through searching ​Google\\ +PostmanGoogleで検索してダウンロードできます。\\ 
-[[https://​www.postman.com/​downloads/​|Download ​Postman]] \\ \\+[[https://​www.postman.com/​downloads/​|Postmanダウンロード]] \\ \\
  
   * <wrap em>POST /api/login API</​wrap>​   * <wrap em>POST /api/login API</​wrap>​
-**  ​In the Swagger UI ..** \\ +**  Swagger UI** \\ 
-1) Copy all data shown in the body. \\ \\+1) ボディのデータをコピーします。\\ \\
  
  
-**In the Postman ​..** \\ +**Postman** \\ 
-2) Select ​POST in the dropbox and then enter the URL to call login API\\+2) ドロップボックスでPOSTを選択し、ログインAPIを呼び出すためのURLを入力します。 ​\\
 i.e) https://​192.128.16.35:​456/​api/​login \\ i.e) https://​192.128.16.35:​456/​api/​login \\
-3) Select ​Body – raw – JSON(application/​json). \\ +3) Body選択 ​– raw – JSON(application/​json). \\ 
-4) Paste the data copied from Swagger UI into the Postman\\ +4) Swagger UIからコピーしたデータをPostmanに貼り付けます。\\ 
-5) Enter the values to login. ​\\ +5) ログイン情報をを入力します。\\ 
-6) Click the Send button. ​\\ +6) Sendをクリックします。 ​\\ 
-7) The response result will be displayed at the bottom of the section. ​\\+7) レスポンス結果は、セクションの下部に表示されます。\\
  
 {{youtube>​1YoSg4qHjTA?​large}}\\ \\ {{youtube>​1YoSg4qHjTA?​large}}\\ \\
Line 50: Line 50:
   * <wrap em>GET /api/users API</​wrap>​   * <wrap em>GET /api/users API</​wrap>​
 **In the Postman ..** \\ **In the Postman ..** \\
-1) Execute login API in Postman\\ +1) PostmanでログインAPIを実行します。 ​\\ 
-2) If you succeed to login, copy the value of ‘bs-session-id’ in the response’s headers. ​\\ +2) ログインに成功したら、レスポンスのヘッダーにある「bs-session-id」の値をコピーします。 ​\\ 
-3) Select ​GET in the dropbox and then enter URL to call retrieving user API.\\+3) ドロップボックスでGETを選択してから、取得ユーザーAPIを呼び出すためのURLを入力します。\\
 i.e) https://​192.168.16.35:​456/​api/​users \\ i.e) https://​192.168.16.35:​456/​api/​users \\
-4) Select Headers and click ‘Bulk Edit’. \\ +4) [ヘッダー]を選択し、[Bulk Edit]をクリックします。 ​\\ 
-5) Enter the values such as below: ​\\ +5) 以下のように値を入力します。 ​\\ 
-bs-session-id:​[You copied value] \\+bs-session-id:​[2でコピーした値] \\
 content-type:​application/​json \\ content-type:​application/​json \\
-6) Click the Send button. ​\\ +6) Sendをクリックします。\\ 
-7) The response result will be displayed at the bottom of the section. ​\\+7) レスポンス結果は、セクションの下部に表示されます。 ​\\
  \\  \\