Skip to content

Support emails_to_identify and phone_numbers_to_identify in identify_users#70

Open
eligordon wants to merge 1 commit intojonallured:mainfrom
bandzoogle:support-email-and-phone-identify
Open

Support emails_to_identify and phone_numbers_to_identify in identify_users#70
eligordon wants to merge 1 commit intojonallured:mainfrom
bandzoogle:support-email-and-phone-identify

Conversation

@eligordon
Copy link
Copy Markdown

Summary

The Braze /users/identify endpoint accepts three identifier types:

  • aliases_to_identify — identify by user alias
  • emails_to_identify — identify by email address (requires prioritization)
  • phone_numbers_to_identify — identify by phone number (requires prioritization)

Previously only aliases_to_identify was supported. This PR adds support for the email and phone number identifier types, which are used to merge email-only or phone-number-only user profiles into identified users with an external_id.

Changes

  • lib/braze_ruby/rest/identify_users.rb — Accept all three identifier keyword arguments and only include non-empty arrays in the POST payload
  • spec/braze_ruby/rest/identify_users_spec.rb — Add specs for each identifier type, mixed types, and empty defaults
  • README.md — Document email and phone number identification examples
  • CHANGELOG.md — Add entry under Unreleased

Usage

# Identify by email
api.identify_users(
  emails_to_identify: [{
    external_id: 1234,
    email: "user@example.com",
    prioritization: ["unidentified", "most_recently_updated"]
  }]
)

# Identify by phone number
api.identify_users(
  phone_numbers_to_identify: [{
    external_id: 1234,
    phone: "+15555555555",
    prioritization: ["unidentified", "most_recently_updated"]
  }]
)

…users

The Braze /users/identify endpoint accepts three identifier types:
aliases_to_identify, emails_to_identify, and phone_numbers_to_identify.

Previously only aliases_to_identify was supported. This adds support for
the email and phone number identifier types, which are used to merge
email-only or phone-number-only profiles into identified users.

See: https://www.braze.com/docs/api/endpoints/user_data/post_user_identify/
Made-with: Cursor
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