Unique code for user to register

The great thing is that because of the nature of the Discourse application all of the actions are available via the API, since that is what the web interface is calling.

Here are the relevant API calls you might use in your scenario: