Data monitor
post
https://api.connect.jfrog.io/v1/
send_app_monitor
Send Data Monitor Records

Example

Python
1
import json
2
import requests
3
4
5
#Upswift tokens
6
user_token = "<user token>"
7
device_token = "<device token>"
8
9
json_content = {'user_token': user_token,
10
'device_token': device_token,
11
'app_parameters': [{'app_parameter_name': "Temperature", 'app_parameter_value': "23c"},
12
{'app_parameter_name': "Counter", 'app_parameter_value': "123"}]}
13
14
call_request = requests.post("https://api.connect.jfrog.io/v1/send_app_monitor", json=json_content)
15
call_response = json.loads(call_request.text)
16
17
if call_request.status_code != 200:
18
if call_request.status_code == 429:
19
error = "API limit reached"
20
else:
21
error = call_response["error_message"]
22
print(error)
23
else:
24
response_message = call_response["message"]
25
26
Copied!
get
https://api.connect.jfrog.io/v1/
app_monitor_details
Get Data Monitor Records
If you set device_token, you will receive the records for that device regardless if you also set the project_name. If only project_name is set, you will receive records from all devices of that project. If both of them are not set, you will receive records from all devices from all projects.

Example

Python
1
import json
2
import requests
3
json_content = {'device_token': 'XXXXXXXXXXXXXXXXX',
4
'user_token': 'YYYYYYYYYYYYYYY',
5
'project_name': "TestProject"}
6
7
call_request = requests.get("https://api.connect.jfrog.io/v1/app_monitor_details", json=json_content)
8
call_response = json.loads(call_request.text)
9
10
if call_request.status_code != 200:
11
if call_request.status_code == 429:
12
error = "API limit reached"
13
else:
14
error = call_response["error_message"]
15
print(error)
16
else:
17
for record in call_response["message"]:
18
device_id = record["device_id"]
19
parameter_name = record["app_parameter_name"]
20
record_value = record["app_parameter_value"]
21
created_time = record["created_time"]
22
Copied!