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

Example

Python
import json
import requests
#Upswift tokens
user_token = "<user token>"
device_token = "<device token>"
json_content = {'user_token': user_token,
'device_token': device_token,
'app_parameters': [{'app_parameter_name': "Temperature", 'app_parameter_value': "23c"},
{'app_parameter_name': "Counter", 'app_parameter_value': "123"}]}
call_request = requests.post("https://api.connect.jfrog.io/v1/send_app_monitor", json=json_content)
call_response = json.loads(call_request.text)
if call_request.status_code != 200:
if call_request.status_code == 429:
error = "API limit reached"
else:
error = call_response["error_message"]
print(error)
else:
response_message = call_response["message"]
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
import json
import requests
json_content = {'device_token': 'XXXXXXXXXXXXXXXXX',
'user_token': 'YYYYYYYYYYYYYYY',
'project_name': "TestProject"}
call_request = requests.get("https://api.connect.jfrog.io/v1/app_monitor_details", json=json_content)
call_response = json.loads(call_request.text)
if call_request.status_code != 200:
if call_request.status_code == 429:
error = "API limit reached"
else:
error = call_response["error_message"]
print(error)
else:
for record in call_response["message"]:
device_id = record["device_id"]
parameter_name = record["app_parameter_name"]
record_value = record["app_parameter_value"]
created_time = record["created_time"]