Set user registration IP address API endpoint

:information_source: Summary Create an API endpoint to set user_registration_ip
:hammer_and_wrench: Repository Link https://github.com/Nubebuster/discourse-set-user-ip
:open_book: Install Guide How to install plugins in Discourse

Abstract

When creating users with the existing API endpoint their registration ip address is set to the ip of the server/application that calls the api. This is a problem when you want to create users from an external service such as a minecraft server. This plugin provides a way to set the registration ip after user creation.

Features

This plugin creates the following API endpoint

POST /admin/set_user_ip#set_ip
Params: id=Number&ip=String

to set the user_registration_ip address of a user with a given forum id.

Example curl command

curl -X POST "http://127.0.0.1:3000/admin/set_user_ip#set_ip" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: <key>" \
-H "Api-Username: <username>" \
-F "id=1" \
-F "ip=127.0.0.1"

Example java code, including account creation

Can be found in the README.md

TODO

  • You can request changes and report bugs here
2 Likes