Upload product firmware from the CLI

EDIT: After some searching I found the frontend endpoint here: Cloud API | Reference Documentation | Particle

Is there a CLI function (or api endpoint) that would allow me to upload versions of firmware from my desktop? Uploading through the product firmware upload modal is a hassle because I maintain several different products that need to have the same versions of software, and keeping the descriptions, titles and versions straight is tricky.

Thank you!

For anyone wanting a python implementation (uploading a binary file is a little tricky), here’s some sample code:

    url = f'https://api.particle.io/v1/products/{product_id}/firmware'
    credentials = get_email_and_access_token()
    headers = {
        'authorization': 'Bearer %s' % credentials['access_token'],
    }

    request_data = {
        'version': version,
        'title': title,
        'description': description,
    }
    with open(binary_path, 'rb') as f:
        response = requests.post(
            url,
            data=request_data,
            files={'binary': (filename, f)},
            headers=headers
        )

    result = response.json()
    print(result)
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.