Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved How to kick a player from lobby using Admin API's

Discussion in 'Lobby' started by SachinGanesh, Jul 2, 2023.

  1. SachinGanesh

    SachinGanesh

    Joined:
    Jun 28, 2015
    Posts:
    19
    Hi, I want to kick a user from Lobby using UGS Admin APIs. But i get the following error

    {
    "code": 53,
    "detail": "user does not have authority to remove the specified player",
    "details": [],
    "status": 403,
    "title": "Forbidden",
    "type": "http://unity3d/lobby/errors/unknown"
    }

    I'm using ServiceAccount. How can I fix this?

    EndPoint: DELETE https://lobby.services.api.unity.com/v1/{lobbyId}/players/{playerId}
     
  2. bartj-unity

    bartj-unity

    Unity Technologies

    Joined:
    Sep 9, 2021
    Posts:
    25
    This API should work if you include the impersonated-user-id header (using the ID of the player you are removing). You could also use the Bulk Update API.
     
  3. SachinGanesh

    SachinGanesh

    Joined:
    Jun 28, 2015
    Posts:
    19
    Thank you!. It's working.
     
    bartj-unity likes this.