Is a theme component or plugin best for external API calls?

We have a certification program and want to allow users to join the certified group after confirming their certification ID.

The current idea:

  • Have a button in a plugin outlet
  • On click, open a modal for them to input their certification ID
  • Send the ID to the API, and display a message according to the result
  • Add them to the group if they’re verified

I want to understand if this is best suited as a Plugin or a Theme component since it’s dealing with API calls

1 Like

This is the full monty:

But depends if your certification programme grants verifiable credentials …

1 Like

I think this might be a little different :thinking: Our certification is “someone finished a course and where given a certification with an ID”.

It’s an in house system, rather than an exisiting platform if that makes any difference. Currently, it takes 2 pieces of info (the users email, and the ID) and will return the certifications they have completed

2 Likes

You might get away with a User Field which are exposed on the API.

If not, you’ll need a plugin.

But you’ll need to work out who can see what.

If this is confidential to the User or it’s ok for others to see it etc.

See:

2 Likes

Amazing!

So thinking out aloud here:

  • User field that is only visible to the user themselves (plus Admins etc)
  • Webhook when “user is updated” should contain contain the ID
  • Send the data to a “middle service” that can check the certification API, and then call the add to group Discourse API

Sounds like the most straight forward approach, rather than a plugin

2 Likes