Create a poll
client.RealtimeKit.ActiveSession.NewPoll(ctx, appID, meetingID, params) (*ActiveSessionNewPollResponse, error)
POST/accounts/{account_id}/realtime/kit/{app_id}/meetings/{meeting_id}/active-session/poll
Creates a new poll in an active session for the given meeting ID.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Create a poll
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/realtime_kit"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
response, err := client.RealtimeKit.ActiveSession.NewPoll(
context.TODO(),
"app_id",
"meeting_id",
realtime_kit.ActiveSessionNewPollParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Options: cloudflare.F([]string{"string"}),
Question: cloudflare.F("question"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
{
"data": {
"action": "action",
"poll": {
"id": "id",
"options": [
{
"count": 0,
"text": "text",
"votes": [
{
"id": "id",
"name": "name"
}
]
}
],
"question": "question",
"anonymous": true,
"created_by": "created_by",
"hide_votes": true,
"voted": [
"string"
]
}
},
"success": true
}Returns Examples
{
"data": {
"action": "action",
"poll": {
"id": "id",
"options": [
{
"count": 0,
"text": "text",
"votes": [
{
"id": "id",
"name": "name"
}
]
}
],
"question": "question",
"anonymous": true,
"created_by": "created_by",
"hide_votes": true,
"voted": [
"string"
]
}
},
"success": true
}