Permo apis

Register parent device
Url: /webapi/parent-device/register-parent-device/ 
Request:
ApiKey ; string

Response
DeviceId ; string
ApiKey; string
IsSuccess ; bool
Message ; string

Register child device
url: /webapi/child-device/register-child-device/
Request:
Request:
ApiKey ; string

Response: 
DeviceId ; string
ApiKey; string
IsSuccess ; bool
Message ; string

Add child to parent
we use this api when we want to add child device to parent.
url: /webapi/parent-device/add-child/
AddChildToParentRequest
ApiKey ; string
ParentDeviceId ; string
ChildDeviceId  ; string

Request validation:
Request is null
ApiKey validation 

Response
IsSuccess ; bool
Message ; string

Add partner device to parent
Adding new parent device to the family.

Url:/webapi/parent-device/add-partner/

Request
ApiKey; string
ParentDeviceId; string
PartnerDeviceId; string

Response:
 
IsSuccess ; bool
Message ; string

Add Task
adding new task to child. this action can be done by the parent and child device.
within the parent device the parent can select a child and then add a new task.
within the child device the parent can activate admin mode and add new task.

url: /webapi/tasks/add-child-task/

Request:
ApiKey; string
IsParentDevice; string 
StartDayName; string  [monday, tuesday,  wednesday, thursday, friday, saturday, sunday]
Name; string 
Icon; string 
Description; string 
Points; int 
DaysToComplete; int 
ParentDeviceId; string 
ChildDeviceId; string 

Request validation
Request is null
ApiKey is null
ApiKey validation when parent
ApiKey validation when child
Check for parent - child relations.

Response:
IsSuccess; bool
Message; string

Get tasks
From child device and parent device you can get a list of tasks.

Url:/webapi/tasks/get-tasks/

Request:
ApiKey; string
ChildDeviceId; string
ParentDeviceId; string
IsParentDevice; string [true/false]

Response:
with this response the api sends back a list of tasks, each entoti will have the following properties:
Id; long
StartDate; string
Name; string
Icon; string
Description; string
Points; int
DaysToComplete; int
IsCompleted; string [true/false]
IsParentAproved ; string [true/false]
IsRewarded; strinng [true/false]
IsShowConffertti; [true/false]
IsShowBallons; [true/false]
IsCurrent; [true/false]

Update task
You can update child task from child device and from parent device.
in the child device the parent first needs to login in order to activate admin mode and update the tasks.
when child show one of the effects the device needs to update the api accourdinly.  

Url: /webapi/tasks/update-task/

Request:
ApiKey; string
IsParentDevice; string
ParentDeviceId; string
ChildDeviceId; string
Id: long
StartDayName; string [monday, tuesday,  wednesday, thursday, friday, saturday, sunday]
Name; string
Icon; string
Description; string
Points; int
DaysToComplete; int
IsCompleted: string [true/false]
IsParentAproved; string [true/false]
IsShowBallons; string [true/false]
IsShowConfetti; string [true/false]

Response:
IsSuccess; bool
Message; string

Remove child device from parent
only with in the parent device you can remove child from parent.

Url: /webapi/parent-device/remove-child/

Request:
ApiKey; string
ParentDeviceId; string
PartnerDeviceId; string

Response:
IsSuccess; bool
Message; string

Remove partner from parent
from parent device you can remove attached partner.

Url:/webapi/parent-device/remove-partner-from-parent/

Request:
ApeKey; string
ParentDeviceId; string
PartnerDeviceId; string

Response:
IsSuccess; bool
Message; string

Reward child
from parent device we can send reward child request to mark all the tasks as rewarded. means we will not show the smilies and he needs to start from the beginning.
Request:
 ParentDeviceId; [true/false]
 ChildDeviceId; [true/false]
ApiKey; string

Response:
IsSuccess; bool
Message; string

GetSmileysCount

from parent and child device we can request for child smileys count.
Request:
ParentDeviceId; [true/false]
ChildDeviceId; [true/false]
ApiKey; string
IsParentDevice; [true/false]

Response:
TotalSmileysCount; int
ApprovedSmileysCount; int


Process:
parent download the app his his mobile or ipad/tablet and add child device.
adding child device can be done in the settings page.
if there is no child then the parent will see in his screen add child device. if there is allready child attached then he will be able to do that in the settings page.

parent add task for the child.
parent can also update the task.
parent enter task name, points , and start date.

child can see the current tasks he have on his board accourding to the start date. hi will see all the tasks where date.now => now.

child can click on the task that he did. the app updates the server.
parent open the app, goes to the child screen and see the updated tasks. if the screen is open he can click on refresh.
parent approve the task. app sends update to the api.

child open the app or click refresh, the app will show that the task was approved.
when the task is approved we will see a smily at the bottom of the screen.

what happens when the task was approved:
the child will see animation of baluns that he needs to blow up and then we gets confety on the screen. then he get a popup with many smilyes to select a smily.
the smilye he seelcted will be shown in the progress bar.

when the child complete all the tasks he will get a golden star.
same here: when he completed all the tasks 

in the popup he will be able to see his progress, how many smilyes he have and how many starts he has collected.