API Reference - User Photos

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108065

← Back to API Reference | Getting Started

User Photos

User Photos stores profile images for members, including profile photos, logos, and cover photos. Each record tracks the filename, photo type, and processing status for a member's uploaded image.

Model name in URL: users_photo — DB table: users_photo

The User Photos Object

FieldTypeDescription
photo_idintegerUnique photo record ID (primary key, read-only)
user_idintegerID of the member this photo belongs to (foreign key to users)
filestringFilename of the uploaded image
originalstringFilename of the original unprocessed image before resizing (nullable)
typestringType of photo. One of: logo, photo, cover_photo
date_addedstringDate the photo was uploaded, formatted as YYYYMMDDHHmmss
resizedstringDate the image was resized/processed, formatted as YYYYMMDDHHmmss
errorstringError message from image processing, if any
compliantintegerWhether the image passed compliance checks (0 = not checked/non-compliant, 1 = compliant)

List User Photo Records

GET /api/v2/users_photo/get

Returns a paginated list of user photo records.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/users_photo/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "tablesExists": true,
      "photo_id": "1",
      "user_id": "1",
      "file": "cimage-1-436-photo.jpeg",
      "original": null,
      "type": "cover_photo",
      "date_added": "",
      "resized": "",
      "error": "",
      "compliant": "0"
    },
    {
      "tablesExists": true,
      "photo_id": "2",
      "user_id": "24",
      "file": "pimage-24-339-photo.png",
      "original": null,
      "type": "photo",
      "date_added": "",
      "resized": "",
      "error": "",
      "compliant": "0"
    }
  ],
  "total": "136",
  "current_page": 1,
  "total_pages": 68,
  "next_page": "MipfKjI="
}

Retrieve a User Photo Record

GET /api/v2/users_photo/get/{photo_id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/users_photo/get/1" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "tablesExists": true,
      "photo_id": "1",
      "user_id": "1",
      "file": "cimage-1-436-photo.jpeg",
      "original": null,
      "type": "cover_photo",
      "date_added": "",
      "resized": "",
      "error": "",
      "compliant": "0"
    }
  ],
  "total": "136",
  "current_page": 1,
  "total_pages": 6,
  "next_page": "MipfKjI1"
}

Create a User Photo Record

POST /api/v2/users_photo/create

Creates a new photo record for a member. Note: this creates a database record only; actual image upload is handled separately through the site's upload interface.

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/users_photo/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "user_id=1" \
  -d "file=pimage-1-500-photo.jpg" \
  -d "type=photo" \
  -d "date_added=20260403000000"

Example Response

Copy
{
  "status": "success",
  "message": {
    "photo_id": "910076",
    "user_id": "1",
    "file": "pimage-1-500-photo.jpg",
    "original": null,
    "type": "photo",
    "date_added": "20260403000000",
    "resized": null,
    "error": null,
    "compliant": null
  }
}

Update a User Photo Record

PUT /api/v2/users_photo/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/users_photo/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "photo_id=910076" \
  -d "type=logo"

Example Response

Copy
{
  "status": "success",
  "message": {
    "photo_id": "910076",
    "user_id": "1",
    "file": "pimage-1-500-photo.jpg",
    "original": null,
    "type": "logo",
    "date_added": "20260403000000",
    "resized": "",
    "error": "",
    "compliant": "0"
  }
}

Delete a User Photo Record

DELETE /api/v2/users_photo/delete

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/users_photo/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "photo_id=910076"

Example Response

Copy
{
  "status": "success",
  "message": "users_photo record was deleted"
}