In a Dev category discussion titled ‘Unique code for user to register,’ guiqis seeks a way to let users register on their Discourse forum using a unique transaction code from their product’s purchase system, aiming to automate registration without manually sending invites daily. vulkanino suggests using invites linked to special groups, but guiqis finds this impractical for daily sales volume. supermathie proposes automating the process via Discourse’s API — either by having the sales backend generate and send invites automatically, or by creating a verification page on the product site that validates transaction IDs and triggers invite generation. guiqis confirms this would be ideal if feasible. supermathie reassures that Discourse’s API supports these actions, providing links to relevant endpoints: Invite a user by email and Generate an invite link without email. The consensus is that API automation is viable and preferable to manual invites or custom plugins.
Is it possible to have an unique code from another application (like those purchase codes that people use to activate softwares and support) for the users to register?
I’m using discourse as an exclusive forum for users who have purchased my product. So I would like to make the registration process easier, by asking them to put their transaction code (that I can get via api) in the registration form.
Does anyone know a plugin or code for that? (Or even if it’s possible?)
That’s what I’m doing right now, but my product has sales every day. So it’s complicated for me to send those bulk invitations every day, or every week. Not complicated, but it would be better to have the option that I’ve mentioned
If so, you could instead have your sales backend send an API call to Discourse that generates the invite and sends it to the user.
If you don’t want to have this happen on every purchase, you could also put a page on your site that verifies the transaction ID and calls the invite API.
This might be a more straightforward approach than a plugin.
It seems awesome both of the options. If they’re possible I can hire a developer. The point is that I’m not sure if an API like this would work with discourse. If so, that would be amazing.
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: