안녕하세요,
API를 사용하여 external_id를 통해 사용자를 생성하고 검색하고 싶습니다. external_id는 내부 데이터베이스의 ID를 참조하는 정수(integer)입니다. 이는 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
]
}