Update trigger

Update Trigger

POST https://api.upswift.io/v1/set_update_trigger

When deploying OTA updates on devices, there are situations when your device state is not compatible with receiving new updates. If, for instance, your device is currently in use by the end-user, you would rather not deploy the new update at that time. Using the Update Trigger call, you can manage from within your application when you would like to receive updates, and when not to. After setting the update trigger, your device will not receive new updates until you unset the trigger.

Request Body

NameTypeDescription

user_token

string

This is your account token. Can be found under the Settings category on Upswift dashboard.

device_token

string

This is your device token.

trigger_set

boolean

Set to true to NOT receive new updates. Set to false to receive new updates

{"message": "Success"}

Example

import json
import requests


#Upswift tokens
user_token = "<user token>"
device_token = "<device token>"

json_content = {'user_token': user_token,
                'device_token': device_token,
                'trigger_set': True}

call_request = requests.post("https://api.upswift.io/v1/set_update_trigger", 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"]

Last updated