Add Global Profile API support - #101
Open
tholovina-sift wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
- Add nil guard before account_id.empty? in both methods (P1)
- Add params ||= {} to fix nil crash in get_global_profile_by_attributes (P2)
- Strip whitespace from email/phone before empty check and before body assignment (P2)
- Fix RDoc exception class from ApiException to RuntimeError with network error note (P2)
- Convert global_only/include_own_data booleans to strings for consistency with track (P3)
- Content-Type on GET left as-is: PSP merchant GET also sets it (P2/finding 5)
- Add inline comment noting HTTP client host uncertainty (P0)
- Add tests for nil account_id and nil params raising RuntimeError
Co-Authored-By: Claude <noreply@anthropic.com>
tholovina-sift
marked this pull request as ready for review
August 20, 2026 16:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose:
GET /v3/accounts/{accountId}/global_profile/users/{userId}(lookup by Sift user ID) andPOST /v3/accounts/{accountId}/global_profile/lookup(lookup by email and/or phone)Technical overview:
Sift.global_profile_api_pathandSift.global_profile_lookup_api_pathpath helpers added tolib/sift.rbget_global_profile(user_id, opts = {})— GET endpoint; supports:global_onlyand:include_own_dataoptional query params; raisesRuntimeErrorifuser_id,api_key, oraccount_idis nil or emptyget_global_profile_by_attributes(params = {}, opts = {})— POST endpoint with JSON body{email, phone}; raisesRuntimeErrorif neither:emailnor:phoneis provided; strips whitespace before validation so blank strings are rejectedapi_client,Sift::Responsewrapper,account_id/api_key/timeoutoverrides viaoptsTesting plan:
This PR contains all required labels and reviewers as per our Change Management Procedure
Live tested against the Sift API with a real account: both GET and POST returned
ok=truewithidentity_found=true,link_count=31, and fully populated location entriesDeployment plan:
Related documentation is updated
README.md: new "Global Profile API" section with usage examplesHISTORY: new4.7.0entrylib/sift/version.rb: version bumped to4.7.0Merge when Global Profile API is publicly available
Merge before https://github.com/SiftScience/sift-docs/pull/92
Rollback plan:
Customer Impact Assessment: