Get campaign history
# Get Campaign History ### `GET /reports/{accountName}/campaigns` Retrieve a list of campaigns for an account that have a specified campaign status. ## HTTP Request GET [https://thingspace.verizon.com/api/fota/v2/reports/{accountName}/campaigns](/docs/premium-apis/software-management/software-management-v2/api-endpoints/software-management-reports-v2/getcampaignhistorybystatus) ## Resource Path and Query Parameters | Parameter Name | Data Type | Description | |:----------------------|:-----------|:---------------------------------------------------------------------------------------------| | **accountName** <br> *required* | string | The account name. | | **campaignStatus** <br> *required query* | string | The campaign status. Valid values include: `CampaignRequestPending`, `CampaignRequestFailed`, `CampaignRequestQueued`, `CampaignCancelled`, `CampaignAborted`, `CampaignFailed`, `CampaignScheduled`, `CampaignEnded` | | **lastSeenCampaignId** <br> *query* | string | Only return campaign IDs larger than this value. Use 0 for the first request. If `hasMoreData`=true in the response, use the `lastSeenCampaignId` value from the response in the next request. | ## Header Parameters The request header must contain a current ThingSpace authorization token and a current VZ-M2M session token. For more details on how to get these tokens, visit [Getting Started](https://thingspace.verizon.com/documentation/api-documentation.html#/http/session-management/guides/getting-started). | Parameter Name | Data Type | Description | |:-----------------------|:-----------|:-----------------------------------------------------------------------------| | **Authorization** <br> _required_ | string | HTTP Authorization bearer token: <br> `Authorization: Bearer {token}` | | **VZ-M2M-Token** <br> _required_ | string | A valid session token: <br> `VZ-M2M-Token: {M2Mtoken}` | ## Request Body None. ## Example Request Get campaign history. ```json curl https://thingspace.verizon.com/api/fota/v2/reports/$ACC/campaigns?campaignStatus=CampaignEnded -H 'Authorization: Bearer $AUTH_TOKEN' -H 'VZ-M2M-Token: $M2M_TOKEN' -H ``` ## Success Responses **Status 200** | Parameter Name | Data Type | Description | |:----------------------|:--------------|:---------------------------------------------------------------------------------------------| | hasMoreData | boolean | Indicates if more data is available in the report. Use the `lastSeenCampaignId` to retrieve more data. | | lastSeenCampaignId | string | If `hasMoreData`=true in the response, use the `lastSeenCampaignId` value from the response in the next request. | | campaignList | array | List of campaigns and campaign details. | | campaignList.accountName | string | The account name. | | campaignList.id | string | Upgrade identifier. | | campaignList.campaignName | string | The campaign name. | | campaignList.softwareName | string | The name of the upgrade software. | | campaignList.distributionType | string | Valid values include: `LWM2M`, `OMD-DM`, `HTTP` | | campaignList.softwareFrom | string | The name of the old software on the device. | | campaignList.softwareTo | string | The name of the new software to which you upgraded. | | campaignList.make | string | Applicable make. | | campaignList.model | string | Applicable model. | | campaignList.startDate | string($date) | Campaign start date. | | campaignList.endDate | string($date) | Campaign end date. | | campaignList.downloadAfterDate | string($date) | Specifies the starting date you downloaded the package. | | campaignList.downloadTimeWindowList | array of startTime and endTime objects | List of allowed download time windows. | | campaignList.downloadTimeWindowList.startTime | integer | Start hour in range [0-23], current hour >= startTime. | | campaignList.downloadTimeWindowList.endTime | integer | End hour in range [1-24], current hour < endTime. | | campaignList.installAfterDate | string($date) | The date after which you installed the package. | | campaignList.installTimeWindowList | array of startTime and endTime objects | List of allowed install time windows. | | campaignList.installTimeWindowList.startTime | integer | Start hour in range [0-23], current hour >= startTime. | | campaignList.installTimeWindowList.endTime | integer | End hour in range [1-24], current hour < endTime. | | campaignList.status | string | Software upgrade status. Valid values include: `CampaignRequestPending`, `CampaignRequestFailed`, `CampaignRequestQueued`, `CampaignCancelled`, `CampaignAborted`, `CampaignFailed`, `CampaignScheduled`, `CampaignEnded` | ## Example Success Response ```json { "hasMoreData": true, "lastSeenCampaignId": "60b5d639-ccdc-4db8-8824-069bd94c95bf", "campaignList": [ { "accountName": "0402196254-00001", "id": "60b5d639-ccdc-4db8-8824-069bd94c95bf", "campaignName": "FOTA_Verizon_Upgrade", "softwareName": "FOTA_Verizon_Model-A_02To03_HF", "distributionType": "HTTP", "softwareFrom": "FOTA_Verizon_Model-A_00To01_HF", "softwareTo": "FOTA_Verizon_Model-A_02To03_HF", "make": "Verizon", "model": "Model-A", "startDate": "2020-08-21", "endDate": "2020-08-22", "downloadAfterDate": "2020-08-21", "downloadTimeWindowList": [ { "startTime": 20, "endTime": 21 } ], "installAfterDate": "2020-08-21", "installTimeWindowList": [ { "startTime": 22, "endTime": 23 } ], "status": "CampaignEnded" } ] } ``` ## Failure Responses **Status 400** 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, along with explanations and suggestions for corrective actions.