# Get a presigned URL for the captured test-kit image

Operation ID: `diagnostics.getTestImage`

Get a presigned URL for the captured test-kit image

## Public method

`getTestImage`

Signature: `diagnostics.getTestImage(patientId, testId)`

Return type: `Promise<CapturedTestImageResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /patients/{patient_id}/diagnostics/{test_id}/image`

## Path parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `patient_id` | `string` | Yes |  |  |  | No |  |
| `test_id` | `string` | Yes |  |  |  | No |  |

## Query parameters

None.

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`CapturedTestImageResponse`](../models/CapturedTestImageResponse.md) | application/json | Time-limited presigned S3 GET URL for the image captured for this test result |

## Success response examples

### 200

```json
{
  "content_type": "string",
  "expires_in": 0,
  "image_url": "string",
  "storage_key": "string",
  "test_id": "00000000-0000-0000-0000-000000000000"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `401` | [`diagnostics.ErrorResponse`](../models/diagnostics.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |

## Error examples

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
```

```ts
const patientId = "<PATIENT_ID>";

const testId = "<TEST_ID>";

const result = await diagnostics.getTestImage(patientId, testId);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-diagnostics.health.cloud/patients/%3CPATIENT_ID%3E/diagnostics/%3CTEST_ID%3E/image'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
