Anonymize user - blank response from API on attempt?

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:

https://github.com/discourse/discourse/blob/master/app/controllers/admin/users_controller.rb#L453-L460

What HTTP response code are you getting?

2 Likes

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.

5 Likes

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

5 Likes

This topic was automatically closed after 32 hours. New replies are no longer allowed.