I am trying to automate adding an existing agent to an agent pool in a client but can’t seem to get it right. Any help would be greatly appreciated! As many of you are aware Broadcom’s documentation for all things Automic is rather lacking! My questions are:
1. Does this functionality exist in Automic v24?
2. If it does, has anyone done this and would you share your code with me?
3. Is there any documentation on the REST API out there that’s better than Broadcom’s?
4. Here is what Copilot gave me, but doesn’t work. Any suggestions, other than not using Copilot :-)
# This script adds an agent to an agent group membership using the AE REST API.
REST_ENDPOINT=“< <https: aoa-rest.idx-pl-live.eislz.com>endPoint>"
CLIENT=“<clientnumber>"
AGENTGROUP_ID="WINDOWS_POOL"
AGENT_ID=“<agentname>"
read -sp "Enter password: " PASSWORD
AE_USER_PW=“<username>:$PASSWORD"
# JSON payload
PAYLOAD=$(cat << />
{
"agent_id": "${AGENT_ID}"
}
EOF
)
echo "Adding agent $NEW_AGENT to Agent Group $AGENT_GROUP for client $CLIENT"
URL="$REST_ENDPOINT/ae/api/v1/${CLIENT}/agentgroups/${AGENTGROUP_ID}/agents"
response=$(curl -X POST "${URL}" \
--header "Content-Type: application/json" \
--user "$AE_USER_PW" \
--data "${PAYLOAD}")
# Output the response
echo "Response: ${response}"
# Check if the response contains an error
if echo "$response" | grep -q '"error"'; then
echo "Error adding agent to agent group: $response"
else
echo "Agent added successfully."
fi
I get the following output:
Adding agent to Agent Group for client <clientnumber>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 160 100 125 100 35 1157 324 --:--:-- --:--:-- --:--:-- 1481
Response: {
"code" : 45109,
"error" : "The requested resource cannot be found.",
"details" : "No detail information available."
}
Error adding agent to agent group: {
"code" : 45109,
"error" : "The requested resource cannot be found.",
"details" : "No detail information available."
}</clientnumber></username></agentname></clientnumber></https:>