Receiving empty data from WebAPI when searching existing users

I am currently building a python script that integrates with the TDX WebAPI, but I've run into an issue regarding the /TDWebAPI/api/people/lookup (Lookup) and /TDWebAPI/api/people/search (Search) endpoints. When I use either of these endpoints I only receive back '[]' as the content of the HttpResponse. I am testing on the sandbox and I have verified that the data I am looking for exists and I am accessing the API with valid credentials. I have tested this on both our sandbox and production instances.

  1. Lookup
    1. params
      1. searchText
      2. maxResults
    2. I'm sending
      1. method = GET
      2. https://mydomain/SBTDWebApi/api/people/lookup?searchText=Testing&maxResults=50
  2. Search
    1. params
      1. json containing data to search on
    2. I'm sending
      1. method = POST
      2. https://mydomain/SBTDWebApi/api/people/search
        1. json = {"SearchText": "Testing")
Tags search API people users people-search
Asked by Harrison Fleisher on Mon 4/24/23 4:48 PM Last edited Tue 4/25/23 9:43 AM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Tue 4/25/23 9:17 AM

Hi Harrison,

Which user account are you authenticating into the API with in your sandbox environment?

Assuming your call is structured properly, the only reason those calls would fail would be if the user you authenticated with doesn't have People app access.

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
I am using an account created for facilitating API calls. It has access to the People app. I also call the getuser endpoint and verify that this account has access to the People app before attempting to search for users.

I have received data from these to endpoints before, but I am no longer able to do so.
- Harrison Fleisher Tue 4/25/23 9:28 AM
Out of curiosity, what is the domain that is being used for your calls? - Mark Sayers Tue 4/25/23 9:44 AM
For the moment I will assume my call is structured improperly. As the Lookup endpoint does not require access to the People app, what is wrong with the URL structure as given in the question?
For reference: https://mydomain/SBTDWebApi/api/people/lookup?searchText=Testing&maxResults=50
- Harrison Fleisher Tue 4/25/23 10:12 AM
That URL looks correct assuming you're using the right domain. So it's either the authentication isn't happening properly, or the account being used doesn't have permission to return the data in question.

Have you been able to use Postman or Fiddler to get authenticated and make this call? I had no trouble getting results when I tested to my own environment with a normal user account. If you'd like to get into account permission specifics please submit a support ticket so we can talk more freely. https://solutions.teamdynamix.com/TDClient/1965/Portal/Requests/ServiceDet?ID=2154
- Mark Sayers Tue 4/25/23 10:49 AM
The account I was using lacked the "View People from All Accts/Depts" permission in its security role. That was the solution for this case. - Harrison Fleisher Tue 4/25/23 2:19 PM