Skip to content

Add phone_number support to the createAUser request body#34

Open
jeong-hasang wants to merge 1 commit into
sendbird:mainfrom
jeong-hasang:feat/create-user-phone-number
Open

Add phone_number support to the createAUser request body#34
jeong-hasang wants to merge 1 commit into
sendbird:mainfrom
jeong-hasang:feat/create-user-phone-number

Conversation

@jeong-hasang

@jeong-hasang jeong-hasang commented Jun 11, 2026

Copy link
Copy Markdown

The business-messaging user-information docs state that phone_number can be sent in the request body of POST https://api-{application_id}.sendbird.com/v3/users, and registering a phone number does work in practice. However, UserApi.createAUser cannot accept phone_number, so it is impossible to set it on a user through sendbird-platform-sdk.

To allow registering a phone number on a Sendbird user via sendbird-platform-sdk, this adds an optional phoneNumber (wire: phone_number) field to the CreateAUserRequest model so the phone number can be sent in the POST /v3/users request body.

Why the lastSeenAt fix is included

Sendbird enforces a global uniqueness constraint on phone_number that persists even after the user is deleted, making stable repeated test runs difficult with the current test approach. End-to-end behavior was verified manually against a live app.

lastSeenAt fix included

The existing createAUser test had an incorrect assertion for lastSeenAt, causing it to fail. Fixed to match the value actually sent in the request.

CHANGELOG / version

CHANGELOG and the package.json version are intentionally left untouched. If a CHANGELOG entry or a version bump should be part of this PR, please comment with the target version and I will add it along with a CHANGELOG entry.

@jeong-hasang jeong-hasang changed the title Feat: createAUser에 phone_number 요청 필드 지원 추가 Add phone_number support to the createAUser request body Jun 11, 2026
@jeong-hasang jeong-hasang force-pushed the feat/create-user-phone-number branch from 4e768ae to 65337c9 Compare June 11, 2026 13:37
CreateAUserRequest 모델에 phoneNumber(wire: phone_number) optional 필드를
추가하여 POST /v3/users 요청 body에 전화번호를 전송할 수 있도록 한다.
map 기반 직렬화라 모델만 수정하면 상위 계층은 자동 반영된다.

- models/CreateAUserRequest.ts, src/api/generated/models/CreateAUserRequest.ts:
  phoneNumber 프로퍼티 + attributeTypeMap에 phone_number 엔트리 (2벌 동기화)
- UserApi.md: createAUser 예제에 phoneNumber 반영
- tests/integration/user.test.ts: pre-existing lastSeenAt 단언 버그(요청이
  set한 값과 단언 -1 불일치) 수정

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeong-hasang jeong-hasang force-pushed the feat/create-user-phone-number branch from 65337c9 to 2bd9b45 Compare June 11, 2026 13:53
@jeong-hasang jeong-hasang marked this pull request as ready for review June 11, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant