Wallet
Wappsto API is provided of a wallet that illustrates the data usages, the owned credit, the installation management and so on. To retrieve the wallet you can use the following command:
The wallet is a huge networks where each devices represents a different part of the management. Here we will analyze this wallet piece by piece.
User_used
There are five values:
- bytes: memory used in the Wappsto database
- requests: requests done to the Wappsto API
- traffic: amount of data in and out from the Wappsto API
- bytes_file: amount of data stored for the files
- requests_file: requests done to fetch files
These values are always increasing and there are counted since the creation of the user.
Month_used
It has the same structure of the user_used device but at the begin of each subscription's period the values are reduced to zero (with the exception of "bytes" and "bytes file").
Month_used values are always compared with the user's subscription: if an user has an usage that overcome the subscribed payment_plan, then a payment error is returned. The only possibility to continue to use Wappsto API is to pass to a better plan.
Application
Here are shown the applications bought and used by the user. A bought application will be denoted here as bought: uninstalling and then reinstalling the same application will not prompt a second payments.
State
Here are shown the states bought and used by the user.
Cash
This device includes the cash owned by the user. The value is obtained by summing and subtracting all the different transactions managed by the user.
Installation wallet
To monitor each installation consumption, there is a personal device for installation that manages the bytes, requests, traffic, credit, bytes_file and requests_file.
By default an installation has only the wallet restriction imposed on the user, but if the user wants, it can provide some limits to the usage of an installation. These can be done by using the attribute "limit" inside the installation document.
{
"meta" : {
"id" : "3e6324a4-8ce2-4225-816f-a21604637ced",
"type" : "installation",
"version": "2.0"
},
"name" : "Test App",
"version_app" : "1.0.0",
"title" : "New installation",
"supported_features" : ["foreground", "background", "widget"],
"author" : "Seluxit A/S",
"barebone" : "light",
"uninstallable" : true,
"status" : {
"payment" : "free",
"background": "pending",
"version" : "updated",
"session" : "running"
},
"description" : {
"general" : "A test app",
"foreground": "A test foreground",
"background": "A test background",
"widget" : "A test widget",
"version" : "A test app"
},
"session_user" : false,
"icon" : "6dd1abe6-1171-47bd-892d-4dcb28609edc",
"application" : "ff7c750d-2f56-4ff2-ae63-88a1c404cbe0",
"version_id" : "1bfd3e7c-6eb4-4a2d-a3cd-90a7b76267c5",
"token_installation" : "199faa61a911be1d458ae28b1fd8bc5ba95cab2ca4fbf013050902cf813a4d7244cbedd5dcb1487c31ac5d2c53097db08f5f275ab1a4f9c78bb491b837d38bfd",
"extsync" : false,
"ignore_this_notification": [null],
"limit_wallet" : {"requests": -1, "bytes": -1, "traffic": -1, "credit": 0},
"session" : "1c3b40c2-8d4d-476f-b564-467b44691b19",
"oauth" : []
}
Note that "-1" means that we do not setup any strong restriction.