Using Upswift REST API, users can pull information of their devices fleet to make different actions such as schedule update deployments, send log files, change device name, etc..
Each device can send up to 3 API calls in a minute. If you reach the limit, you will receive an appropriate response code. Please check the response codes and send no more calls than the limit. Otherwise, your device may get banned for API calls. All calls require
user_tokenand some of them require
user_tokencan be found at the Settings category on Upswift dashboard under your account. The
device_tokencan be found in the file
/etc/upswift/service/settings.jsonon devices with agent version under 5.4, for devices with agent 5.4 and above, you can run the agent with the flag
--print-tokento receive the device token:
Here is a ready-to-use piece of code to pull
device_tokenautomatically with a Python script from the device (on devices with agent under version 5.4):
UPSWIFT_SETTINGS_FILE = '/etc/upswift/service/settings.json'
#Pull Upswift tokens
with open(UPSWIFT_SETTINGS_FILE) as json_file:
data = json.load(json_file)
user_token = data['user_token']
device_token = data['device_token']
For devices with Upswift agent version 5.4 and above, you will have to get the
user_tokenfrom Upswift dashboard and the
device_tokenby running the agent on the device with the flag
All endpoints' payload data is in JSON format.