Legacy Dev Forum Posts

 View Only

Sign Up

GetUserQueue is not returning Entity

  • 1.  GetUserQueue is not returning Entity

    Posted 06-05-2025 18:05

    ydan | 2018-09-02 01:55:06 UTC | #1

    I m trying to find a user's queue.

    var apiInstance = new UsersApi(); var userId = ""; // string | User ID var pageSize = 25; var pageNumber = 1; var joined = true; var divisionId = new List<string>(); UserQueueEntityListing result = apiInstance.GetUserQueues(userId, pageSize, pageNumber, joined, divisionId); Console.WriteLine(result);

    However, I cannot see any result under Entities

    Console output: Entities: System.Collections.Generic.List`1[PureCloudPlatform.Client.V2.Model.UserQueue] PageSize: 25 PageNumber: 1 Total: 0 SelfUri: /api/v2/users/../queues?pageSize=25&pageNumber=1 FirstUri: /api/v2/users/..../queues?pageSize=25&pageNumber=1 LastUri: /api/v2/users/...../queues?pageSize=25&pageNumber=1 PreviousUri: NextUri: PageCount: 0

    Also changing it to "result.Entities[0].Name" gave me "Exception when calling UsersApi.GetUserQueues: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

    any help would be appreciated.


    tim.smith | 2018-09-04 13:28:20 UTC | #2

    Only specify values for properties you want to use. Sending an empty userId and divisionId are probably causing this. Also, don't send joined unless you're intending to filter based on that property.


    ydan | 2018-09-08 09:47:21 UTC | #3

    Hi Tim

    Thanks for the reply. Unfortunately, I am still getting an error.

    The user ID wasnt empty and yes 'joined' filter was intended.

    I can confirm that it is working on API explorer with the same userID.

    However using the C# api call returns no result (total 0, pageCount: 0).

    I have tried the following method, but still yield the same result: https://stackoverflow.com/questions/47412183/list-inside-list-does-not-print-elements-instead-shows-system-collections-gener https://www.c-sharpcorner.com/forums/systemcollectionsgenericlist1systemstring https://stackoverflow.com/questions/40957778/system-collections-generic-list1system-string-while-webscraping https://www.codeproject.com/Questions/508573/gotplus-e-cSystem-Collections-Generic-List-e


    tim.smith | 2018-09-10 21:10:26 UTC | #4

    Can you provide correlation IDs from both the dev tools response with entities and the SDK response without entities?


    ydan | 2018-10-09 05:43:52 UTC | #5

    Sorry for the late reply.

    The devtools response correlation id 46aed4e8-4719-426c-9c46-a03dda60ee29

    output: { "entities": [ { "id": "f8885795-433f-4536-a14b-b7e7b5acb7bf", "name": "", "joined": true, "selfUri": "/api/v2/routing/queues/f8885795-433f-4536-a14b-b7e7b5acb7bf" }, { "id": "f802e4a5-b23f-4ac1-b526-9fbdc63e9c27", "name": "", "joined": true, "selfUri": "/api/v2/routing/queues/f802e4a5-b23f-4ac1-b526-9fbdc63e9c27" }, { "id": "32e5ae0b-9ccf-4aa3-9293-cc38c63195d3", "name": "", "joined": true, "selfUri": "/api/v2/routing/queues/32e5ae0b-9ccf-4aa3-9293-cc38c63195d3" ......... and so on

    the SDK response only return the following: { "entities": [], "pageSize": 25, "pageNumber": 1, "total": 0, "selfUri": "/api/v2/users/b3eb6dc9-4723-42d6-b050-b2a9b1753fc7/queues?pageSize=25&pageNumber=1", "firstUri": "/api/v2/users/b3eb6dc9-4723-42d6-b050-b2a9b1753fc7/queues?pageSize=25&pageNumber=1", "lastUri": "/api/v2/users/b3eb6dc9-4723-42d6-b050-b2a9b1753fc7/queues?pageSize=25&pageNumber=1", "pageCount": 0 }


    anon28885283 | 2018-10-09 06:25:34 UTC | #6

    I just tested this and I'm getting the same issue when the 'joined' property is provided for the method call. Tim may be able to check better if this is indeed a bug in order to fix it, but temporarily, you could skip providing 'joined' property since it should default to true anyway. If you need to use the divisionId you could just use named parameters when invoking the method to skip 'joined'.


    ydan | 2018-10-09 18:51:41 UTC | #7

    You are correct, thank you.

    It returns the correct output without passing the joined parameter.

    I think Tim mentioned dont send joined, but I thought I need it because I m filtering based on this too


    system | 2018-11-09 18:53:06 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: 3477