Legacy Dev Forum Posts

 View Only

Sign Up

GetRoutingQueues: {"message":"You are not authorized to perform the requested action."

  • 1.  GetRoutingQueues: {"message":"You are not authorized to perform the requested action."

    Posted 06-05-2025 18:06

    Gerard_Tobin | 2022-09-14 14:31:03 UTC | #1

    I am getting an error when running the code below. Error calling GetRoutingQueues: {"message":"You are not authorized to perform the requested action.","code":"not.authorized","status":403,"contextId":"be982a3d-0ae0-4ee2-8689-b26db503cf74","details":[],"errors":[]}

    The code works for conversatioin aggregates queries but not GetRoutingQueues

    using PureCloudPlatform.Client.V2.Api; using PureCloudPlatform.Client.V2.Client; using PureCloudPlatform.Client.V2.Model; using PureCloudPlatform.Client.V2.Extensions; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks;

    RoutingApi apiInstance2 = null; PureCloudRegionHosts region = PureCloudRegionHosts.euwest1; Configuration.Default.ApiClient.setBasePath(region); string clientID = "**********"; string secret = "************"; var accessTokenInfo = Configuration.Default.ApiClient.PostToken(clientID, secret); Console.WriteLine("Access token=" + accessTokenInfo.AccessToken);

    apiInstance2 = new RoutingApi();

    var pageNumber = 1; // int?

    Page number (optional) (default to 1)

    var pageSize = 10; // int?

    Page size (optional) (default to 25)

    //var sortOrder = sortOrder_example; // string

    Note: results are sorted by name. (optional) (default to asc)

    //var name = name_example; // string

    Filter by queue name (optional)

    var id = new List<string>(); // List<string>

    Filter by queue ID(s) (optional)

    var divisionId = new List<string>(); // List<string>

    Filter by queue division ID(s) (optional)

    var peerId = new List<string>(); // List<string>

    Filter by queue peer ID(s) (optional)

    var hasPeer = true; // bool?

    Filter by queues associated with peer (optional)

    try { // Get list of queues. QueueEntityListing result = apiInstance2.GetRoutingQueues(pageNumber, pageSize, "", "", id, divisionId, peerId, hasPeer); Debug.WriteLine("Queues " + result); } catch (Exception e) { Debug.Print("Exception when calling RoutingApi.GetRoutingQueues: " + e.Message); }


    jacobshaw | 2022-09-14 16:41:43 UTC | #2

    Hi @Gerard_Tobin The oauth client you use for the request must have the routing:queue:view permission assigned for this resource.

    The corresponding resource is GET /api/v2/routing/queues

    You can find the permissions info in the "Operation Information" tab for the resource


    Gerard_Tobin | 2022-09-30 12:43:37 UTC | #3

    Hi jacobshaw, can you send screenshots or articles showing how to set this permission?


    John_Carnell | 2022-10-04 17:13:02 UTC | #4

    Hi Gerad,

    You would need to login into Genesys Cloud Admin and then go to Admin tab (right along the top). From there search for OAuth. In there you will find all of the OAuth credentials created for your org. Select the org in question and then go to the roles tab (an OAuth client is assigned a role). From there you can select the role and any new permissions that are needed.

    More information on setting up an OAuth Client can be found here.

    Thanks, John Carnell Manager, Developer Engagement


    system | 2022-11-04 17:13:40 UTC | #5

    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: 16287