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

From Olekdia Wiki
(Created page with "<code>reminders</code>, or <code>rems</code> - collection that gives you control over reminders in the app.<br/> __TOC__ <div class="api-table long-code"> == Prefix == * <co...")
 
Line 26: Line 26:
 
* <code>pranabreath://reminders?cmd=list</code>  
 
* <code>pranabreath://reminders?cmd=list</code>  
 
<pre>
 
<pre>
pos id public_id name
+
id time training          when
0  1  1        Clear mind
+
16 ⁦‎07:‎30⁩ Power             Every day
1  2 2        Relax
+
6 ⁦‎18:‎00⁩ Clear mind        Every day
2  3  3        Calming
+
8 ⁦‎10:‎00⁩ Heart rate        Sunday
3  4  4        Power
+
10 ⁦‎10:‎03⁩ Blood circulation Sunday
4  5 5        Harmony
+
11 ⁦‎10:‎05⁩ Buteyko test      Sunday
5  6 6        Anti-stress
+
3 ⁦‎10:‎10⁩ Genchi test      Sunday
6  7  7        Anti-appetite
 
7  8  8        Cigarette replace
 
8  9 11        Bhastrika
 
 
</pre>
 
</pre>
 
* <code>pranabreath://reminders</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://reminders</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.
Line 41: Line 38:
 
|  
 
|  
 
==='''create'''===
 
==='''create'''===
| Create the training with defined [[#Parameters|parameters]]. If training with such name already exists - new training will not be created. Instead all parameters will be applied to this training.
+
| Create the reminder with defined [[#Parameters|parameters]].  
* <code>pranabreath://trainings?cmd=create&name=Serenity&trng_type=1</code> - Create [[Training_kind#Meditation|meditation]] with name "Serenity".
+
* <code>pranabreath://reminders?cmd=create&time=18_30&pid=1</code> - Create a reminder for the training with id equals 1, at 18:30.
* <code>pranabreath://trainings?cmd=create&name=4_7_8_Breathing&dur_prep_time=5000&trng_cycles={"mValues":[{"mInhaleUnit":4,"mRetainUnit":7,"mExhaleUnit":8,"mMethodsBitSet":129,"mSecPerUnit":1000}],"mKeys":[0,]}</code> - Create training with name "4_7_8_Breathing", with 5 seconds [[Preparing time|preparing time]], and 4:7:8:0 [[Ratio_of_breath_cycle|ratio]]
 
 
|-
 
|-
 
|  
 
|  
 
==='''delete'''===
 
==='''delete'''===
| Delete the selected training. If there is no the input training - nothing happens.
+
| Delete the selected reminder. If there is no the input reminder - nothing happens.
* <code>pranabreath://trngs/14?cmd=delete</code> - Delete training with id 14.
+
* <code>https://olekdia.com/pranabreath/reminders/13?cmd=delete</code> - Delete training with id 13.
* <code>pranabreath://trngs/Relax?cmd=delete</code> - Delete the [[Relax]] training.
 
 
|}
 
|}
  
Line 59: Line 54:
 
|-
 
|-
 
|  
 
|  
==='''name'''===
+
==='''pid'''===
| Name of the training.  
+
| Parent ID, reference to the training of the reminder.
* <code>pranabreath://trainings/Power?name=Energy</code> - Rename the "Power" training to "Energy".
+
* <code>pranabreath://reminders/3?pid=5</code> - Set a reminder with id equals 3 for a training with id equals 5.
* <code>https://olekdia.com/pranabreath/Trainings/5?name=Balance</code> - Rename a training with equals 5, set name as "Balance".
 
 
|-
 
|-
 
|  
 
|  
==='''public_id'''===
+
==='''enabled'''===
| Indicates public id of the training. All [[Training_type|trainings in this list]] have their own ''public_id''. Readonly value.
+
| Represents state of reminder. Values range [true, false]
 
* <code>pranabreath://trngs?cmd=import&public_id=25</code> - Import training with <code>public_id</code> equals 25 which is [[Ha breathing]] training.
 
* <code>pranabreath://trngs?cmd=import&public_id=25</code> - Import training with <code>public_id</code> equals 25 which is [[Ha breathing]] training.
 
|-
 
|-
 
|  
 
|  
==='''trng_type'''===
+
==='''time'''===
| Is a [[Training_kind|kind]] of the training. Value range is [0 - [[Training_kind#Breathing_session|breathing session]], 1 - [[Training_kind#Meditation|meditation]]].
+
| Represents state of reminder. Values range [true, false]
* <code>pranabreath://trainings?cmd=create&name=Serenity&trng_type=1</code> - Create [[Training_kind#Meditation|meditation]] with name "Serenity".
+
* <code>pranabreath://trngs?cmd=import&public_id=25</code> - Import training with <code>public_id</code> equals 25 which is [[Ha breathing]] training.
|-
 
|
 
==='''pos'''===
 
| Position of the training in the training list.
 
* <code>pranabreath://trainings/Clear_mind?pos=9999</code> - Move the [[Clear mind]] training to the very bottom of the list.
 
 
|}
 
|}
 
</div>
 
</div>

Revision as of 14:32, 1 February 2019

reminders, or rems - collection that gives you control over reminders in the app.

Prefix

  • pranabreath:// - Case-insensitive.
  • https://olekdia.com/pranabreath/ - Case-sensitive.
  • https://pranabreath.page.link/?link=https://olekdia.com/pranabreath/ - Case-sensitive.

Syntax

  • pranabreath://reminders/item?cmd=[Command] - Case-insensitive.
  • pranabreath://reminders/item?[Parameter]=[Value]
  • pranabreath://reminders/item?cmd=[Command]&[Parameter1]=[Value1]&[Parameter2]=[Value2]
  • https://olekdia.com/pranabreath/reminders?cmd=[Command]&[Parameter]=[Value] - Case-sensitive.

Commands

Command Description

list

Returns reminders list. Currently it is only used in console for retrieving reminders list.
  • pranabreath://reminders?cmd=list
id time  training          when
16 ⁦‎07:‎30⁩ Power             Every day
6  ⁦‎18:‎00⁩ Clear mind        Every day
8  ⁦‎10:‎00⁩ Heart rate        Sunday
10 ⁦‎10:‎03⁩ Blood circulation Sunday
11 ⁦‎10:‎05⁩ Buteyko test      Sunday
3  ⁦‎10:‎10⁩ Genchi test       Sunday
  • pranabreath://reminders - 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.

create

Create the reminder with defined parameters.
  • pranabreath://reminders?cmd=create&time=18_30&pid=1 - Create a reminder for the training with id equals 1, at 18:30.

delete

Delete the selected reminder. If there is no the input reminder - nothing happens.

Parameters

Parameter Description

pid

Parent ID, reference to the training of the reminder.
  • pranabreath://reminders/3?pid=5 - Set a reminder with id equals 3 for a training with id equals 5.

enabled

Represents state of reminder. Values range [true, false]
  • pranabreath://trngs?cmd=import&public_id=25 - Import training with public_id equals 25 which is Ha breathing training.

time

Represents state of reminder. Values range [true, false]
  • pranabreath://trngs?cmd=import&public_id=25 - Import training with public_id equals 25 which is Ha breathing training.