1

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

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Josef Amalraj
  • 453
  • 3
  • 11

1 Answers1

2

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

John
  • 63
  • 7