# Get a practitioner photo

Operation ID: `provider.getPhoto`

Retrieve a practitioner's photo as a FHIR Binary resource. If ?binary_id= is omitted, it is auto-resolved from the practitioner's stored photo_binary_id extension, then from a Binary search by security context — either resolution fails with 400 if the practitioner has never uploaded a photo via provider.uploadPhoto.

## Public method

`getPhoto`

Signature: `provider.getPhoto(fhirPractitionerId, query)`

Return type: `Promise<Record<string, unknown>>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /practitioners/{practitioner_id}/photo`

## Path parameters

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

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `binary_id` | `string` | Yes |  |  |  | No | binary_id returned by upload_practitioner_photo |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`provider.GetPhotoResponse`](../models/provider.GetPhotoResponse.md) | application/json | Provider photo |

## Success response examples

### 200

```json
{
  "binary_id": "photo-example-001",
  "content_type": "image/jpeg",
  "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | No binary_id was supplied and none could be auto-resolved |
| `401` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `404` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | No FHIR Binary exists for the resolved binary_id |
| `500` | [`provider.ErrorResponse`](../models/provider.ErrorResponse.md) | application/json | Internal server error |

## Error examples

### 400 — The practitioner has no stored photo and no binary_id was supplied

```json
{
  "error": "Missing query parameter: binary_id"
}
```

### 401 — Missing or invalid access token

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

### 404 — The FHIR Binary resource does not exist

```json
{
  "error": "Photo not found"
}
```

### 500 — Unexpected service failure (sanitized example)

```json
{
  "error": "Internal server error"
}
```

## NodeJS / TypeScript implementation

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

```ts
const fhirPractitionerId = "<FHIR_PRACTITIONER_ID>";

const query = {
  "binary_id": "<BINARY_ID>"
};

const result = await provider.getPhoto(fhirPractitionerId, query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-provider.health.cloud/practitioners/%3CPRACTITIONER_ID%3E/photo?binary_id=%3CBINARY_ID%3E'
```

## 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.
