Customer API

API

Customer API Scope

Scopes API Endpoint
device:GetList GET /api/v1/device/
device:GetDetail GET /api/v1/device/id/:id
device:GetDataUsage GET /api/v1/device/datausage/id/:id
device:GetScreenTime GET /api/v1/device/screentime/id/:id
device:GetApplication GET /api/v1/device/app/id/:id
device:GetLocation GET /api/v1/device-location/id/:id
device:GetLocation (bulk) GET /api/v1/device-location/bulk

Supported use cases:

  • Admin displays all existing API (id, application, scopes).
  • Admin creates an API Key for customer:
    • Admin provides the application name and scopes.
    • Admin can copy the key and give it to the customer.
  • Admin updates the existing application and/or scopes.
  • Admin regenerates new key (replace existing) for existing application:
    • Admin can copy the key and give it to the customer.
  • Admin deletes an existing API Key.

device:GetList

Provide information about devices in the list on the portal.

curl --request GET \
  --url https://abc.gomobile.work/api/v1/device/ \
  --header 'Authorization: Bearer <YourAPIKey>' \
  --header 'x-enterprise-id: <YourEnterpriseID>'

Note:

  • API Key can be obtained after create new API or Regenerate (API Key will appear on the top of page) API-Key
  • Enterprise ID can be obtained from page Settings

Response field:

[
  {
		"id": "xGc7878Trrrrrr7xXck572xk",
		"created_at": "2023-09-05T09:45:50.817+07:00",
		"updated_at": "2023-09-05T12:43:10.472+07:00",
		"last_connect": "2023-09-05T14:14:20+07:00",
		"imei": "fesfgrgry5439e865",
		"token": "a2RMNmZsNHBxJGhBWWFzUmdmVUaVB3NnZLZUt2MG5HajA9",
		"enterprise_id": "whguCrwwQV5Hhf9EC",
		"policy_id": "Ry6CGan5uuuYTHDhX6Q",
		"play_emm_token": "oauth2_4/0Adeu5BW2HmWdZ2g4BjNSDr2ohyxw-oTVquqnvZPsA",
		"fcm_token": "eA65WVE3KBpv9b14ru3T9tA1U7yhlDXWqOEFKpoSJqk8q_5_OKDn0m-K",
		"management_mode": "BYOD",
		"dpc_version": "2.9.4 - test byod",
		"dpc_version_code": 120,
		"status": "ACTIVE",
		"model": "SM-A135F",
		"brand": "samsung",
		"android_version": "13",
		"last_battery_update": "2023-09-05T14:12:46.367+07:00",
		"remaining_battery": 64,
		"battery_health": "GOOD",
		"last_storage_update": "2023-09-05T14:12:46.369+07:00",
		"remaining_storage": 117.1,
		"storage_capacity": 96,
		"manifest": {
			"emm_id": "",
			"enterprise_id": "whguCrwwQV5Hhf9EC",
			"enterprise_color": "",
			"enterprise_logo": "",
			"enterprise_contact": "",
			"enterprise_name": "Staging",
			"eula_url": "",
			"policy_id": "Ry6CGan5uuuYTHDhX6Q",
			"server_url": "https://abc.gomobile.work/dc/android/",
			"onboarding_url": "",
			"management_mode": "BYOD"
		},
		"device_info": {
			"fcm_token": "eA65WVE3KBpv9b14ru3T9tA1U7yhlDXWqOEJqk8q_5_OKDn0m-K",
			"batteryInfo": {
				"capacity": "66%",
				"chargeMedia": "",
				"charging": "false",
				"health": "GOOD"
			},
			"certificate": [],
			"deviceSettings": {
				"adbEnabled": false,
				"developmentSettingsEnabled": false,
				"encryptionStatus": "ENCRYPTION_ACTIVE_PER_USER",
				"isEncrypted": true,
				"verifyAppsEnabled": false
			},
			"hardwareInfo": {
				"brand": "samsung",
				"deviceBasebandVersion": "A135FXXWG1,S5CA135FCWXXS5G1",
				"hardware": "exynos850",
				"manufacturer": "samsung",
				"model": "SM-A135F",
				"serialNumber": ""
			},
			"imei": "fesfgrgry5439e865",
			"imsi1": "",
			"imsi2": "",
			"memoryInfo": {
				"totalInternalStorage": "117102850048",
				"totalRam": "3886956544"
			},
			"networkInfo": {
				"active_network": "wifi",
				"wifi": {
					"ssid": "unknown ssid",
					"ip": "192.150.1.27",
					"strength": "-59 dB"
				},
				"gsm": {}
			},
			"operator1": "",
			"operator2": "",
			"softwareInfo": {
				"androidDevicePolicyVersionCode": 120,
				"androidDevicePolicyVersionName": "2.9.4 - test byod",
				"androidSdk": "33",
				"androidVersion": "13",
				"androidVersionDetail": "A135F5CXXSWG1",
				"primaryLanguageCode": "Indonesia"
			},
			"storageInfo": {
				"memoryCapacity": "3,9 GB",
				"memoryUsage": "53%",
				"remainingStorage": "113,0 GB",
				"storageCapacity": "117,1 GB",
				"storageUsage": "4%"
			}
		},
		"policy_name": "BYOD"
	}
]

