Definitions
App
App is the model struct for apps
Name | Schema |
---|---|
appId |
string |
appName |
string |
deletedAt |
string |
deployedVersions |
< Version > array |
id |
string |
numOfAppLaunches |
integer (int64) |
numOfCurrentInstalls |
integer (int64) |
numOfDeployedVersions |
integer (int64) |
Device
Device model
Name | Schema |
---|---|
appId |
string |
deviceId |
string |
deviceType |
string |
deviceVersion |
string |
id |
string |
version |
string |
versionId |
string |
Version
Version model
Name | Schema |
---|---|
appId |
string |
devices |
< Device > array |
disabled |
boolean |
disabledMessage |
string |
id |
string |
lastLaunchedAt |
string |
numOfAppLaunches |
integer (int64) |
numOfCurrentInstalls |
integer (int64) |
version |
string |
Mobile Security Service REST API
This is the server component of the AeroGear Mobile Security Service. It is a RESTful API that allows developers to view, enable and disable specific versions of applications on demand, with the information stored in a PostgreSQL database.
The url prefix is http://<host>:<port>/api
Checking REST Service
Run the following curl command and check the output is as shown.
$ curl localhost:3000/api/apps
[{"id":"0890506c-3dd1-43ad-8a09-21a4111a65a6","appId":"com.aerogear.testapp","appName":"Test App","numOfDeployedVersions":2,"numOfCurrentInstalls":3,"numOfAppLaunches":6000},{"id":"1b9e7a5f-af7c-4055-b488-72f2b5f72266","appId":"com.aerogear.foobar","appName":"Foobar","numOfDeployedVersions":0,"numOfCurrentInstalls":0,"numOfAppLaunches":0}]
This endpoint will return all apps saved in the database. If you do not have data saved locally it will return no data with a 204 No Content response code.
|
You can install the Postman tool which will be useful to call and test the REST API endpoints of this server. Following an image to show how it works. |
Retrieve list of apps
GET /apps
Description
Returns root level information for all apps
$ curl localhost:3000/api/apps
[{"id":"0890506c-3dd1-43ad-8a09-21a4111a65a6","appId":"com.aerogear.testapp","appName":"Test App","numOfDeployedVersions":2,"numOfCurrentInstalls":3,"numOfAppLaunches":6000},{"id":"1b9e7a5f-af7c-4055-b488-72f2b5f72266","appId":"com.aerogear.foobar","appName":"Foobar","numOfDeployedVersions":0,"numOfCurrentInstalls":0,"numOfAppLaunches":0}]
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Query |
appId |
The app_id to filter the app by appId |
string |
Update 1 or more versions of an app
PUT /apps/:id/versions
Description
Update all versions informed of an app using the app id, including updating version information
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
The id for the app that will have its versions updated |
string |
Body |
body |
Updated 1 or more versions of an app |
Disable all versions of an app
POST /apps/:id/versions/disable
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
The id for the app that will have all its versions updated |
string |
Body |
body |
Get app by id
GET /apps/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
The id for the app that needs to be fetched. |
string |
Does a soft delete at in the App
DELETE /apps/{id}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
id |
The id for the app that needs to be fetched. |
string |
Check if the server can receive requests
GET /healthz
Init call from SDK
POST /init
Description
Capture metrics from device and return if the app version they are using is disabled and has a set disabled message