Enable logging for a list of devices
# Enable Logging for a List of Devices ### `PUT /logging/{accountName}/devices` Enables logging for a list of specified devices. **Note**: Verbose Logging is available as long as the device OEM supports it. ## Uses and Requirements If pilot campaigns are not successful, you can enable and fetch logs for up to 20 devices. Logging turns off automatically after seven days to avoid unnecessary device resource usage. When the device checks in after that setting is enabled, the device starts collecting logs. The device periodically uploads those logs to ThingSpace and purges them from the device. After at least 24 hours, you can call the Verbose Logging API again to fetch the logs for analysis or can view the check-in history as reported by the FOTA server. (Note that Check-in history is independent of enabled or disabled logging.) After 30 days, the logs are purged from ThingSpace. ## HTTP Request PUT [https://thingspace.verizon.com/api/fota/v2/logging/{acc}/devices](/docs/premium-apis/software-management/software-management-v2/api-endpoints/client-logging/enableloggingfordevices) ## Resource Path Parameters You must include the account name in the path. | Parameter Name | Data Type | Description | |:----------------|:-----------|:-------------| | **accountName** <br> *required* | string | The name of the account for which you want the list of devices. An account name is usually numeric, and must include any leading zeros. | ## 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 | Parameter Name | Data Type | Description | |:----------------|:-----------|:-------------| | **deviceLogging** | array of deviceIds objects | The list of device ids for which you want to enable logging. | | **deviceIds** | string | List of device IMEI identifiers. | ## Example Request Enable logging for devices: ```json curl https://thingspace.verizon.com/api/fota/v2/logging/$ACC/devices -H 'Authorization: Bearer $AUTH_TOKEN' -H 'VZ-M2M-Token: $M2M_TOKEN' -d { deviceIds: [ "990013907835573", "991124018926684", "992234129057795", "998891785613351", "990013907835573" ] } ``` ## Success Responses **Status 200** A success response contains the account name and an array of device objects. | Parameter Name | Data Type | Description | |:----------------|:-----------|:-------------| | **deviceId** | string | The IMEI of the device. | | **expiryDate** | string($date) | The date when device logging expires. | ### Example Success Response ```json [ { "deviceId": "990013907835573", "expiryDate": "2020-10-19" }, { "deviceId": "991124018926684", "expiryDate": "2020-10-19" }, { "deviceId": "992234129057795", "expiryDate": "2020-10-23" }, { "deviceId": "998891785613351", "expiryDate": "2020-10-23" }, { "deviceId": "990013907835573", "expiryDate": "2020-10-23" } ] ``` ## 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.