How to programmatically retrieve the external_id for a topic

external_id is a property of the SingleSignOnRecord model. It’s used to link a user to an external site when DiscourseConnect is used to log users into Discourse via an external site. If this is what you are trying to find, it’s not available on the Topic. As far as I know, Discourse only returns the external_id on the front end for the CurrentUser, so if you are trying to do something like get the external_id of the topic’s author, it could be tricky.

If you post some more details about what you are trying to accomplish, someone here might be able to help. There might be some easier ways of approaching the problem than what you are trying to do.

Not a problem. That’s what we’re here for :slight_smile:

4 Likes