Schedule a Firmware Upgrade
# Schedule a Firmware Upgrade ### `POST /campaigns/firmware/{accountName}` This API allows you to schedule a firmware upgrade for devices. The response includes an upgrade ID that is included in all callback notifications about the status of the upgrade that you can use to check the status of the upgrade or cancel it. **Note:** A synchronous response with no errors means that the request has been accepted, but does not mean that the upgrade has been scheduled. If a callback URL has been registered, ThingSpace sends callback notification messages each time the status of an upgrade changes. If the account has a monthly recurring charge (MRC) subscription for the Software Management Services, a license must be assigned to each device to upgrade before an upgrade for those devices.can be scheduled ## HTTP Request [POST https://thingspace.verizon.com/api/fota/v3/campaigns/firmware/{accountName}](/docs/premium-apis/software-management/software-management-v2/api-endpoints/campaigns-v2/schedulecampaignfirmwareupgrade) ## Header Parameters The request header must contain a current ThingSpace authorization token, set the content to "JSON" and a current VZ-M2M-session token. |Parameter Name|Data Type|Description| |-----|-----|-----| | **Authorization** *(required)* | string | HTTP Authorization request header containing a valid Bearer token: `Authorization: Bearer {token}` | | **VZ-M2M-Token** *(required)* | string | A valid session token returned by a Connectivity Management `POST /session/login` request. | | **Content-Type** *(required)* | string | Must be `application/json`. | ## Request Parameters |Parameter Name|Data Type|Description| |-----|-----|-----| | **accountName** *(required)* | string | The billing name of the account. An account name is numeric, and must include any leading zeros. | ## Request Body The request body identifies the devices that you want to upgrade. |Parameter Name|Data Type|Description| |-----|-----|-----| | **campaignName** | string | The campaign name. | | **firmwareName** *(required)* | string | The name of the firmware being upgraded. | | **firmwareFrom** *(required)* | string | The name of the old firmware on the device. | | **firmwareTo** *(required)* | string | The name of the new firmware being upgrading to. | | **protocol** *(required)* | string | Valid values include: **LWM2M**. | | **startDate** *(required)* | string ($date) | Campaign start date. | | **endDate** *(required)* | string ($date) | Campaign end date. | | **campaignTimeWindowList** *(optional)* | array | | | **startTime** *(required)* | integer | Start hour in range [0-23], current hour >= `startTime`. When the current hour falls between the `startTime` and the `endTime`, the campaign starts. | | **endTime** *(required)* | integer | End hour in range [1-24], current hour < `endTime`. The `endTime` must be at least 4 hours after the `startTime`. | | **deviceList** *(required)* | array | Device IMEI list. | | **autoAssignLicenseFlag** *(optional)* | boolean | Valid values include: **True:** Any devices included in the device list which does not have a license will automatically assign a FOTA license assuming there are enough FOTA licenses available. **False:** Only devices included in the device list with a license be campaigned. | | **autoAddDevicesFlag** *(optional)* | boolean | Valid values include: **True:** Beyond the devices included on the device list, any other device(s) which matches the eligibility criteria (same make, model, current firmware, protocol, billing account) will automatically be added to the campaign list during the life of the campaign. **False:** Do not automatically add devices to the campaign. **Note:** This flag can be set to true or false when the autoAssignLicense flag is true and must be set to false when the `autoAssignLicense` flag is false. | Example Request: ```json { "campaignName":"Smart FOTA", "firmwareName":"SEQUANSCommunications_GM01Q_SR1.2.0.0-10512_SR1.2.0.0-10657", "firmwareFrom":"SR1.2.0.0-10512", "firmwareTo":"SR1.2.0.0-10657", "protocol":"LWM2M", "startDate":"2021-09-29", "endDate":"2021-10-01", "campaignTimeWindowList":[ { "startTime":18, "endTime":22 } ], "deviceList":[ "15-digit IMEI" ], "autoAssignLicenseFlag":"false", "autoAddDevicesFlag":"false" } ``` ## Success Responses **Status 200** ```json { "id": "f858b8c4-2153-11ec-8c44-aeb16d1aa652", "accountName": "0000123456-00001", "campaignName": "Smart FOTA", "firmwareName": "SEQUANSCommunications_GM01Q_SR1.2.0.0-10512_SR1.2.0.0-10657", "protocol": "LWM2M", "firmwareFrom": "SR1.2.0.0-10512", "firmwareTo": "SR1.2.0.0-10657", "make": "SEQUANS Communications", "model": "GM01Q", "status": "CampaignRequestPending", "startDate": "2021-09-29", "endDate": "2021-10-01", "autoAssignLicenseFlag":"false", "autoAddDevicesFlag":"false" } ``` ## Success Parameters |Parameter Name|Data Type|Description| |-----|-----|-----| | **id** | string | The campaign identifier. This is a 32 or 34-bit UUID. | | **accountName** | string | The billing account number. | | **campaignName** | string | The campaign name. | | **firmwareName** | string | The name of the firmware being upgraded. | | **protocol** | string | Valid values include: **LWM2M**. | | **make** | string | FOTA make of the device. | | **model** | string | FOTA model of the device. | | **firmwareFrom** | string | The name of the old firmware on the device. | | **firmwareTo** | string | The name of the new firmware to which you are upgrading. | | **status** | string | Campaign level status. | | **startDate** | string ($date) | Campaign start date. | | **endDate** | string ($date) | Campaign end date. | | **campaignTimeWindowList** | array | | | **startTime** | integer | Start hour in range [0-23], current hour >= `startTime`. | | **endTime** | integer | End hour in range [1-24], current hour < `endTime`. The `endTime` must be at least 4 hours after the `startTime`. | | **autoAssignLicenseFlag** | boolean | Valid values include: **True:** Any devices included in the device list which does not have a license will automatically assign a FOTA license assuming there are enough FOTA licenses available. **False:** Only devices included in the device list with a license be campaigned. | | **autoAddDevicesFlag** | boolean | Valid values include: **True:** Beyond the devices included on the device list, any other device(s) which matches the eligibility criteria (same make, model, current firmware, protocol, billing account) will automatically be added to the campaign list during the life of the campaign. **False:** Do not automatically add devices to the campaign. | ## Failure Responses All error messages are returned in this format: ```json { "errorCode": "error code string", "errorMessage": "error message string" } ``` Error codes and messages are listed on the [Error Messages page](https://thingspace.verizon.com/documentation/api-documentation.html#/http/software-management/guides/error-messages), along with explanations and suggestions for corrective actions.