Get Current Session

Retrieve the current session for a server.

GET https://api.sonorancms.com/v2/community/sessions/current

Rate limit: 27 requests per minute

Authenticated v2 endpoints are rate limited per credential rather than per IP address.

Retrieve the current session for a server.

Query Parameters

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| serverId | number | Yes | See example request for the shape. |

Example Request

local Sonoran = require("sonoran")

local sonoran = Sonoran.createClient({
  product = Sonoran.productEnums.CMS,
  apiKey = "YOUR_API_KEY",
  communityId = "YOUR_COMMUNITY_ID",
  defaultServerId = 1,
  timeoutMs = 30000,
})

local serverId = 1

local response = sonoran.cms:getCurrentSessionV2(serverId)

if response.success then
  print(response.data)
else
  print(response.reason)
end

Response

The data object is the session row. GET, POST, and PATCH all return the CommunityServerSession entity shape on success.

Last updated

Was this helpful?