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

device_id

String

This is the device id or device uuid

{"message": {"device_status": "online",
            {"device_id": "d-1234-abcd"}}

You may use either device_id or device_uuid in the device_id field, both identifiers 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"]

Last updated