> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m3ter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fileuploads

## Get File Upload Job Response

**Function name:** `m3ter_GetUploadJobResponse`
**Category:** READ
**HTTP method:** GET
**Destination:** m3ter

Get the file upload job response using the UUID of the file upload job.

Part of the file upload service for measurements ingest.

### Parameters

| Name                       | Label       | Type                   | Required | Description                           | Constraints                                                           |
| -------------------------- | ----------- | ---------------------- | :------: | ------------------------------------- | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials | M3terEntityParameter   |    Yes   | The m3ter credentials to use.         | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `id`                       | id          | LookupParameter        |    Yes   | UUID of the file upload job.          | -                                                                     |
| `statePath`                | State Path  | StateVariableParameter |    No    | State variable to store the response. | -                                                                     |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |

## List File Upload Jobs

**Function name:** `m3ter_ListJobs`
**Category:** READ
**HTTP method:** GET (paginated)
**Destination:** m3ter

Lists the File Upload jobs. Part of the File Upload service for measurements ingest:

* You can use the `dateCreatedStart` and `dateCreatedEnd` optional Query parameters to define a date range to filter the File Uploads jobs returned for this call.
* If `dateCreatedStart` and `dateCreatedEnd` Query parameters are not used, then all File Upload jobs are returned.

### Parameters

| Name                       | Label            | Type                    | Required | Description                                | Constraints                                                           |
| -------------------------- | ---------------- | ----------------------- | :------: | ------------------------------------------ | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials      | M3terEntityParameter    |    Yes   | The m3ter credentials to use.              | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `statePath`                | State Path       | StateVariableParameter  |    No    | State variable to store the response.      | -                                                                     |
| `queryParams`              | Query Parameters | KeyValueLookupParameter |    No    | Query parameters to include in the request | allowedValues: dateCreatedStart,dateCreatedEnd,fileKey                |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |

## Get Original File Download URL

**Function name:** `m3ter_GetJobOriginalFileDownloadUrl`
**Category:** READ
**HTTP method:** GET
**Destination:** m3ter

Use the original file upload job id to obtain a download URL, which you can then use to retrieve the file you originally uploaded to the file upload service:

* A download URL is returned together with a download job id.
* You can then use a `GET` using the returned download URL as the endpoint to retrieve the file you originally uploaded.

Part of the file upload service for submitting measurements data files.

### Parameters

| Name                       | Label       | Type                   | Required | Description                                                             | Constraints                                                           |
| -------------------------- | ----------- | ---------------------- | :------: | ----------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials | M3terEntityParameter   |    Yes   | The m3ter credentials to use.                                           | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `id`                       | id          | LookupParameter        |    Yes   | UUID of the file service job for the original measurements file upload. | -                                                                     |
| `statePath`                | State Path  | StateVariableParameter |    No    | State variable to store the response.                                   | -                                                                     |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |

## Generate Upload URL

**Function name:** `m3ter_GenerateUploadUrl`
**Category:** WRITE
**HTTP method:** POST
**Destination:** m3ter

Generate a URL for uploading a file containing measurements to the platform in preparation for the measurements it contains to be ingested:

* An upload URL is returned together with an upload job id:
* You can then upload your data measurements file using a `PUT` request using the returned upload URL as the endpoint.
* You can use the returned upload job id with other calls to the File Upload Service for any follow-up or troubleshooting.

**Important:**

* The `contentLength` request parameter is required.
* The upload URL is time limited - it is valid for ***one*** minute.

Part of the file upload service for submitting measurements data files.

### Parameters

| Name                       | Label        | Type                   | Required | Description                            | Constraints                                                           |
| -------------------------- | ------------ | ---------------------- | :------: | -------------------------------------- | --------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials  | M3terEntityParameter   |    Yes   | The m3ter credentials to use.          | m3terEntity: IntegrationCredentials, authType: M3TER\_SIGNED\_REQUEST |
| `requestPath`              | Request Path | StateVariableParameter |    Yes   | State variable containing the request. | -                                                                     |
| `statePath`                | State Path   | StateVariableParameter |    No    | State variable to store the response.  | -                                                                     |

### Exits

| Exit    | Description                                                                      |
| ------- | -------------------------------------------------------------------------------- |
| `NEXT`  | The API call succeeded.                                                          |
| `ERROR` | The API call failed. Error details are stored in the `m3shError` state variable. |
