Legacy Dev Forum Posts

 View Only

Sign Up

UserDetailsQuery python sdk response not matching

  • 1.  UserDetailsQuery python sdk response not matching

    Posted 06-05-2025 18:09

    praveenkumar.dm | 2023-06-14 08:31:38 UTC | #1

    I am using the below code to fetch the user details from API "UserDetailsQuery", In the response the total hits is not matching with the userdetails value. even though i iterate through pagination it is not matching with the totalhits. can you please explain.

    
    apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token(
        GENESYS_CLOUD_CLIENT_ID, GENESYS_CLOUD_CLIENT_SECRET
    )
    PureCloudPlatformClientV2.configuration.access_token = apiclient.access_token
    api_instance = PureCloudPlatformClientV2.UsersApi()
    
    body = PureCloudPlatformClientV2.UserDetailsQuery()
    body.paging = PureCloudPlatformClientV2.PagingSpec()
    
    previous_day = datetime.now() - timedelta(days=1)
    start_of_previous_day = datetime(previous_day.year, previous_day.month, previous_day.day, 0, 0, 0)
    end_of_previous_day = datetime(previous_day.year, previous_day.month, previous_day.day, 23, 59, 59)
    int_time = start_of_previous_day.strftime("%Y-%m-%dT%H:%M:%S") + "/" + end_of_previous_day.strftime(
        "%Y-%m-%dT%H:%M:%S")
    
    body.interval = int_time
    body.paging.page_size = 100
    body.paging.page_number = 1
    api_response = api_instance.post_analytics_users_details_query(body).to_json()


    Ebenezer_Osei | 2023-06-14 18:05:51 UTC | #2

    Hi,

    Total hits is meant to be an approximate number. Hope that answers your question.

    Best


    praveenkumar.dm | 2023-06-15 13:41:19 UTC | #3

    So it doesnt mean that the total_hits value shouldn't match with the api response?


    John_Carnell | 2023-07-03 19:34:57 UTC | #4


    This post was migrated from the old Developer Forum.

    ref: 20431