Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:biostar_2_api_quickstart_guide [2018/02/27 08:23] jypark [Introduction] |
en:biostar_2_api_quickstart_guide [2018/02/27 09:07] (current) jypark [Conclusion] |
||
---|---|---|---|
Line 17: | 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 47: | 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 62: | 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 72: | 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 82: | 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 89: | 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 website: https://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 2 API Server: http://127.0.0.1:8795/v2/docs/ |