device:GetDetail

Provide information about detail device that exist on the portal.

curl --request GET \
  --url https://abc.gomobile.work/api/v1/device/id/:id \
  --header 'Authorization: Bearer <YourAPIKey>' \
  --header 'x-enterprise-id: <YourEnterpriseID>'

Note:

  • Change :id with device id that exist on the portal

Response field:

{
	"id": "xGc7878Trrrrrr7xXck572xk",
	"created_at": "2023-08-29T15:28:09.278+07:00",
	"updated_at": "2023-08-31T17:31:53.714+07:00",
	"last_connect": "2023-08-31T17:34:48+07:00",
	"imei": "35516666657571",
	"enterprise_id": "whguwrwnfbHhf9QV5EC",
	"policy_id": "bQyH2GyuaokT8io5xQyf9d",
	"management_mode": "FULLY_MANAGED",
	"dpc_version": "2.9.3",
	"dpc_version_code": 119,
	"status": "ACTIVE",
	"model": "SM-G525F",
	"brand": "samsung",
	"android_version": "13",
	"imsi1": "510583800930053",
	"operator1": "Smartfren",
	"last_battery_update": "2023-08-31T17:34:37.865+07:00",
	"remaining_battery": 74,
	"battery_health": "GOOD",
	"last_storage_update": "2023-08-31T17:34:37.867+07:00",
	"remaining_storage": 53.7,
	"storage_capacity": 94,
	"last_location_update": "2023-08-31T17:29:43.728+07:00",
	"last_location": {
		"lat": -7.149822185290424,
		"lng": 110.77842407520029,
		"accuracy": 25.0,
		"altitude": 173.0,
		"provider": "gps",
		"caller": "LocationManager",
		"inside_geofence": true,
		"geofence_id": ""
	},
	"manifest": {
		"emm_id": "",
		"enterprise_id": "whguwrwnfbHhf9QV5EC",
		"enterprise_color": "",
		"enterprise_logo": "",
		"enterprise_contact": "",
		"enterprise_name": "Staging",
		"eula_url": "",
		"policy_id": "bQQ2GyyuaHio5xokT8yf9d",
		"server_url": "https://abc.gomobile.work/dc/android/",
		"onboarding_url": "",
		"management_mode": "FULLY_MANAGED"
	},
	"device_info": {
		"fcm_token": "fvvzELk9TYezYFORa7cEXF29exoQ9ErF3i1D-QpP79tkfZW9fzqJzpwq",
		"batteryInfo": {
			"capacity": "74%",
			"chargeMedia": "",
			"charging": "false",
			"health": "GOOD"
		},
		"certificate": [],
		"deviceSettings": {
			"adbEnabled": false,
			"developmentSettingsEnabled": false,
			"encryptionStatus": "ENCRYPTION_ACTIVE_PER_USER",
			"isEncrypted": true,
			"verifyAppsEnabled": false
		},
		"hardwareInfo": {
			"brand": "samsung",
			"deviceBasebandVersion": "G525G525FFXXU7CWE4,XXU7CWE4",
			"hardware": "exynos850",
			"manufacturer": "samsung",
			"model": "SM-G525F",
			"serialNumber": "RR8QQ0T602Y"
		},
		"imei": "355105115750071",
		"imsi1": "510380509300583",
		"imsi2": "",
		"memoryInfo": {
			"totalInternalStorage": "53726916608",
			"totalRam": "3863560192"
		},
		"networkInfo": {
			"active_network": "wifi",
			"wifi": {
				"ssid": "Vostra_Internasional",
				"ip": "192.150.1.27",
				"strength": "-44 dB",
				"macAddress": "98:9a:db0:8b:2c:a"
			},
			"gsm": {
				"gsm1": {
					"imsi": "510380509300583",
					"operator": "Smartfren",
					"strength": "-94 dB"
				}
			}
		},
		"operator1": "Smartfren",
		"operator2": "",
		"softwareInfo": {
			"androidDevicePolicyVersionCode": 119,
			"androidDevicePolicyVersionName": "2.9.3",
			"androidSdk": "33",
			"androidVersion": "13",
			"androidVersionDetail": "G52U7CWE5FXX4",
			"primaryLanguageCode": "Indonesia"
		},
		"storageInfo": {
			"memoryCapacity": "3,9 GB",
			"memoryUsage": "55%",
			"remainingStorage": "50,7 GB",
			"storageCapacity": "53,7 GB",
			"storageUsage": "6%"
		}
	},
	"policy_name": "Knowledgebase"
}

