# Download file GET https://content-gateway-example.com/v1/files/{id}/download Retrieves and downloads the entire media file based on the specified file ID. A checksum is provided to validate the integrity of the downloaded file. Reference: https://docs.moveworks.com/api-reference/content-gateway/download-file ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Download file version: endpoint_.downloadFile paths: /files/{id}/download: get: operationId: download-file summary: Download file description: > Retrieves and downloads the entire media file based on the specified file ID. A checksum is provided to validate the integrity of the downloaded file. tags: - [] parameters: - name: id in: path required: true schema: type: string format: uuid responses: '200': description: >- Successfully retrieved the entire file. The response body contains the file data. content: application/octet-stream: schema: type: string format: binary '400': description: >- Bad Request - The request could not be understood by the server due to malformed syntax. content: {} '401': description: >- Unauthorized - Authentication is required and has failed or has not yet been provided. content: {} '403': description: >- Forbidden - Server understood the request but refuses to authorize it. content: {} '404': description: Not Found - The requested file could not be found. content: {} '429': description: Too Many Requests - Rate limit exceeded. content: {} '500': description: >- Internal Server Error - The server encountered an unexpected condition that prevented it from fulfilling the request. content: {} ``` ## SDK Code Examples ```python import requests url = "https://content-gateway-example.com/v1/files/id/download" response = requests.get(url) print(response.json()) ``` ```javascript const url = 'https://content-gateway-example.com/v1/files/id/download'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://content-gateway-example.com/v1/files/id/download" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://content-gateway-example.com/v1/files/id/download") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://content-gateway-example.com/v1/files/id/download") .asString(); ``` ```php request('GET', 'https://content-gateway-example.com/v1/files/id/download'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://content-gateway-example.com/v1/files/id/download"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/files/id/download")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```