Alguém sabe como obter o “external_id” de um usuário via API? Adicionei um external_id no login SSO, mas agora, ao consultar os usuários, não vejo nenhum “external_id” no hash de usuário retornado pela API. Estou tentando usar o external_id para identificar usuários do meu banco de dados ao processar um webhook.
Yes, this can be done by sending an authenticated GET request to https://discourse.example.com/u/by-external/{external_id}.json
This route is documented here: Discourse API Docs.
2 curtidas
And to get the inverse (ie obtain the external_id given a user_id) you can either:
-
Use the Discourse Ruby API and call the method: user_sso(user_id)
-
Send an authenticated get request to:
https://discourse.example.com/admin/users/{id}.json
and look for hash key [“single_sign_on_record”][“external_id”]
Note that single_sign_on_record (and external_id) is NOT returned by a call to:
https://discourse.example.com/users/{username}.json
2 curtidas
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.