Anonymize user - blank response from API on attempt?

AI-generated summary

Frank_Bailey sought help with an issue where the Discourse API endpoint for anonymizing a user returned a blank response. Frank_Bailey initially suspected the endpoint might have been removed or renamed. michaeld clarified that the endpoint is still active and should return a JSON response with the username. Frank_Bailey later realized the issue was due to using HTTP instead of HTTPS, admitting his mistake. sam offered reassurance, noting that everyone makes mistakes.

Hi folks, I’m trying to hit the endpoint to anonymize a user in Discourse; I’ve got single sign-on between WordPress and Discourse set up, and when the user deletes their account on WordPress I want to anonymize them in Discourse. The endpoint is

/admin/users/{id}/anonymize:
put:
  description: |
    Anonymize a user
  tags:
    - Admin
  parameters:
    - name: id
      in: path
      required: true
      type: integer
  responses:
    '200':
      description: succesfully anonymized user
      schema:
        type: object
        properties:
          success:
            type: string
          username:
type: "string"

When I hit that endpoint with a PUT and a valid user ID, API key and username etc., I get no response. Blank page. I’m guessing I should definitely get some kind of response, so has this endpoint perhaps been removed or renamed in some way?

Nobody has any idea on this one?

No, the endpoint is not removed or renamed, and yes you should get the username back in json:

What HTTP response code are you getting?

Hi Michael. I’m an idiot. I was trying to hit http:// when the forum is set to https://

IDIOT IDIOT IDIOT

Thanks for trying to help.

Don’t feel that bad about it, we all make mitsakes sometimes.