Register a callback listener
# Register a Callback Listener URL: #### `POST /callbacks/{account}` Registers a URL at which an account will receive messages from the Software Management Service when new firmware versions are available and when upgrades start and finish. The messages will be REST messages POSTed to the URL. You are responsible for creating and running a listening process on your server at that URL to receive and parse the messages. This request will replace the previously registered FOTA callback listener if there is one. ## Uses The callback messages will conform to the JSON callback schema shown on the About Callback Services page. You can follow these instructions to create a simple callback listener that will report the callback type and display any received callbacks on the console. ## Request Components #### HTTP Request #### `POST https://thingspace.verizon.com/api/fota/v1/callbacks/{account}` ## Resource Path and Query Parameters The account name must be included in the path. | Parameter Name | Data Type | Description | |-----|-----|-----| |**account** *(required)* | string | The name of the billing account for which you want to receive callback messages. An account name is usually numeric, and must include any leading zeros. | ## Header Parameters The request header must set the `content-type` to JSON, 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** *(required)* | string | HTTP Authorization bearer token: `Authorization: Bearer {token}` | | **VZ-M2M-Token** *(required)* | string | A valid session token: `VZ-M2M-Token: {M2Mtoken}` | | **Content-Type** *(required)* | string | Must be application/json `Content-Type: application/json` | ## Request Body The body specifies the callback service that is being subscribed to and the URL where the listening service is running. | Parameter Name | Data Type | Description | |-----|-----|-----| |**name** *(required)* | string | The name of the callback service that you want to subscribe to, which must be Fota for Software Management Services callbacks. | | **url** *(required)* | string | The address on your server where you have enabled a listening service for Software Management Services callback messages. Specify a secure URL (HTTPS) that is reachable from the Verizon data centers.| ## Example Request Body ```json { "name": "Fota", "url": "https://10.120.102.183:50559/CallbackListener/FirmwareServiceMessages.asmx" } ``` ## Success Responses **Status 200** | Parameter Name | Data Type | Description | |-----|-----|-----| |**accountName** | string | The name of the billing account for which callback messages will be sent.| |**serviceName** | string | The name of the callback service, which identifies the type and format of messages that will be sent to the registered URL. This will be Fota for the Software Management Services callback.| ## Example Success Response ```json { "accountName": "0204563412-00001", "serviceName": "Fota" } ``` ## 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](https://thingspace.verizon.com/documentation/api-documentation.html#/http/software-management/guides/error-messages) page, along with explanations and suggestions for corrective actions.