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.eu_west_1;
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(); // List | Filter by queue ID(s) (optional)
var divisionId = new List(); // List | Filter by queue division ID(s) (optional)
var peerId = new List(); // List | 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);
}