Skip to content

Records the current user vote on a survey post and returns the updated survey configuration with their choices flagged.

Send the chosen option identifiers in vote_indexes. The post must actually be of the survey content type and must have a valid option list; a survey past its end_date is refused. The returned options carry a voted flag for the caller.

Endpoint

  • Method: POST

  • Path: /feeds/{feed_id}/apps/survey-vote

  • Edition: Core

  • Controller: ReactionController@castSurveyVote

  • Route source: fluent-community/app/Http/Routes/api.php:78

  • Controller source: fluent-community/app/Http/Controllers/ReactionController.php

  • Requires a signed-in user who can read the post.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

POST Cast Survey Vote

POST
/feeds/{feed_id}/apps/survey-vote

Records the current user vote on a survey post and returns the updated survey configuration with their choices flagged.

Controller: ReactionController@castSurveyVote
Route source: fluent-community/app/Http/Routes/api.php:78

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Parameters

Path Parameters

feed_id*

Feed ID extracted from the URL path.

Type
integer
Required

Request Body

application/json
JSON
{
  
"vote_indexes": [
  
  
"string"
  
]
}

Responses

Successful response

application/json
JSON
{
  
"survey_config": {
  
  
"end_date": "string",
  
  
"options": [
  
  
  
{
  
  
  
  
"label": "string",
  
  
  
  
"slug": "string",
  
  
  
  
"vote_counts": 0,
  
  
  
  
"voted": true
  
  
  
}
  
  
],
  
  
"type": "string"
  
}
}

Playground

Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation