Upswift REST API is open for all Upswift customers. Although, some calls are available only for paying customers.
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_token
and some of them require device_token
. Both can be found on each device after the device has been successfully registered to the platform inside the file: /etc/upswift/service/settings.json
.
Here is a ready-to-use piece of code to pull user_token
and device_token
automatically with a Python script from the device:
import jsonimport requestsUPSWIFT_SETTINGS_FILE = '/etc/upswift/service/settings.json'#Pull Upswift tokenswith open(UPSWIFT_SETTINGS_FILE) as json_file:data = json.load(json_file)#Upswift tokensuser_token = data['user_token']device_token = data['device_token']
The API is working with Upswift Agent versions 5.0 and above.
All endpoints' payload data is in JSON format.