Josef Amalraj
Josef Amalraj

Reputation: 463

How to get the Agent Email Address from amazon connect logged in

i have build sample amazon connect login to get the agent details from javascript api, but do not have any docs to get agent email address i followed docs https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md Kindly help me how to get the email adddress

Upvotes: 2

Views: 605

Answers (1)

John
John

Reputation: 123

You can get the email address of the User by using the describeUser.

    var AWS = require('aws-sdk');
    var connect = new AWS.Connect();

    exports.handler = function (event) {
        var params = {
          InstanceId: 'STRING_VALUE', /* required */
          UserId: 'STRING_VALUE' /* required */
        };
        connect.describeUser(params, function(err, data) {
            if (err) console.log(err, err.stack);
            else console.log(data.User.IdentityInfo.Email);
        });
    }

From the documentation you posted: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Connect.html#describeUser-property

An example of what the User object looks like: https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html

Upvotes: 3

Related Questions