Skip to content

Templates API โ€‹

Create and manage templates (the saved configurations rendered by [wp_social_ninja]), and read/update their per-platform meta for reviews and feeds.

Base URL: https://your-site.com/wp-json/wpsocialreviews/v2

Policy: TemplatePolicy


List Templates โ€‹

GET /templates

Handler: TemplatesController@index

Parameters โ€‹

ParameterTypeLocationRequiredDescription
exclude_woocommerceboolqueryNoExclude WooCommerce templates
templateTypestringqueryNoFilter by type
searchstringqueryNoSearch text
filterstringqueryNoAdditional filter

Response โ€‹

json
{
  "message": "success",
  "connected_platform_sections": {},
  "all_valid_platforms": {},
  "items": { "data": [], "total": 0 },
  "total_items": 0
}

Create ยท Duplicate ยท Delete ยท Rename โ€‹

ActionMethodEndpointHandlerInputsResponse
CreatePOST/templates@createplatform, onboarding, form_id, form_type{ "template_id": 55 }
DuplicatePOST/templates/duplicate@duplicateids[]{ "message", "item", "item_id" }
DeleteDELETE/templates@deleteids[]{ "message" }
RenamePUT/templates/title/{id}@updateTitlepath {id}, template_title{ "message", "title", "id", "result" }

Reviews Template Meta โ€‹

Nested under /templates/meta/reviews. Handler: Platforms/Reviews/MetaController.

Load editor data โ€‹

GET /templates/meta/reviews/{id}GET /templates/meta/reviews/{id}/first-round/{isFirstRound}

Initial load for the review-template editor. Returns a large payload:

json
{
  "message": "...",
  "template_id": 55,
  "business_info": {},
  "filtered_reviews": [],
  "template_details": {},
  "template_meta": {},
  "country_list": [],
  "post_types": [],
  "all_business_info": {},
  "categories": [],
  "elements": {},
  "errors": [],
  "resized_images": {},
  "image_settings": {},
  "needs_immediate_update": false,
  "can_enable_ai_summary": true,
  "review_forms": []
}

Other reviews-meta endpoints โ€‹

MethodEndpointHandlerInputsResponse
GET/templates/meta/reviews/{id}/can-enable-ai-summary@canUserEnableAISummarypath {id}{ "can_enable": true, "message" }
PUT/templates/meta/reviews/{id}@updatepath {id}, template_meta (JSON){ "message", "template_id", "template_meta" }
POST/templates/meta/reviews/{id}/edit@editpath {id}, template_metaLive-preview recompute (filtered_reviews, business_info, resize_data, โ€ฆ)
POST/templates/meta/reviews/{id}/load-more@loadMorepath {id}, page, template_meta{ "message", "reviews", "has_more", "current_page", "total_reviews" }

Feeds Template Meta โ€‹

Nested under /templates/meta/feeds. Handler: Platforms/Feeds/MetaController. These fire the feed platform's *_editor_settings_{platform} actions; the response body is produced by the platform handler.

MethodEndpointHandlerInputs
GET/templates/meta/feeds/{id}@indexpath {id}, platform, postType
PUT/templates/meta/feeds/{id}@updatepath {id}, platform, settings (JSON)
POST/templates/meta/feeds/{id}/edit@editpath {id}, platform, settings (JSON)

WP Social Ninja Developer Documentation