こんにちは。
外部 ID を使用して API を介してユーザーを作成および取得したいと考えています。外部 ID は、内部データベースの ID を参照する整数になります。これは SSO とは関係ありません。
ドキュメントに従っていますが、うまくいかないようです。ユーザーは作成できますが、external_id でユーザーを取得できません。Create User API では、external_ids オブジェクトを持つリクエストが表示されますが、オブジェクトの内容に関する追加情報はありません。コミュニティを検索しましたが、このトピックしか見つかりませんでしたが、あまり役に立ちませんでした。
次の GET リクエストを使用してユーザーを取得しようとしています。
https://our_domain.discourse.group/u/by-external/7000.json
しかし、404 と次の応答が返されます。
{
"errors": [
"The requested URL or resource could not be found."
],
"error_type": "not_found"
}
以下は、試した Create User リクエストの例です。ユーザーは正常に作成されますが、external_id で取得できません。(サイドノート:ユーザーの external_id を表示する方法もありますか?)
{
"name": "John",
"username": "Doe",
"email": "john.doe@example.com",
"password": "Z44Di3AeD93KoRUyxpyE",
"active": true,
"approved": true,
"external_id": 7000
}
{
"name": "John",
"username": "Doe",
"email": "john.doe@example.com",
"password": "Z44Di3AeD93KoRUyxpyE",
"active": true,
"approved": true,
"external_id": "7000"
}
{
"name": "John",
"username": "Doe",
"email": "john.doe@example.com",
"password": "Z44Di3AeD93KoRUyxpyE",
"active": true,
"approved": true,
"external_ids": {
"external_id": 7000
}
}
{
"name": "John",
"username": "Doe",
"email": "john.doe@example.com",
"password": "Z44Di3AeD93KoRUyxpyE",
"active": true,
"approved": true,
"external_ids": [
7000
]
}