Legacy Dev Forum Posts

 View Only

Sign Up

Search Username for Teams Users

  • 1.  Search Username for Teams Users

    Posted 06-05-2025 18:50

    Troy | 2021-02-24 16:09:43 UTC | #1

    Hi, We are trying to display the MS Teams User Name to an Agent when call arrives from internal party. Not sure if this should work out of the box, I would have expected a reverse lookup but there doesn't seem to be a variable I can set in the embeddable framework, so I am trying to create a Data Actions to search based on ANI.

    Trouble is, it doesn't seem to search the SCiM integrated Teams as addresses. I have tried addresses, addresses.voice. It returns a result for any numbers added directly to the profile, but will not match any numbers that are in the Teams sections although they return ok if I find the same user based on email.

    Is there a list of valid Fields that I can use to search?

    { "pageSize": 5, "pageNumber": 1, "query": [{ "type": "CONTAINS", "fields": ["addresses"], "value": "+618" }] }


    Clif_Jones | 2021-02-24 00:13:15 UTC | #2

    Hi Troy,

    Try adapting your search to POST to /api/v2/users/search with this body or something similar: { "pageNumber": 1, "pageSize": 4, "query": [ { "type": "EXACT", "fields": [ "integration" ], "value": "microsoftteams" } ], "sortBy": "name", "sortOrder": "ASC", "types": [ "users", "groups", "locations" ], "returnFields": [ "ALL_FIELDS" ] }

    Please let me know if this works.


    Troy | 2021-02-24 02:27:54 UTC | #3

    Thanks, but unfortunately not. This search finds all the users but I am trying to search for the user based on their Phone Number. If I change the value to to say "+612xxxxxxxx" this does not return any results.

    I can see their number sitting in the profile if I get the User but the Searching just seems to ignore the number if its its been imported through SCiM into the Teams Integration


    Clif_Jones | 2021-02-24 15:55:36 UTC | #4

    Troy,

    Unfortunately, what you are trying to do there will not work at this time. Currently, search indexes the primary, work, mobile, and home numbers and not the other phone address fields. Since our MS Teams integration sends the associated phone number to the other phone field, search will not match it. That being said, if you are simply trying to filter on users with a MS Teams contact as described above, the easiest way to do that is to search for the integration tag, as it is indexed on users that have a MS Teams contact. The integration tag value for MS Teams is "microsoftteams". Also, I have given feedback to our developer relations team to improve the Search Query Tool to include this tag and to update the documentation on what user profile items are searchable.


    Clif_Jones | 2021-02-24 20:04:48 UTC | #5

    Also, for the user phone number fields that are indexed (mentioned above), it is more effective to search like this:

    { "pageSize": 5, "pageNumber": 1, "query": [{ "type": "CONTAINS", "fields": ["addresses.voice"], "value": "+618" }] }

    As mentioned above, this still will not find the PBX integrations. such as MS Teams. Use the integration tag search instead.


    Troy | 2021-02-24 22:10:22 UTC | #6

    Thanks for letting me know. What we are trying to achieve is to simply show the Callers Name to the Genesys user (In the embedded client) when the call is coming from an internal caller on Teams.

    If we type the number in the Search Bar on the standard GUI, it fins the user when we enter the number so I assume there must be some way to do this with the API. Is there any other search we can use? What search is used in the GUI?


    Clif_Jones | 2021-02-25 16:15:44 UTC | #7

    When the UI displays a user during a search, it does it in 2 parts:

    1. POST /api/v2/search gets the users and their user-IDs.
    2. GET /api/v2/profiles/users along with the desired user expands.

    For #2 the UI will batch the request from the search results using the id query parameter with comma-separated user IDs.

    One note on reverse number lookup. The MS Teams contact is stored in the otherPhone address field, which is not indexed by search. I can raise this to our product management team but it always helps to post this feature request on our Ideas page, which can increase its priority.


    system | 2021-03-28 16:15:46 UTC | #8

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 10062