API Reference - Single Image Posts
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108050
← Back to API Reference | Getting Started
Posts
Posts are content items published on member profiles — listings, blog posts, events, jobs, products, and any other custom content type configured on your site. Both single-image and multi-image posts use the same data_posts model.
data_posts — DB table: data_postsThe Post Object
| Field | Type | Description |
|---|---|---|
post_id | integer | Unique post ID (primary key, read-only) |
user_id | integer | ID of the member who owns this post required on create |
data_id | integer | Post type (data category) ID required on create |
post_title | string | Post title/headline |
post_caption | text | Short caption or excerpt |
post_content | text | Full post content (HTML allowed) |
post_image | string | Main image filename |
post_video | string | Video URL or embed code |
post_status | integer | 0=Draft, 1=Published |
post_featured | integer | 1 if post is featured, 0 otherwise |
sticky_post | integer | 1 if post is pinned to the top |
post_category | string | Category name for this post |
post_tags | string | Comma-separated tags |
post_price | number | Price (for products or services) |
post_location | string | Location or address |
lat | string | Latitude coordinate |
lon | string | Longitude coordinate |
post_date | string | Publication/event date |
post_live_date | string | Date post goes live (format: YYYYMMDDHHmmss) |
post_expire_date | string | Date post expires |
post_author | string | Author name |
post_token | string | Unique post token (auto-generated) |
post_filename | string | URL-friendly post slug |
post_type | string | Post type label |
post_clicks | integer | Number of times this post has been viewed/clicked |
post_job | string | Job title (for job listing post types) |
recurring_type | integer | Recurring event type: 0=non-recurring (for event post types) |
revision_timestamp | timestamp | Last modified timestamp (auto-updated) |
revision_count | integer | Number of times this post has been edited |
post_updated | string | Date post was last updated |
post_org_url | string | Original source URL (for imported or syndicated posts) |
feed_id | integer | RSS/import feed ID that created this post |
blog_id | integer | Blog ID associated with this post |
post_image_saved | integer | 1 if the post image has been saved locally |
twitter_post | integer | Twitter/social post ID or flag for social sharing |
service_id | integer | Related service category ID |
additional_fields | text | Custom field data stored as serialized or JSON content |
post_start_date | string | Start date for events or time-bound posts |
data_type | string | Data type classification for this post |
country_sn | string | Country short name/code (e.g. US) |
state_sn | string | State/province short name/code (e.g. CA) |
sticky_post_expiration_date | date | Date when sticky post status expires |
image_imported | string | Image import status: 0=not imported, 1=imported, 2=failed |
original_image_url | string | Original URL of the image before import |
List Posts
# Get all published posts for a specific member curl -X GET "https://www.yourdomain.com/api/v2/data_posts/get?property=user_id&property_value=42&limit=25" \ -H "X-Api-Key: your-api-key-here"
Retrieve a Post
curl -X GET "https://www.yourdomain.com/api/v2/data_posts/get/88" \ -H "X-Api-Key: your-api-key-here"
Create a Post
Creates a new post. The user_id, data_id (post type ID), and data_type are required. The data_type value can be obtained from the Post Types endpoint (data_categories/get).
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/data_posts/create" \ -H "X-Api-Key: your-api-key-here" \ -d "user_id=42" \ -d "data_id=3" \ -d "data_type=4" \ -d "post_title=My+New+Listing" \ -d "post_caption=Short+description+here" \ -d "post_content=%3Cp%3EFull+details+of+my+listing%3C%2Fp%3E" \ -d "post_status=1" \ -d "post_price=150.00"
Example Response
{
"status": "success",
"message": {
"post_id": 312,
"user_id": 42,
"data_id": 3,
"post_title": "My New Listing",
"post_status": 1,
"post_token": "f9e8d7c6b5a4"
}
}Update a Post
curl -X PUT "https://www.yourdomain.com/api/v2/data_posts/update" \ -H "X-Api-Key: your-api-key-here" \ -d "post_id=312" \ -d "post_title=Updated+Listing+Title" \ -d "post_price=175.00"
Delete a Post
curl -X DELETE "https://www.yourdomain.com/api/v2/data_posts/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "post_id=312"
Search Posts
Performs a full-text post search with category and location filtering. Results vary by post type configuration -- passing data_id to scope the search to a specific post type is strongly recommended. Some post types may require additional parameters depending on their configuration.
Search Parameters
| Parameter | Type | Description |
|---|---|---|
q | string | Keyword to search across post data |
category | string | Category to filter by |
data_id | integer | Data category (post type) ID |
user_id | integer | Limit results to a specific member |
page | integer | Page number |
limit | integer | Results per page |
curl -X POST "https://www.yourdomain.com/api/v2/data_posts/search" \ -H "X-Api-Key: your-api-key-here" \ -d "q=renovation" \ -d "data_id=3"
