> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.fortresstech.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.fortresstech.io/_mcp/server.

# Read Work Order Attachment Download Url

GET https://api.fortresstech.io/v1/workOrders/{workOrderId}/attachments/{attachmentId}/downloadUrl

Available by RequestIssue a short-lived signed URL for a work order attachment. The `url` on the attachment list is a storage reference and is not fetchable, so call this route to get a link you can open. The key needs an explicit `workOrders` read grant.`expiresInSeconds` defaults to 300 (5 minutes). The server clamps it to 60–900, so a larger request is capped at 900 and a smaller one raised to 60. It never rejects a value for being out of range. A non-integer value is a 400.Every issued link is access-logged. If the log write fails, no link is issued and the request fails with a 500.Fetch `url` with a plain GET and no auth header, before `expiresAt`. Tolerate `Content-Encoding: gzip`. The URL sets `Content-Disposition: inline` with the file name and the `contentType` returned here. Only PDF, JPEG, PNG, and GIF files are served. Any other type is a 415.After `expiresAt` the link stops working. Call this route again for a fresh link. Never store a download link as a permanent image reference.This route needs an explicit `workOrders` read grant on your API key, even when the key already works on the other work-order routes. To request the grant, contact our team.

Reference: https://developer.fortresstech.io/api-reference/work-orders/read-work-order-attachment-download-url

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `workOrderId` (string, required) — The id of the work order
- `attachmentId` (string, required) — The id of the attachment, from the attachment list

### Query parameters

- `expiresInSeconds` (integer, optional, default: 300) — Link lifetime in seconds. Clamped to 60–900 by the server; out-of-range values are coerced, not rejected

## Response

### 200

Expected response to a valid request

- `url` (string, required) — Signed link to the file. Fetch it with a plain GET and no auth header before `expiresAt`
- `expiresAt` (datetime, required) — The time after which the link stops working
- `attachmentId` (string, required) — The id of the attachment, as returned in the attachment list
- `workOrderId` (string, required) — The id of the work order
- `fileName` (string, required) — The file name the link serves
- `contentType` (string, required) — The media type of the file: `application/pdf`, `image/jpeg`, `image/png`, or `image/gif`. Any other stored type is refused with 415, so no link is issued.

## Errors

### 400 Bad Request Error

Validation error. `expiresInSeconds` is not an integer, `workOrderId` or `attachmentId` is not a UUID, or the key is an all-organizations key, which has no organization and cannot use this route

- `type` (string, optional)
- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 401 Unauthorized Error

The request has no `x-api-key` header. API Gateway rejects it before the authorizer runs, with its default `{"message": "Unauthorized"}` body

- `message` (string, optional)

### 403 Forbidden Error

Returned by the floo gateway itself when the API key has no permissions map, or when its map has no `workOrders` read. A key that works on the other work-order routes still gets 403 here until Fortress grants it. The request never reaches Fortress, so the body is API Gateway's default

- `Message` (string, optional)

### 404 Not Found Error

Not found. Identical for a missing attachment, an attachment on another work order, a deleted attachment, a missing file, and a work order outside your key's organization or properties

- `type` (string, optional)
- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 415 Unsupported Media Type Error

The attachment is not a PDF, JPEG, PNG, or GIF and is not served through a link

- `type` (string, optional)
- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

## Examples

**Response**

```json
{
  "url": "string",
  "expiresAt": "2024-01-15T09:30:00Z",
  "attachmentId": "string",
  "workOrderId": "string",
  "fileName": "string",
  "contentType": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	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://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fortresstech.io/v1/workOrders/workOrderId/attachments/attachmentId/downloadUrl")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```