Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
ja:how_to_use_swagger_ui_and_postman_for_biostar_2_new_local_api [2021/05/31 14:07]
pjemoon [Swagger UI]
ja:how_to_use_swagger_ui_and_postman_for_biostar_2_new_local_api [2021/06/01 14:03]
pjemoon [How to utilize Postman with Swagger UI]
Line 17: Line 17:
 APIを呼び出す前に、APIの種類とそれらのモデルスキーマを確認できます。以下は、ログイン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) レスポンス結果は、セクションの下部に表示されます。 ​\\
  \\  \\