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.

Question How to delete a player from cURL

Discussion in 'Authentication' started by 8bitgoose, Oct 14, 2022.

  1. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    437
    So I am a total newbie to cURL and I am trying to remove all the extra players I created during testing phase.

    However I have no idea how to use the delete command with the REST API.

    Code (CSharp):
    1. curl --location --request DELETE 'https://player-auth.services.api.unity.com/v1/users/<userId>' \
    2. --header 'Content-Type: application/json' \
    3. --header 'ProjectId: <projectID>' \
    4. --header 'Authorization: Bearer <Id Token from Unity Authentication>'
    I've got the USER id and Project ID entered by what is the Bearer? How do I get authorized to delete a user in this instance?
     
  2. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    437
    Or just let me delete from the Game Services window please!
     
  3. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    177
    Hi there,
    apologies for the delayed response.
    At this moment it isn't possible to delete players directly.

    There are a few possible solutions.
    1) Create a development environment for testing purposes and simply leave those test players.
    2) If you have already sent those events/users to your production environment, create a support ticket requesting for data deletion
    3) Create a new project on the dashboard and bind to your existing project.
     
  4. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    437
    Hi @SebT_Unity,

    If I set up a support ticket and give all the player IDs I want deleted, will they do it for me??

    Already put a ton of users into my production database unfortunately.
     
  5. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    177
    Hi 8Bitgoose,
    Unfortunately it would delete all data for that environment.
    Do you have many players? If its a few test players it shouldn't skew your results however if we are talking thousands the I could understand your sentiment.

    I will add your feedback to delete players for our product managers.
     
  6. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    437
    We have about 20 test players. They just annoy me being there! Is there any use case for stopping the admin from deleting test users or is it just something in the pipeline that isn't super urgent?
     
    DavidZobrist likes this.