Create a realtime streaming ticket
realtime.create_ticket() -> RealtimeCreateTicketResponse
POST/v2/realtime/ticket
Exchange your API key (or session) for a short-lived ticket that authenticates a connection to the realtime object-change stream. Open a WebSocket to the push endpoint with the returned ticket as the token query parameter. The ticket is single-purpose and expires quickly; call this again to obtain a fresh one before reconnecting.
Create a realtime streaming ticket
import os
from micro_so import Micro
client = Micro(
api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted
)
response = client.realtime.create_ticket()
print(response.expires_in){
"expires_in": 0,
"ticket": "ticket",
"ws_url": "ws_url"
}Returns Examples
{
"expires_in": 0,
"ticket": "ticket",
"ws_url": "ws_url"
}