Documentation

TicketsApi

Import

Import

  • const { TicketsApi } = require("@unity-services/matchmaker-2.0");

Constructors

Constructor

  • Parameters

    • Optional configuration: Configuration
    • basePath: string = ...
    • axios: AxiosInstance = ...

    Returns TicketsApi

Methods

Create Ticket

  • Start matchmaking by creating a matchmaking ticket. Returns the ticket ID of the ticket created.

    summary

    Create a matchmaking ticket

    throws

    {RequiredError}

    memberof

    TicketsApi

    Parameters

    • Optional impersonatedUserId: string
    • Optional createTicketRequest: CreateTicketRequest
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<CreateTicketResponse>>

Delete Ticket

  • deleteTicket(id: string, impersonatedUserId?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>
  • End matchmaking by deleting a matchmaking ticket using its ticket ID. This is called when the user wants to cancel matchmaking.

    summary

    Delete a matchmaking ticket

    throws

    {RequiredError}

    memberof

    TicketsApi

    Parameters

    • id: string

      Ticket ID or Backfill Ticket ID. The ID is obtained from the response of the Create operation.

    • Optional impersonatedUserId: string
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<void>>

Get Ticket Status

  • getTicketStatus(id: string, impersonatedUserId?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<TicketStatusResponse>>
  • Gets the status of a ticket match assignment in the Matchmaker.
    Poll this resource until the match assignment is fulfilled. Rate of polling should not be more than once every second.

    summary

    Gets the status of a ticket match assignment in the matchmaker

    throws

    {RequiredError}

    memberof

    TicketsApi

    Parameters

    • id: string

      Ticket ID or Backfill Ticket ID. The ID is obtained from the response of the Create operation.

    • Optional impersonatedUserId: string
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<TicketStatusResponse>>