Johnny_Guette | 2021-09-13 20:00:24 UTC | #1
I am trying to join a user to a queue using the api https://api.{{environment}}/api/v2/users/:userId/queues/:queueId with the correct useId and queueId data, it returns a 400:
"message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "contextId": "9f41a310-a858-4ab1-9763-695b6008778a"
this is the content of the dumps:
payload = json.dumps({
"name": "",
"division": {
"name": ""
},
"description": "",
"dateCreated": "",
"dateModified": "",
"modifiedBy": "",
"createdBy": "",
"routingRules": [
{
"operator": "ANY",
"threshold": 0,
"waitSeconds": 0
}
],
"bullseye": {
"rings": [
{
"expansionCriteria": [
{
"type": "TIMEOUT_SECONDS",
"threshold": 0
}
],
"actions": {
"skillsToRemove": [
{
"name": "",
"id": "",
"selfUri": ""
}
]
}
}
]
},
"acwSettings": {
"wrapupPrompt": "MANDATORY_TIMEOUT",
"timeoutMs": 0
},
"skillEvaluationMethod": "ALL",
"queueFlow": {
"id": "",
"name": "",
"selfUri": ""
},
"whisperPrompt": {
"id": "",
"name": "",
"selfUri": ""
},
"enableTranscription": False,
"enableManualAssignment": False,
"callingPartyName": "",
"callingPartyNumber": "",
"outboundMessagingAddresses": {
"smsAddress": {
"id": "",
"name": "",
"selfUri": ""
}
},
"outboundEmailAddress": {
"domain": {
"id": "",
"name": "",
"selfUri": ""
},
"route": {
"id": {
"type": "string",
"description": "The globally unique identifier for the object.",
"readOnly": True
},
"name": {
"type": "string"
},
"pattern": {
"type": "string",
"description": "The search pattern that the mailbox name should match."
},
"queue": {
"description": "The queue to route the emails to.",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"selfUri": {
"type": "string",
"format": "uri"
}
}
},
"priority": {
"type": "integer",
"format": "int32",
"description": "The priority to use for routing."
},
"skills": {
"type": "array",
"description": "The skills to use for routing.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"selfUri": {
"type": "string",
"format": "uri"
}
}
}
},
"language": {
"description": "The language to use for routing.",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"selfUri": {
"type": "string",
"format": "uri"
}
}
},
"fromName": {
"type": "string",
"description": "The sender name to use for outgoing replies."
},
"fromEmail": {
"type": "string",
"description": "The sender email to use for outgoing replies."
},
"flow": {
"description": "The flow to use for processing the email.",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"selfUri": {
"type": "string",
"format": "uri"
}
}
},
"replyEmailAddress": {
"description": "The route to use for email replies.",
"type": "object",
"properties": "[Circular]"
},
"autoBcc": {
"type": "array",
"description": "The recipients that should be automatically blind copied on outbound emails associated with this InboundRoute.",
"items": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"spamFlow": {
"description": "The flow to use for processing inbound emails that have been marked as spam.",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"selfUri": {
"type": "string",
"format": "uri"
}
}
},
"selfUri": {
"type": "string",
"format": "uri",
"description": "The URI for this object",
"readOnly": True
},
"type": "string"
}
},
"joined": False
})
Any ideas????
Jerome.Saint-Marc | 2021-09-14 06:28:34 UTC | #2
Hello,
You can use a PATCH /api/v2/users/{userId}/queues/{queueId} to activate/deactivate (join/unjoin) the user from a specific queue With request body - to deactivate the queue for the user:
{ "joined": false }
With request body - to activate the queue for the user:
{ "joined": true }
You can also use a PATCH /api/v2/users/{userId}/queues to activate/deactivate (join/unjoin) the user from multiple queues With request body:
[ { "id": "idofqueue1", "joined": false }, { "id": "idofqueue2", "joined": true } ]
When you send a request, if you don't need to update an attribute value, don't set the attribute. Setting/sending an empty string or an object structure is like sending a value - so the system will not find a division with name = empty string or or queueFlow or ....
Regards,
Johnny_Guette | 2021-09-14 14:53:45 UTC | #3
sorry, maybe I'm misunderstanding the concept, when I follow your steps in both it tells me: "The following queue member records do not exist for the agent:" aaaaa-bbbbb:cccccc-ddddd obviously there is a step that I am missing, the user is created by API with basic data, it belongs to a role and a division, how do I make it a member of a queue?
Jerome.Saint-Marc | 2021-09-14 16:18:44 UTC | #4
Hello,
There are somehow 3 statuses for a user regarding a queue:
- User is not a member of the queue
- User is a member of the queue
2.1) User is activated on the queue (joined = true) 2.2) User is deactivated on the queue (joined = false).
So a user can be assigned to some queues (he is member of Queue1 and of Queue2) but through his Genesys Desktop UI (or a an Admin/Supervisor) he is configured to be only activated in a specific queue at this time (e.g. on Queue1 only). It is similar to not be a member from a distribution perspective - in the sense he won't receive calls via Queue2. See assigning a user to a queue here - under Add Members to the queue and here. See here to activate and deactivate agents in queue
The API methods I listed is to activate/deactivate a queue for a user (so the user must have been added as a member of the queue first).
If you are looking for an API endpoint that allows to add or delete a user from a queue (i.e. queue membership), you can use POST /api/v2/routing/queues/{queueId}/members. It contains an array of object with id of the user: [{"id": "id_of_user_1"}, {"id": "id_of_user_2"}] The delete query parameter (true or false) defines if these agents must be added as members of the queue or must be deleted from the queue.
Regards,
Johnny_Guette | 2021-09-14 16:18:42 UTC | #5
excellent thank you very much
system | 2021-10-15 16:18:59 UTC | #6
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: 11995