Differences

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

Link to this comparison view

Next revision
Previous revision
en:biostar_2_api_quickstart_guide [2015/10/15 17:03]
127.0.0.1 external edit
en:biostar_2_api_quickstart_guide [2018/02/27 09:07] (current)
jypark [Conclusion]
Line 5: Line 5:
 ==== Introduction ==== ==== Introduction ====
  
-The official ​BioStar API developer website ​is https://api.biostar2.com. So, you can visit the official website and get more detailed information on how to use BioStar API.+There are two ways to utilize ​BioStar API. One is called Web API(via BioStar Cloud Server) and Another one is called Local API**We recommend that you should use Local API.** After you install BioStar 2 API Server, you can see the documentation of BioStar API which provides ​more detailed information on how to use BioStar API.  
 In this article, I’m going to take a closer look at a sample application that I made for those who are familiar with C# or standalone Windows application. Since BioStar API is RESTful API, those who are not familiar with RESTful API might have difficulties implementing their own applications with BioStar API. Therefore, I’d like to guide them to kick-start their development with the sample application in this article. In this article, I’m going to take a closer look at a sample application that I made for those who are familiar with C# or standalone Windows application. Since BioStar API is RESTful API, those who are not familiar with RESTful API might have difficulties implementing their own applications with BioStar API. Therefore, I’d like to guide them to kick-start their development with the sample application in this article.
 \\ \\
Line 16: Line 17:
 **[Figure 1. When you’ve launched the sample application]** **[Figure 1. When you’ve launched the sample application]**
  
-First, you have to log in before using any other functions. If you type ‘1’ and press Enter, the sample application logs into your local BioStar server through ​BioStar Cloud. +First, you have to log in before using any other functions. If you type ‘1’ and press Enter, the sample application logs into your local BioStar server through BioStar API server.
-For now, you must configure cloud settings in order to use BioStar API since BioStar API works only with BioStar Cloud, and it’s not possible to call BioStar API directly from you local BioStar ​server ​without using BioStar Cloud. We’re planning to release a local BioStar API layer in the near future.+
  
 {{:​en:​web_api_quick_start_-_002.png?​nolink&​800|}} \\ {{:​en:​web_api_quick_start_-_002.png?​nolink&​800|}} \\
Line 46: Line 46:
 The most important part in this sample application is log-in. Let’s take a look at the function below: The most important part in this sample application is log-in. Let’s take a look at the function below:
  
-{{:​en:​web_api_quick_start_-_006.png?​nolink&​800|}}+{{:​en:​web_api_quick_start_-_006_new.png?​nolink&​800|}}
  
-  * Line 26: This is the URL that we are using to log in to your local BioStar server. ​We only allow HTTPS protocol and api.biostar2.com/v1/” is prefix. “login” after the prefix indicates a behavior or action we want to take. +  * Line 26: This is the URL that we are using to log in to your local BioStar server. ​In case of Local API, http://​127.0.0.1:8795/v2/” is prefix. “login” after the prefix indicates a behavior or action we want to take. 
   * Line 27: In this sample code, we use class HttpClient to send a request and receive a response from the BioStar Cloud. ​   * Line 27: In this sample code, we use class HttpClient to send a request and receive a response from the BioStar Cloud. ​
   * Line 30: Class JavaScriptSerializer is needed to convert the data into JSON formatted data or parse the JSON formatted data into any format you want.    * Line 30: Class JavaScriptSerializer is needed to convert the data into JSON formatted data or parse the JSON formatted data into any format you want. 
Line 61: Line 61:
 2. Retrieving access groups 2. Retrieving access groups
  
-{{:​en:​web_api_quick_start_-_007.png?​nolink&​800|}}+{{:​en:​web_api_quick_start_-_007_new.png?​nolink&​800|}}
  
   * Line 205-209: We first need to check if the login was successfully made and the session ID was stored.   * Line 205-209: We first need to check if the login was successfully made and the session ID was stored.
Line 71: Line 71:
 3. Retrieving events 3. Retrieving events
  
-{{:​en:​web_api_quick_start_-_008.png?​nolink&​800|}} \\+{{:​en:​web_api_quick_start_-_008_new.png?​nolink&​800|}} \\
 {{:​en:​web_api_quick_start_-_009.png?​nolink&​800|}} {{:​en:​web_api_quick_start_-_009.png?​nolink&​800|}}
  
Line 81: Line 81:
 4. Creating a user 4. Creating a user
  
-{{:​en:​web_api_quick_start_-_010.png?​nolink&​800|}} \\+{{:​en:​web_api_quick_start_-_010_new.png?​nolink&​800|}} \\
  
   * Line 99-100: We receive a user input for the ID of a new user.    * Line 99-100: We receive a user input for the ID of a new user. 
Line 88: Line 88:
 ==== Conclusion ==== ==== Conclusion ====
  
-So far, we have taken a brief look at how we can utilize BioStar API. Much of this article is not BioStar API specific. Rather, it’s about basic usage of class HttpClient and what to do to use Web API. Therefore, even if you’re not familiar with using Web API, I believe you can kick start on how to use BioStar API with this article. For more detailed information on BioStar API, visit our BioStar API websitehttps://api.biostar2.com+So far, we have taken a brief look at how we can utilize BioStar API. Much of this article is not BioStar API specific. Rather, it’s about basic usage of class HttpClient and what to do to use Local API. Therefore, even if you’re not familiar with using BioStar ​API, I believe you can kick start on how to use BioStar API with this article. For more detailed information on BioStar API, See the documentation about Local API after installing ​BioStar ​API Serverhttp://127.0.0.1:​8795/​v2/​docs/​