Get waiting room status
client.WaitingRooms.Statuses.Get(ctx, waitingRoomID, query) (*StatusGetResponse, error)
GET/zones/{zone_id}/waiting_rooms/{waiting_room_id}/status
Fetches the status of a configured waiting room. Response fields include:
status: String indicating the status of the waiting room. The possible status are:- not_queueing indicates that the configured thresholds have not been met and all users are going through to the origin.
- queueing indicates that the thresholds have been met and some users are held in the waiting room.
- event_prequeueing indicates that an event is active and is currently prequeueing users before it starts.
- suspended indicates that the room is suspended.
event_id: String of the current event'sidif an event is active, otherwise an empty string.estimated_queued_users: Integer of the estimated number of users currently waiting in the queue.estimated_total_active_users: Integer of the estimated number of users currently active on the origin.max_estimated_time_minutes: Integer of the maximum estimated time currently presented to the users.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get waiting room status
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/waiting_rooms"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
status, err := client.WaitingRooms.Statuses.Get(
context.TODO(),
"699d98642c564d2e855e9661899b7252",
waiting_rooms.StatusGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", status.EventID)
}
{
"result": {
"estimated_queued_users": 0,
"estimated_total_active_users": 0,
"event_id": "25756b2dfe6e378a06b033b670413757",
"max_estimated_time_minutes": 0,
"status": "queueing"
}
}Returns Examples
{
"result": {
"estimated_queued_users": 0,
"estimated_total_active_users": 0,
"event_id": "25756b2dfe6e378a06b033b670413757",
"max_estimated_time_minutes": 0,
"status": "queueing"
}
}