Upload a new file
# Upload a New File ### `POST /files/{accountName}` Uploads a configuration/supplementary file for an account. ThingSpace generates a fileName after the upload and is returned in the response. You will use the generated file name when listing or scheduling a campaign for the file. ## Uses and Requirements When uploading a configuration file, ThingSpace Software Management requires metadata about the file including the version, make, and model. Support of this feature requires explicit direction from the Device OEM who is responsible for providing templates and documentation for the files. ThingSpace Software Management acts as a delivery mechanism of the file and is not responsible for any misconfiguration done to the device. Please do not use this feature if your OEM has not instructed you on how to do it. Once the file has been uploaded, scheduling a file campaign follows a similar model of scheduling a software campaign. ## HTTP Request GET [https://thingspace.verizon.com/api/fota/v2/files/{accountName}](/docs/premium-apis/software-management/software-management-v2/api-endpoints/configuration-files/getlistoffiles) ## Resource Path Parameters | Parameter Name | Data Type | Description | |:-----------------------|:-----------|:-----------------------------------------------------| | **accountName** <br> _required_ | string | The account name. | ## 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 | |:---------------------------------|:--------------------------|:-------------------------------------------------------------------------------------------------------------------------------------| | **fileupload** <br> *required* | file | The file to upload. | | **fileVersion** <br>*required* | string | Version of the file. | | **make** <br>*required* | string | The software-applicable device make. | | **model** <br>*required* | string | The software-applicable device make. | | **localTargetPath** <br>*required* | string | Local target path on the device. | ## Example Request Request a software upgrade. ```json curl --location --request POST 'https://thingspace.verizon.com/api/fota/v2/files/$ACC/' \ --header 'VZ-M2M-Token: $M2M_TOKEN' \ --header 'Authorization: Bearer $AUTH_TOKEN' \ --form 'fileupload=@"/Users/files/hello-world.txt"' \ --form 'fileVersion="1.0"' \ --form 'make="Verizon"' \ --form 'model="VZW1"' \ --form 'localTargetPath="/VZWFOTA/hello-world.txt"' \ --form 'releaseNote="Hello world initial file"' ``` ## Success Responses **Status 200** | Parameter Name | Data Type | Description | |:---------------------------------|:--------------------------|:-------------------------------------------------------------------------------------------------------------------------------------| | fileName <br>*required* | string | ThingSpace-generated name of the file. You will use this name when listing or scheduling campaigns for the file. | | fileVersion <br>*required* | string | Version of the file. | | launchDate | string($date-time) | Software launch date. | | releaseNote <br>*required* | string | Software release note. | | make <br>*required* | string | The software-applicable device make. | | model <br>*required* | string | The software-applicable device model. | | localTargetPath <br>*required* | string | Local target path on the device. | | distributionType | string | Valid values include: <ul><li>LWM2M</li><li>OMD-DM</li><li>HTTP</li></ul> | | devicePlatformId <br>*required* | string | The platform (Android, iOS, etc.,) that the software can be applied to. | ## Example Success Response ```json { "fileName": "configfile-Verizon_VZW1_hello-world.txt", "fileVersion": "1.0", "releaseNote": "Hello world initial file", "make": "Verizon", "model": "VZW1", "localTargetPath": "/VZWFOTA/hello-world.txt", "distributionType": "HTTP", "devicePlatformId": "IoT" } ``` ## Failure Response **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.