device:GetDataUsage

Provide information about data usage on each devices

curl --request GET \
  --url https://abc.gomobile.work/device/api/v1/device/datausage/id/:id \
  --header 'Authorization: Bearer <YourAPIKey>' \
  --header 'x-enterprise-id: <YourEnterpriseID>'

Note:

  • Change :id with device id that exist on the portal

Response field:

[
	{
		"id": 51179,
		"created_at": "2023-08-30T06:54:48.748+07:00",
		"device_id": "Bs6QQQQYe7ubSVKHq2zkm",
		"package_name": "others",
		"mobile": 0,
		"wifi": 8494261,
		"start": "2023-08-29T00:00:00+07:00",
		"end": "2023-08-29T23:59:59+07:00"
	}
]

device:device:GetScreenTime

Provide information about screen time on each device.

curl --request GET \
  --url https:/abc.gomobile.work/api/v1/device/screentime/id/:id \
  --header 'Authorization: Bearer <YourAPIKey>' \
  --header 'x-enterprise-id: <YourEnterpriseID>'

Note:

  • Change :id with device id that exist on the portal

Response field:

[
	{
		"id": 11778,
		"created_at": "2023-09-05T08:56:04.212+07:00",
		"enterprise_id": "whgbRR3HuCrHLfwnfhf9EC",
		"device_id": "9cNYYrr8bCDTNpwjtgd6hH",
		"package_name": "com.google.android.youtube",
		"policy_name": "BYOD",
		"policy_id": "6P9SJgJXdn4xgvpgaq3CX4",
		"screentime": 2,
		"start": "2023-09-04T00:00:00+07:00",
		"end": "2023-09-04T23:59:59+07:00"
	}
]

device:GetApplication

Provide information about list of application that exist on device.

curl --request GET \
  --url https:/abc.gomobile.work/api/v1/device/app/id/:id \
  --header 'Authorization: Bearer <YourAPIKey>' \
  --header 'x-enterprise-id: <YourEnterpriseID>'

Note:

  • Change :id with device id that exist on the portal

Response field:

[
	{
		"ID": 231697,
		"device_id": "9cqq8bCgdDTNpwjtRAd6hH",
		"updated_at": "2023-09-05T13:35:26.699+07:00",
		"displayName": "Chrome",
		"hasLauncher": true,
		"isSystem": true,
		"packageName": "com.android.chrome",
		"versionCode": 584516331,
		"versionName": "116.0.5845.163"
	}
]

device:GetLocation

Provide information about device location (specific device)

curl --request GET \
  --url https://abc.gomobile.work/api/v1/device-location/id/:id \
  --header 'Authorization: Bearer <YourAPIKey>' \
  --header 'x-enterprise-id: <YourEnterpriseID>'

Note:

  • Change :id with device id that exist on the portal

Response field:

[
	{
		"created_at": "2023-08-22T15:24:08.545+07:00",
		"imei": "855987660414488",
		"accuracy": 23.055,
		"altitude": 198.5,
		"lat": -7.7952351,
		"lng": 110.3102452,
		"provider": "fused",
		"geofence_id": "",
		"inside_geofence": false,
		"using_mock_location": false
	}
]

device:GetLocation (Bulk)

Provide information about device location for all devices on the portal.

curl --request GET \
  --url 'https://abc.gomobile.work/api/v1/device-location/bulk?startdate=<Fill with Start date>&enddate=<FIll with End date>' \
 --header 'Authorization: Bearer <YourAPIKey>' \
  --header 'x-enterprise-id: <YourEnterpriseID>'

Note:

  • Start and End date format is YYYY-MM-DD

Response field:

[
	{
		"id": 54965,
		"accuracy": 22.5,
		"created_at": "2023-08-10T12:03:14.648+07:00",
		"imei": "356787873171325",
		"lat": -8.1909913,
		"lng": 112.0855203,
		"provider": "fused",
		"inside_geofence": true,
		"using_mock_location": false
	}
]