How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Designing a clean adapter API when an external service supports multiple identifier formats

calendar_today June 9, 2026 person Dilruk Jayasinghe domain spring-boot

I have an external service adapter that retrieves a user profile: UserProfileDto getUserProfile(String profileId); The underlying service accepts multiple identifier formats through the same parameter, for example: userId SIN::accountId 94::phoneNumber Because the API accepts a generic String , callers throughout the codebase often build these values manually: getUserProfile(“SIN::” + accountId); or getUserProfile(countryCode + “::” + phoneNumber); This has led to identifier formatting logic being scattered across the codebase, and it’s not obvious which identifier types are actually supported

open_in_new Read original post