How to get queueId

Hi,

I made below Java code for get a queueId. however getUserQueues() is return 403.

Body: {"message":"You are not authorized to perform the requested action.","code":"not.authorized","status":403}

Auth process should be success. What more do you need?


    apiClient = ApiClient.Builder.standard()
        .withBasePath(region)
        .withRetryConfiguration(retryConfiguration)
        .withLoggingConfiguration(loggingConfiguration)
        .withShouldRefreshAccessToken(true)
        .build();

    ApiResponse<AuthResponse> authResponse = apiClient.authorizeClientCredentials(clientId, clientSecret);
    System.out.println("authResponse body: " + authResponse.getBody().toString());

    Configuration.setDefaultApiClient(apiClient);

    UsersApi usersApi = new UsersApi();
    UserEntityListing response = usersApi.getUsers(null, null, null, null, null, null, null, null);
    List<User> users = response.getEntities();

    for (User user : users) {
        UserQueueEntityListing userQueues = usersApi.getUserQueues(user.getId(), null, null, null, null);
        System.out.println(userQueues);
        for (UserQueue userQueue : userQueues.getEntities()){
            System.out.println("queueId:" + userQueue.getId());
        }
    }

Hi,

A 403 means you have successfully authenticated but don't have the permissions to request a resource.

The API documentation for GET /api/v2/users/{userId}/queues shows that the following permissions are required:

routing:queue:view
routing:queue:join
routing:queueMember:manage

You will need to ask an admin in your Genesys Cloud organization to add the above permissions to your OAuth Client.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.