Easier ways to add agents to queues

Ferdnand.ouma

Premier Customer
Joined
Feb 9, 2025
Messages
30
Reaction score
2
Hi I'm struggling to add new agents in my queues on V20, in V18 it was pretty much easier, you just select bulk users and add them at once, I'm realizing that in V20 you have to add one user at a time, to make it even worse I have almost 2000 users in a particular queue and I need to add 400 more, so I have to keep on clicking ADD, and option at the very top of the screen then scroll all through the 2000 users already added on queue like for a minute, then search through the list of 4000 users just to ADD a single user!!!!!!!!!!!!, this has to be done for all the 400 new users!!!!!!!!, is there a shorten way of ADDING new users to a queue like we had in V18????????
 
unfortunately not.
 
unfortunately not.
Guys, V20 is proving to be more user unfriendly than even the previous versions, the developers must only had thought about the security and forgot all about the user facing features!!!:(:(:(, every day more and more flows being exposed in the design.
 
Maybe you could create a program and do this using an API. You have the REST API or the Call Control API which would let you do this. Spend some time coding, but then adding all the extensions will be 1 second.
 
  • Like
Reactions: GregG_3CX
Maybe you can use a CFD app to do this, no need to create a program from scratch. Try this:
1) Create a CFD app and add an Execute C# Code component.
2) Add the following C# code to this component:
C#:
// Change 8000 to your queue number
var queue = PhoneSystem.Root.GetDNByNumber("8000") as Queue;

// Repeat this for each agent extension
queue.CreateAgent(PhoneSystem.Root.GetDNByNumber("1001"));
queue.CreateAgent(PhoneSystem.Root.GetDNByNumber("1002"));
queue.CreateAgent(PhoneSystem.Root.GetDNByNumber("1003"));

// Save
queue.Save();

3) Build the app, upload and call it.

Try it first with 1 agent to verify that it works, as I just wrote the code but didn't validate it.

Hope it helps.
 
I encourage you to take a look at our 3CX Profile Manager tool. This tool was specifically designed to help large organizations like yours manage large numbers of users, queues, and ring groups.

Essentially, you create a profile -- perhaps something like "Reception" or "Support Engineer". You associate the desired queues and ring groups with the profile, and then assign users to a profile. We then handle adding/removing people to/from the desired 3CX resources. Contact me and we can discuss how we can make your life so much better.
 
So i'm here in 2026 :). Still nothing changed on this part.
3CX messed up. 3CX doesn't care.
 
@3CX; Just read here. Fix this.

So to add a bunch of users to a queue you have to do
- Click add
- Select from the dropdown-menu. It this is a long list scroll to you cant no more.
- Scroll to the top
- Click add

Extra problems:
- Already added users can be added from the dropdown again. At the top there is a message that there is a duplicate. So go find the duplicate!.
- Users already added are still visible in the dropdown menu which makes it unclear if a user is already added.

Now i don't host 100+ user PBX'es but i can imagine that if you do, you have a hard time managing these queues without the use of third-party apps.
 
Just as a workaround until this is improved. You can create a simple CFD app which uses the C# script mentioned above:

And then make a call to that app to get the queue automatically filled with hundreds of agents in a second.

I agree that this should be improved, for large systems configuring a queue becomes tedious. However, you should be careful with the way you ask this....
 
  • Like
Reactions: Evolute IT
Just as a workaround until this is improved. You can create a simple CFD app which uses the C# script mentioned above:

And then make a call to that app to get the queue automatically filled with hundreds of agents in a second.

I agree that this should be improved, for large systems configuring a queue becomes tedious. However, you should be careful with the way you ask this....

Will give this a shot :).
I know, but it was perfectly fine on v18. It looks like they sometimes forget the impact these changes have on admins. There just is no logic in this.
 
Here's a quick python script, strictly experimental, just for ideas...

run it with:

Bash:
./xapi_queues --fqdn <my_3cx_fqdn> --client_id <my_api_client_id> --client_secret <my_api_client_secret>

...YMMV.

Python:
#!/usr/bin/env python3
import argparse, json, requests, sys

