Set Agent State API
    • Dark
      Light

    Set Agent State API

    • Dark
      Light

    Article summary

    The SetAgentState event is triggered from the Acqueon Workspace ‘Amazon Core’ component whenever the Agent’s state changes due to login, state change, mute/unmute button actions, or browser refresh.

    Pre-requisite

    The agent must be logged in to the application.

    Sequence Diagram

    Message Structure

    Request Parameters

    Value

    channel

    Not Applicable

    topic

    Not Applicable

    subtopic

    Not Applicable

    source

    Not Applicable

    data

    Not Applicable

    Response Parameters

    Value

    channel

    Amazon

    topic

    Agent

    subtopic

    SetAgentState

    message

    «JSON Object»

    Message Parameters

    Parameters

    Mandatory

    Data Type

    Description

    Example Data

    rules

    No

    «JSON Object»

    Refer to the Rules Parameters table.

    NA

    data

    No

    «JSON Object»

    Refer to the Data Parameters table.

    NA

    event

    Yes

    String

    The name of the agent's current availability state. The name of the agent's current availability state. Example: Break

    Not Ready

    source

    Yes

    String

    Example: event

    Event

    Rules Parameters

    Parameter

    Mandatory

    Data Type

    Description

    ButtonStates

    No

    «JSON Object»

    Refer to the ButtonStates Parameters table.

    ResponseActual

    No

    «JSON Object»

    Refer here.

    ButtonStates Parameters

    Parameter

    Mandatory

    Data Type

    Description

    items

    No

    «JSON Object»

    Refer to the Items Parameters table.

    count

    No

    Integer

    Example: 5

    Items Parameters

    Parameters

    Mandatory

    Data Type

    Description

    Example Data

    NotReady

    No

    String

    Example: Enable

    NA

    Ready

    No

    String

    Example: Enable

    NA

    make_call

    No

    String

    Example: Enable

    Not Ready

    mute

    No

    String

    Example: Enable

    Event

    unmute

    No

    String

    Example: Hide

    Data Parameters

    Parameter

    Mandatory

    Data Type

    Description

    muted

    No

    Boolean

    When agents mute/unmute APIs are called. Example: false

    name

    No

    String

    The agent's user-friendly display name. Example: Henry

    extension

    No

    String

    This is the phone number that is dialled by Amazon Connect to connect calls to the agent for incoming and outgoing calls if softphone is not enabled. Example: “”

    loginName

    No

    String

    The username for the agent as entered in their Amazon Connect user account. Example: henry@abc.com

    softphoneEnabled

    No

    Boolean

    Indicates whether the agent's phone calls should route to the agent's browser-based softphone or the telephone number configured as the agent's extension.

    routingProfile

    No

    <<JSON Object>>

    Refer here.

    state

    No

    String

    The name of the agent's current availability state. Example: Compliance(non-PEWC)

    reasonCode

    No

    <<JSON Object>>

    Refer to ReasonCode Parameters table.

    stateChangeTime

    No

    String

    A date that indicates when the state was set.

    type

    No

    String

    The agent's current availability state type, as per the AgentStateType enumeration.

    ReasonCode Parameters

    Parameter

    Mandatory

    Data Type

    Description

    id

    No

    String

    The name of the agent's current availability state. Example: Compliance(non-pewc)

    Sample Request

    Not applicable

    Sample Response

    {
        "channel": "Amazon",
        "topic": "Agent",
        "subtopic": "SetAgentState",
        "message": {
            "rules": {
                "ButtonStates": {
                    "items": {
                        "NotReady": "Enable",
                        "Ready": "Enable",
                        "make_call": "Enable",
                        "mute": "Enable",
                        "unmute": "Hide"
                    },
                    "count": 5
                },
                "ResponseActual": {
                    "agentStateARN": "xxx:aws:connect:us-east-1:091257198195:instance/b2ebfefd-5d6f-440d-a968-979a5e0e4ecb/agent-state/ee4ba516-973f-4570-a674-e16b3bcdad27",
                    "type": "not_routable",
                    "name": "Compliance(non-pewc)",
                    "startTimestamp": "2024-08-22T18:06:30.018Z"
                }
            },
            "data": {
                "muted": false,
                "name": "xxx",
                "extension": "",
                "loginName": "xxx.GomezParker@truist.com",
                "softphoneEnabled": true,
                "routingProfile": {
                    "name": "MPS Non-Utility",
                    "routingProfileARN": "xxx:aws:connect:us-east-1:091257198195:instance/b2ebfefd-5d6f-440d-a968-979a5e0e4ecb/routing-profile/f39a838a-700c-40bc-b3d0-8c2b0c220a8c",
                    "defaultOutboundQueue": {
                        "queueARN": "xxx:aws:connect:us-east-1:091257198195:instance/b2ebfefd-5d6f-440d-a968-979a5e0e4ecb/queue/d465cc72-560c-4053-8824-e7d24fe0c91c",
                        "name": "MPS_Outreach",
                        "queueId": "arn:aws:connect:us-east-1:091257198195:instance/b2ebfefd-5d6f-440d-a968-979a5e0e4ecb/queue/d465cc72-560c-4053-8824-e7d24fe0c91c"
                    },
                    "channelConcurrencyMap": {
                        "VOICE": 1
                    },
                    "queues": [
                        {
                            "queueARN": "xxx:aws:connect:us-east-1:091257198195:instance/b2ebfefd-5d6f-440d-a968-979a5e0e4ecb/queue/e4b43ed3-756e-48da-9fd8-36974d264ca5",
                            "name": "MPS_BK_Spanish",
                            "queueId": "xxx:aws:connect:us-east-1:091257198195:instance/b2ebfefd-5d6f-440d-a968-979a5e0e4ecb/queue/e4b43ed3-756e-48da-9fd8-36974d264ca5"
                        }
                    ],
                    "routingProfileId": "xxx:aws:connect:us-east-1:091257198195:instance/b2ebfefd-5d6f-440d-a968-979a5e0e4ecb/routing-profile/f39a838a-700c-40bc-b3d0-8c2b0c220a8c"
                },
                "state": "Not_Ready",
                "reasonCode": {
                    "id": "Compliance(non-pewc)"
                },
                "stateChangeTime": "2024-08-22T18:06:30.018Z",
                "type": "not_routable"
            },
            "event": "Compliance(non-pewc)",
            "source": "event"
        }
    }
    

    Compatible Workspace Version

    3.21.2410 onwards


    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.