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
swagger_api [2018/05/28 09:50]
t1m3c
swagger_api [2019/06/08 20:35] (current)
armchairguru
Line 1: Line 1:
 ====== Settings API Guide (Swagger API) ====== ====== Settings API Guide (Swagger API) ======
- +<callout type="​success"​ icon="​glyphicon glyphicon-link">​ 
-This API functionality can be used to make changes to your configuration files without opening the GUI. It is intended for use with external scripts allowing you to automate some aspects of configuration changes based on your own external signals.+This API functionality can be used to make changes to your configuration files without opening the GUI.\\ 
 +It is intended for use with external scripts allowing you to automate some aspects of configuration changes based on your own external signals.
  
 You can access the API for your bot by visiting http://​localhost:​8081/​swagger-ui.html. You can access the API for your bot by visiting http://​localhost:​8081/​swagger-ui.html.
 +</​callout>​
  
 Upon loading you will see this screen. Upon loading you will see this screen.
Line 78: Line 80:
  
 ---- ----
-== Save == 
  
-Unfortunately at the moment Swagger API does not permit us to enter the required line breaks to successfully save an entire configuration file. The save function can only be used successfully for [[Hotconfig]] entries until this is resolved.+== Save==
  
-The save operation allows you to overwrite the contents of a particular configuration file. It replaces the entire file.+The save function can only be used successfully for [[Hotconfig]] entries.
  
 Parameters: Parameters:
   * ''​fileName''​ - The name of the particular configuration file   * ''​fileName''​ - The name of the particular configuration file
-  * ''​configName''​ - The name of the configuration +  * ''​configName''​ - Currently only `HOTCONFIG` allowed 
-  * ''​saveData''​ - The contents (settings) ​you wish to overwrite the file with.+  * ''​saveData''​ - The `HOTCONFIG` lines you want to save
   * ''​license''​ - Your ProfitTrailer license   * ''​license''​ - Your ProfitTrailer license
  
-Select the desired fileName, fill in the three parameters and click {{::​try_it_out.png?​nolink|}} to overwrite the configuration file.+Select the desired fileName, fill in the three parameters and click {{::​try_it_out.png?​nolink|}} to save your setting.
  
 **Curl Example** **Curl Example**
Line 103: Line 104:
  
 <file java> <file java>
-curl -d "​license=xxx&​fileName=INDICATORS&​saveData=#​BB_candle_period%20%3D%20300%0A#​BB_sma%20%3D%202%0A%0A" http://​localhost:​8081/​settingsapi/​settings/​save+curl -d "​license=xxx&​fileName=HOTCONFIG&​saveData=XXX_bought_price%20%3D%200.01" http://​localhost:​8081/​settingsapi/​settings/​save
 </​file>​ </​file>​
  
-would set+would send 
 + 
 +`XXX_bought_price = 0.1` 
 + 
 +---- 
 +== SaveAll== 
 + 
 +Unfortunately at the moment Swagger API UI does not permit us to enter the required line breaks to successfully save an entire configuration file. But use your programming language of choice to do so. 
 + 
 +The save operation allows you to overwrite the contents of a particular configuration file. It replaces the entire file. 
 + 
 +Parameters:​ 
 +  * ''​fileName''​ - The name of the particular configuration file 
 +  * ''​configName''​ - The name of the configuration 
 +  * ''​pairsData''​ - The contents (settings) you wish to overwrite the PAIRS config with (cannot be empty). 
 +  * ''​dcaData''​ - The contents (settings) you wish to overwrite the DCA config with (cannot be empty). 
 +  * ''​indicatorsData''​ - The contents (settings) you wish to overwrite the INDICATORS config with (cannot be empty). 
 +  * ''​license''​ - Your ProfitTrailer license
  
-#​BB_candle_period = 300 \\ +Select the desired fileName, fill in the parameters and click {{::​try_it_out.png?​nolink|}} to overwrite the configuration files.
-#BB_std = 2+
  
  
Line 132: Line 149:
 Example Usage: http://​localhost:​8081/​api/​sales/​log?​token=[server.api_token] Example Usage: http://​localhost:​8081/​api/​sales/​log?​token=[server.api_token]
  
-~~DISCUSSION~~ 
  • swagger_api.1527501043.txt.gz
  • Last modified: 13 months ago
  • by t1m3c