Device state
Device state
GET https://api.connect.jfrog.io/v1/get_device_state
Using this call you will get the current device state - Online or Offline.
Request Body
Name
Type
Description
user_token*
string
This is your account token. You can find it under the Settings category on the dashboard.
device_token
string
This is the device token. (See Notes below.)
device_id
String
This is the device ID or device UUID. (See Notes below.)
{"message": {"device_status": "online",
{"device_id": "d-1234-abcd"}}{"error_message": "<ERROR_MESSAGE>"}{}Notes:
Either the
device_tokenor thedevice_idmust be provided.You may use either
device_idordevice_uuidin thedevice_idfield. Either one will adequately function as an identifier.
Example
import json
import requests
json_content = {'device_id': 'd-1234-abcd',
'user_token': 'YYYYYYYYYYYYYYY'}
call_request = requests.get("https://api.connect.jfrog.io/v1/get_device_state", 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:
device_status = call_response["message"]["device_status"]
device_id = call_response["message"]["device_id"]
curl --location --request GET 'https://api.connect.jfrog.io/v1/get_device_state' \
--header 'Content-Type: application/json' \
--data-raw '{
"user_token": "YYYYYYYYYYYYYYY",
"device_id": "d-1234-abcd"
}'Last updated
Was this helpful?

