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.

Model name in URL: data_posts — DB table: data_posts

The Post Object

FieldTypeDescription
post_idintegerUnique post ID (primary key, read-only)
user_idintegerID of the member who owns this post required on create
data_idintegerPost type (data category) ID required on create
post_titlestringPost title/headline
post_captiontextShort caption or excerpt
post_contenttextFull post content (HTML allowed)
post_imagestringMain image filename
post_videostringVideo URL or embed code
post_statusinteger0=Draft, 1=Published
post_featuredinteger1 if post is featured, 0 otherwise
sticky_postinteger1 if post is pinned to the top
post_categorystringCategory name for this post
post_tagsstringComma-separated tags
post_pricenumberPrice (for products or services)
post_locationstringLocation or address
latstringLatitude coordinate
lonstringLongitude coordinate
post_datestringPublication/event date
post_live_datestringDate post goes live (format: YYYYMMDDHHmmss)
post_expire_datestringDate post expires
post_authorstringAuthor name
post_tokenstringUnique post token (auto-generated)
post_filenamestringURL-friendly post slug
post_typestringPost type label
post_clicksintegerNumber of times this post has been viewed/clicked
post_jobstringJob title (for job listing post types)
recurring_typeintegerRecurring event type: 0=non-recurring (for event post types)
revision_timestamptimestampLast modified timestamp (auto-updated)
revision_countintegerNumber of times this post has been edited
post_updatedstringDate post was last updated
post_org_urlstringOriginal source URL (for imported or syndicated posts)
feed_idintegerRSS/import feed ID that created this post
blog_idintegerBlog ID associated with this post
post_image_savedinteger1 if the post image has been saved locally
twitter_postintegerTwitter/social post ID or flag for social sharing
service_idintegerRelated service category ID
additional_fieldstextCustom field data stored as serialized or JSON content
post_start_datestringStart date for events or time-bound posts
data_typestringData type classification for this post
country_snstringCountry short name/code (e.g. US)
state_snstringState/province short name/code (e.g. CA)
sticky_post_expiration_datedateDate when sticky post status expires
image_importedstringImage import status: 0=not imported, 1=imported, 2=failed
original_image_urlstringOriginal URL of the image before import

List Posts

GET /api/v2/data_posts/get
Copy
# 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

GET /api/v2/data_posts/get/{post_id}
Copy
curl -X GET "https://www.yourdomain.com/api/v2/data_posts/get/88" \
  -H "X-Api-Key: your-api-key-here"

Create a Post

POST /api/v2/data_posts/create

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

Copy
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

Copy
{
  "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

PUT /api/v2/data_posts/update
Copy
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

DELETE /api/v2/data_posts/delete
Copy
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

POST /api/v2/data_posts/search

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

ParameterTypeDescription
qstringKeyword to search across post data
categorystringCategory to filter by
data_idintegerData category (post type) ID
user_idintegerLimit results to a specific member
pageintegerPage number
limitintegerResults per page
Copy
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"