Skip to content

Platforms API โ€‹

Manage which platforms are enabled, read connection statuses and dashboard notices, activate companion plugins, and handle the review/feed connection (OAuth) flow.

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

Policy: PlatformPolicy (applies to every endpoint on this page)


List Platforms โ€‹

GET /platforms

Return the list of all valid platforms.

Handler: PlatformController@index

Response โ€‹

json
{
  "message": "success",
  "platforms": { "google": { }, "facebook": { } }
}

Example โ€‹

bash
curl -X GET "https://example.com/wp-json/wpsocialreviews/v2/platforms" \
  -H "X-WP-Nonce: <nonce>" --cookie "wordpress_logged_in_xxx=..."

Enabled Platforms โ€‹

GET /platforms/enabled

Return the enabled platform map (reviews + feeds, plus a social_wall key) and any admin error notices.

Handler: PlatformController@enabledPlatforms

Response โ€‹

json
{
  "notices": [],
  "platforms": { "reviews": {}, "feeds": {}, "social_wall": {} }
}

Get Statuses โ€‹

GET /platforms/get-statuses

Read the per-platform enable/disable statuses (stored in the wpsr_statuses option).

Handler: PlatformController@getStatuses

Response โ€‹

json
{
  "statuses": {
    "platforms_statuses": {
      "feeds":   { "instagram": true },
      "reviews": { "google": true },
      "chats":   { "whatsapp": true }
    }
  }
}

Update Statuses โ€‹

POST /platforms/update-statuses

Persist platform statuses.

Handler: PlatformController@updateStatuses

Parameters โ€‹

ParameterTypeLocationRequiredDescription
statusesobjectbodyYes{ feeds: {slug: bool}, reviews: {slug: bool}, chats: {slug: bool} }

Response โ€‹

json
{ "message": "success" }

Returns an error envelope { "message": "Invalid statuses" } if the payload is malformed.


Dashboard Notices โ€‹

GET /platforms/dashboard-notices ยท POST /platforms/dashboard-notices

Read or update dashboard notice / newsletter flags.

Handlers: PlatformController@getDashboardNotices / updateDashboardNotices

GET response โ€‹

json
{
  "displayNotice": true,
  "displayOptInNotice": false,
  "displayProUpdateNotice": false,
  "userData": { "name": "Jane", "email": "jane@example.com" },
  "displayNewsletter": true,
  "customNotices": []
}

POST parameters โ€‹

ParameterTypeLocationRequiredDescription
argsobjectbodyYes{ notice_type: string, value: bool }

Subscribe โ€‹

POST /platforms/subscribe

Subscribe an email to the newsletter.

Handler: PlatformController@processSubscribeQuery

Parameters โ€‹

ParameterTypeLocationRequiredDescription
argsobjectbodyYes{ email: string, name: string }

Response โ€‹

json
{ "status": "success", "message": "...", "displayNewsletter": false }

Activate an Add-on โ€‹

POST /platforms/addons

Install/activate a companion plugin (TikTok feed or Fluent Forms). Requires the install_plugins capability.

Handler: AddonController@activePlugin

Parameters โ€‹

ParameterTypeLocationRequiredDescription
platformstringbodyYestiktok or fluent_forms

Response โ€‹

json
{ "message": "...", "is_installed": true }

Review Connection Configs โ€‹

Nested under /platforms/reviews. Handler: Platforms/Reviews/ConfigsController.

Get Configs โ€‹

GET /platforms/reviews/configs

Load a review platform's stored credentials and business info.

ParameterTypeLocationRequiredDescription
platformstringqueryYesPlatform slug
page / per_pageintegerqueryNoOpt-in pagination

Response:

json
{
  "credential": {},
  "additional_info": {},
  "business_info": {},
  "pagination": { "page": 1, "per_page": 10, "total": 0, "total_pages": 0 }
}

Prepare / Consume (OAuth) โ€‹

POST /platforms/reviews/configs/prepare ยท POST /platforms/reviews/configs/consume

Start and complete a platform's authentication flow.

ParameterTypeWhereNotes
platform, provider, flow, return_url, sourcemixedbodyprepare inputs
platform, result_id, flow_id, payloadmixedbodyconsume inputs

Return 423 ({ "message": ... }) when platform is missing. The JSON body is produced by the platform's auth handler.

Save / Sync / Delete โ€‹

MethodEndpointHandlerKey inputs
POST/platforms/reviews/configs@storeplatform, verificationData
POST/platforms/reviews@saveReviewssettings{ api_key, source_id, product_name, count, platform, url_value, credentialsType, language }, plus the Booking.com fields below
POST/platforms/reviews/configs/manually-sync-reviews@manuallySyncReviewsplatform, credentials{...}
DELETE/platforms/reviews/configs@deleteplatform, sourceId (use clear-locations to clear all) โ†’ { "message": "Clear Configurations" }

TIP

store, saveReviews, and manuallySyncReviews return no direct body โ€” they fire the platform's *_{platform} action, and the connected service (Google/Airbnb in core, others in Pro) produces the response. See Platform Services.

Booking.com fields on saveReviews 4.5.0: Booking.com connects by hotel ID, and the editor sends these inside settings:

FieldSanitizerMeaning
hotel_idintvalBooking's hotel id
ufiintvalBooking's city id for the hotel
hotel_name, hotel_country, hotel_locationsanitize_text_fieldHotel details stored with the connection
legacy_choicesanitize_text_fieldWhich saved property this hotel replaces, or new for none

Feed Connection Configs โ€‹

Nested under /platforms/feeds. Handler: Platforms/Feeds/ConfigsController.

MethodEndpointHandlerKey inputs
GET/platforms/feeds/configs@indexplatform
POST/platforms/feeds/configs@storeplatform, settings (JSON)
POST/platforms/feeds/configs/prepare@prepareplatform, provider, flow, return_url, source
POST/platforms/feeds/configs/consume@consumeplatform, result_id, flow_id, payload
DELETE/platforms/feeds/configs@deleteplatform, user_id (Instagram)

Like the review configs, these fire the feed platform's *_{platform} actions; the response body comes from the platform handler.

WP Social Ninja Developer Documentation