Difference between revisions of "Development:Prana Breath API/Collections:Tests"

From Olekdia Wiki
(Created page with "<code>tests</code>, or <code>health_tests</code> - collection that gives you access to all trainings in the app.<br/> __TOC__ __TOC__ <div class="api-table long-code"> == P...")
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code>tests</code>, or <code>health_tests</code> - collection that gives you access to all trainings in the app.<br/>
+
<code>tests</code>, or <code>health_tests</code> - Collection that gives control over all health tests in the app.<br/>
 
 
__TOC__
 
  
 
__TOC__
 
__TOC__
Line 7: Line 5:
 
<div class="api-table long-code">
 
<div class="api-table long-code">
 
== Prefix ==
 
== Prefix ==
It could be used with next prefixes:
 
 
* <code>pranabreath://</code>
 
* <code>pranabreath://</code>
With next prefixes, only <code>trainings</code> collection could be used. Also both prefix and collection are case-sensitive:
+
* <code><nowiki>https://pranabreath.olekdia.com/</nowiki></code>
* <code><nowiki>https://olekdia.com/pranabreath/</nowiki></code>
+
* <code><nowiki>https://pranabreath.page.link/?link=https://pranabreath.olekdia.com/</nowiki></code>
* <code><nowiki>https://pranabreath.page.link/?link=https://olekdia.com/pranabreath/trainings/</nowiki></code>
 
  
 
== Syntax ==
 
== Syntax ==
* <code>pranabreath://trainings/item?cmd=[Command]</code> - Case-insensitive.  
+
* <code>pranabreath://tests/item?cmd=[Command]</code> - Case-insensitive.  
* <code>pranabreath://Trainings/item?[Parameter]=[Value]</code>
+
* <code><nowiki>https://pranabreath.olekdia.com/tests?cmd=[Command]</nowiki></code> - Case-sensitive.
* <code>pranabreath://trainings/item?cmd=[Command]&[Parameter1]=[Value1]&[Parameter2]=[Value2]</code>
 
* <code><nowiki>https://olekdia.com/pranabreath/trainings?cmd=[Command]&[Parameter]=[Value]</nowiki></code> - Case-sensitive.
 
  
 
== Commands ==
 
== Commands ==
Line 27: Line 21:
 
|  
 
|  
 
==='''list'''===
 
==='''list'''===
| Returns training list. Currently it is only used in console for retrieving training list.
+
| Returns test list. Currently it is only used in console for retrieving health test list. All health tests have negative ids in the app.
* <code>pranabreath://trainings?cmd=list</code>  
+
* <code>pranabreath://tests?cmd=list</code>  
 
<pre>
 
<pre>
pos id public_id name
+
id name
1 1        Clear mind
+
-1 shtange
2 2        Relax
+
-2 genchi
3 3        Calming
+
-3 buteyko
4 4        Power
+
-4 heart_rate
4  5  5        Harmony
+
-5 blood_circulation
5   6  6        Anti-stress
 
6  7  7        Anti-appetite
 
7  8  8        Cigarette replace
 
8  9  11        Bhastrika
 
 
</pre>
 
</pre>
* <code>pranabreath://trainings</code> - It is a default command when only ''collection'' is defined without an ''item'', so if we omit the ''command'' it will return the same result.
+
* <code>pranabreath://tests</code> - It is a default command if ''collection'' is defined without an ''item'', so if we omit the ''command'' it will return the same result.
 
|-
 
|-
 
|  
 
|  
 
==='''select'''===
 
==='''select'''===
| Select the specified training. Commands [[#import|import]], [[#create|create]], [[#start|start]] have despite its own effects have also select effect.
+
| Selects the specified health test. Other than its own effect, command [[#start|start]] does '''select''' as well.
* <code>pranabreath://trainings/Harmony?cmd=select</code> - Select [[Harmony]] training.
+
* <code>pranabreath://tests/Genchi?cmd=select</code> - Select the [[Genchi test]].
* <code>pranabreath://trainings/Harmony</code> - It is default command when ''item'' is specified, so it will have the same impact that above example.
+
* <code>pranabreath://tests/Genchi</code> - Select the [[Genchi test]]. '''Select''' is a default command if ?cmd= is omitted.
 
|-
 
|-
 
|  
 
|  
 +
==='''start'''===
 +
| Starts the selected health test. If there is no such a test - nothing happens.
 +
* <code>pranabreath://tests/Genchi?cmd=start</code> - Select and start [[Genchi test]]. Also it will bring the app to foreground with [[Health_tab#Performing_health_tests|health tab]] selected.
 +
* <code>pranabreath://tests/-3?cmd=start</code> - Select and start the health test with id equals -3.
 
|}
 
|}
 +
 +
{{DISPLAYTITLE:<span style="position:absolute; top:-9999px;">Development:</span>Prana Breath API/Collections:Tests}}
 +
[[Category:Dev{{#translation:}}|^Prana Breath^]]

Latest revision as of 16:06, 1 April 2019

tests, or health_tests - Collection that gives control over all health tests in the app.

Prefix

  • pranabreath://
  • https://pranabreath.olekdia.com/
  • https://pranabreath.page.link/?link=https://pranabreath.olekdia.com/

Syntax

  • pranabreath://tests/item?cmd=[Command] - Case-insensitive.
  • https://pranabreath.olekdia.com/tests?cmd=[Command] - Case-sensitive.

Commands

Command Description

list

Returns test list. Currently it is only used in console for retrieving health test list. All health tests have negative ids in the app.
  • pranabreath://tests?cmd=list
id name
-1 shtange
-2 genchi
-3 buteyko
-4 heart_rate
-5 blood_circulation
  • pranabreath://tests - It is a default command if collection is defined without an item, so if we omit the command it will return the same result.

select

Selects the specified health test. Other than its own effect, command start does select as well.
  • pranabreath://tests/Genchi?cmd=select - Select the Genchi test.
  • pranabreath://tests/Genchi - Select the Genchi test. Select is a default command if ?cmd= is omitted.

start

Starts the selected health test. If there is no such a test - nothing happens.
  • pranabreath://tests/Genchi?cmd=start - Select and start Genchi test. Also it will bring the app to foreground with health tab selected.
  • pranabreath://tests/-3?cmd=start - Select and start the health test with id equals -3.