Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds contacts.checkExistence endpoint #34194

Merged
merged 10 commits into from
Dec 19, 2024

Conversation

matheusbsilva137
Copy link
Member

@matheusbsilva137 matheusbsilva137 commented Dec 17, 2024

Proposed changes (including videos or screenshots)

  • Added a new contacts.checkExistence endpoint, which allows identifying whether there's already a contact registered using a given email, phone, id or visitor to source association.

Issue(s)

Steps to test or reproduce

Example request (cURL):

curl --request GET \
  --url 'http://localhost:3000/api/v1/omnichannel/contacts.checkExistence?email=teste%40example.com' \
  --header 'X-Auth-Token: jVrwkAmobgfne3aEdL-dJh-znNXMkhg79pEAZS2rEIg' \
  --header 'X-User-Id: rMq9ovRmZabXHW4Do' \

Example response: { exists: true, success: true }

This endpoints only fails in case invalid query params (or more than one valid param) are provided. Accepted params are: contactId, email, phone and visitor (which is an object containing a visitorId and a source, same as in the contacts.get endpoint).

The view-livechat-contact permission is required in order to use this endpoint.

Further comments

CORE-888

Copy link
Contributor

dionisio-bot bot commented Dec 17, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.81%. Comparing base (82e667f) to head (c7af3ca).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #34194   +/-   ##
========================================
  Coverage    75.81%   75.81%           
========================================
  Files          512      512           
  Lines        22208    22208           
  Branches      5404     5404           
========================================
  Hits         16837    16837           
  Misses        4720     4720           
  Partials       651      651           
Flag Coverage Δ
unit 75.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

github-actions bot commented Dec 17, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34194/
on branch gh-pages at 2024-12-19 12:24 UTC

Copy link

changeset-bot bot commented Dec 17, 2024

🦋 Changeset detected

Latest commit: c7af3ca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/rest-typings Minor
@rocket.chat/meteor Minor
@rocket.chat/api-client Patch
@rocket.chat/core-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/network-broker Patch
@rocket.chat/livechat Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/core-typings Minor
@rocket.chat/apps Patch
@rocket.chat/cron Patch
@rocket.chat/freeswitch Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/models Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@matheusbsilva137 matheusbsilva137 marked this pull request as ready for review December 17, 2024 02:53
@matheusbsilva137 matheusbsilva137 requested review from a team as code owners December 17, 2024 02:53
tapiarafael
tapiarafael previously approved these changes Dec 17, 2024
KevLehman
KevLehman previously approved these changes Dec 17, 2024
@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Dec 17, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Dec 17, 2024
@kodiakhq kodiakhq bot merged commit b845fc0 into develop Dec 19, 2024
49 checks passed
@kodiakhq kodiakhq bot deleted the feat/contacts-check-existence-endpoint branch December 19, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants