Skip to main content

SupportAPI

MethodDescription
CreateSupportTicketCreate a ticket
ListSupportTicketsList my tickets
GetSupportTicketGet one ticket
SendSupportMessageSend a message
ConnectSupportTicketWebSocketLive ticket stream
ticketBody := analogwakatime.NewCreateSupportTicketRequest(
"Statistics are not updating",
"My weekly dashboard has not changed since this morning.",
)
ticket, _, err := client.SupportAPI.
CreateSupportTicket(ctx).
CreateSupportTicketRequest(*ticketBody).
Execute()

tickets, _, err := client.SupportAPI.
ListSupportTickets(ctx).
Page(1).
PerPage(20).
Status("open").
Execute()

const ticketID = "TICKET_ID"
ticket, _, err := client.SupportAPI.GetSupportTicket(ctx, ticketID).Execute()

messageBody := analogwakatime.NewSendSupportMessageRequest(
"The issue also affects the desktop dashboard.",
)
messageBody.SetClientMessageId("MESSAGE_UUID")

message, _, err := client.SupportAPI.
SendSupportMessage(ctx, ticketID).
SendSupportMessageRequest(*messageBody).
Execute()

response, err := client.SupportAPI.
ConnectSupportTicketWebSocket(context.Background(), ticketID).
Token(apiToken).
Execute()

clientMessageId prevents accidental duplicate messages when the client retries.