# --- INFORMATION ---
# This will replace ALL queue agents in the target queue

# --- CONFIGURATION ---
fqdn = None
QUEUE_NUMBER = 800
QUEUE_AGENTS = [103, 104, 105, 106]

def get_token(client_id, client_secret):
  url = f"https://{fqdn}/connect/token"
  data = {
    "grant_type": "client_credentials",
    "client_id": client_id,
    "client_secret": client_secret
  }

  response = requests.post(url, data=data)
  response.raise_for_status()
  return response.json()["access_token"]

def request_headers():
  hh = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json"
  }
  return hh

def get_Queues(token):
  url = f"https://{fqdn}/xapi/v1/Queues"

  params = {
    '$select': 'Id,Number'
  }

  response = requests.get(url, params=params, headers=request_headers())

  if response.ok:
    response_data = response.json()
  else:
    print(f"Response Code: {response.status_code}\nResponse Text: {response.text}")
    error_report = {
      "Error": [
        {
          "Response Code": response.status_code,
          "Response Body": response.text
        }
      ]
    }
    return error_report, False
  return response_data, True

def patch_Queues(queue_id, payload, token):
  url = f"https://{fqdn}/xapi/v1/Queues({queue_id})"

  try:
    response = requests.patch(url, data=payload, headers=request_headers())
    response.raise_for_status()
    if not response.text.strip():
      print("Success! (Status {response.status_code}, No body returned)")
    else:
      result=response.json()
      print("Success! Response body:", result)
  except requests.exceptions.HTTPError as err:
    print(f"HTTP error occurred: {err}")
    print(f"Response Body: {response.text}")
  except requests.exceptions.JSONDecodeError:
    print("Success, but the response was not valid JSON.")

def main():
  global fqdn, token
  parser = argparse.ArgumentParser()

  # Define arguments
  parser.add_argument("--fqdn", required=True)
  parser.add_argument("--client_id", required=True)
  parser.add_argument("--client_secret", required=True)

  args = parser.parse_args()

  fqdn = args.fqdn
  token = get_token(args.client_id, args.client_secret)

  data, success = get_Queues(token)
  if not success:
    print("Stopping process due to error:")
    print(json.dumps(data, indent=2))
    sys.exit()

  queues_list = data["value"]
  target_id = next((item['Id'] for item in queues_list if item['Number'] == str(QUEUE_NUMBER)), None)

  if target_id is None:
    print(f"Cannot find Queue with number {QUEUE_NUMBER}")
    sys.exit()

  print(f"Queue with Number {str(QUEUE_NUMBER)} has ID {target_id}")

  payload_string = '{ "Number": "800", "Agents": [ '

  for agent in QUEUE_AGENTS:
    if payload_string.endswith("}"):
      payload_string += ", "
    payload_string += '{ "Number": "' + str(agent) + '" }'

  payload_string += ' ] }'

  print(f"Sending Payload:\n{payload_string}")
  patch_Queues(target_id, payload_string, token)


# --- EXECUTION ---

if __name__ == "__main__":
  main()
 
If I had such a task, I would use a PowerShell script and the 3CX Config API / XAPI. I might even build (or have built) a small GUI for it so that I can click through it. Or there is already a table where all users are maintained, and I would run the script against that table to automate the settings. There are ways to automate this and avoid a click-fest - even if it may have been solved better in v18.
 
We have a tool that makes this pathetically simple -- 3CX Profile Manager.

You create a profile, for example "Sales" and assign all the resources (departments, queues, ring groups) associated with sales. Then you add the user(s) to "Sales" and you are done. And if you need to move someone from "Sales" to "Support".... yup, just a single click to change their assigned profile and it removes the user(s) from all the sales objects and adds them to the support objects.

No more human errors, no more tedious error-prone processes, no more missed steps. This tool was designed precisely for administrative nightmares like yours. We can help.

DM me and we can discuss EXACTLY what you want, and I will make it happen.
 

Latest Posts

Forum statistics

Threads
111,953
Messages
589,915
Members
164,850
Latest member
masvty