Photos & Documents
Retrieve face images and manage the file documents attached to a person. These endpoints return or accept binary content (images / files), so the Curl and PowerShell examples are the most direct.
API Endpoints
- Base URL (Cloud):
https://customername.econnectcloud.com/identities - Base URL (On-prem):
https://<server-host-or-ip>:5009
| Method | Endpoint | Description | Permission |
|---|---|---|---|
GET | /api/v1/people/enrollmentPhoto/{faceId} | Download a face's enrollment photo (JPEG). | Authenticated |
GET | /api/v1/people/detectionPhoto/{faceId}/{detectionId} | Download a detection photo (JPEG). | Authenticated |
POST | /api/v1/people/fileDocuments/upload | Upload a file document for a person (multipart). | Add Identity Files |
GET | /api/v1/people/{personId}/fileDocuments/{documentId}/data | Download a file document. | Read Identity Files |
Authentication
Requires a JWT bearer token. See Authentication.
Permissions
The permission names and category below are what you'll see in the Identities web app under System → System settings → Roles.
| Operation | Permission | Category |
|---|---|---|
| Enrollment / detection photos | (any authenticated user) | — |
| Upload a file document | Add Identity Files | Identities |
| Download a file document | Read Identity Files | Identities |
Code Examples
- Curl
- PowerShell
- C#
API_URL="https://customername.econnectcloud.com/identities"
TOKEN="your_jwt"
# Download an enrollment photo (JPEG) by faceId
curl -sk "$API_URL/api/v1/people/enrollmentPhoto/<faceId>" \
-H "Authorization: Bearer $TOKEN" -o enrollment.jpg
# Download a detection photo (JPEG)
curl -sk "$API_URL/api/v1/people/detectionPhoto/<faceId>/<detectionId>" \
-H "Authorization: Bearer $TOKEN" -o detection.jpg
# Upload a file document for a person (multipart). personId + name are required.
curl -sk -X POST "$API_URL/api/v1/people/fileDocuments/upload" \
-H "Authorization: Bearer $TOKEN" \
-F "personId=0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d" \
-F "name=ID Card" \
-F "description=Front of ID" \
-F "file=@id-card.pdf"
# Download a file document by its public document id
curl -sk "$API_URL/api/v1/people/0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d/fileDocuments/<documentId>/data" \
-H "Authorization: Bearer $TOKEN" -o id-card.pdf
$API_URL = "https://customername.econnectcloud.com/identities"
$TOKEN = "your_jwt"
$headers = @{ Authorization = "Bearer $TOKEN" }
# Download an enrollment photo (JPEG) by faceId
Invoke-WebRequest -Uri "$API_URL/api/v1/people/enrollmentPhoto/<faceId>" `
-Headers $headers -OutFile enrollment.jpg
# Upload a file document for a person (multipart). personId + name are required.
$form = @{
personId = "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"
name = "ID Card"
description = "Front of ID"
file = Get-Item -Path "id-card.pdf"
}
Invoke-RestMethod -Uri "$API_URL/api/v1/people/fileDocuments/upload" -Method Post `
-Headers $headers -Form $form
# Download a file document by its public document id
Invoke-WebRequest -Uri "$API_URL/api/v1/people/0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d/fileDocuments/<documentId>/data" `
-Headers $headers -OutFile id-card.pdf
using eConnect.IdentitiesDbSdk;
// NuGet: eConnect.IdentitiesDbSdk (private package - request access from eConnect support).
var httpClient = new HttpClient();
var sdk = await IdentityDbSdk.GetSdk(
"https://customername.econnectcloud.com/identities",
httpClient,
"your_username",
"your_password");
// Enrollment photo bytes via the SDK
byte[] photo = await sdk.GetEnrollmentPhotoAsync("<faceId>");
await File.WriteAllBytesAsync("enrollment.jpg", photo);
// Detection-photo download and file-document upload/download are binary / multipart
// operations - call them directly over REST (see the Curl / PowerShell tabs).
Photos
enrollmentPhoto and detectionPhoto return raw image/jpeg bytes (HTTP 200), or 404 if the image isn't found.
Write the response to a file (-o in curl, -OutFile in PowerShell).
Upload a File Document
POST /api/v1/people/fileDocuments/upload is a multipart/form-data request:
| Form field | Required | Description |
|---|---|---|
file | Yes | The file to store (any form part that carries a filename). |
personId | Yes | The person (GUID) the document belongs to. |
name | Yes | Display name for the document. |
description | No | Optional description. |
publicId | No | Caller-supplied id; a GUID is generated if omitted. Use this value as {documentId} when downloading. |
Returns 200 OK on success.
Response Codes
| Code | Meaning |
|---|---|
200 OK | Success (image/file bytes for downloads; empty body for upload). |
400 Bad Request | Upload missing personId or name, or not a multipart request. |
404 Not Found | The requested photo or document does not exist. |
401 Unauthorized | Missing or invalid JWT. |
403 Forbidden | The user lacks the required Identities files permission. |